@content-blocks/js 0.7.6 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,5 +22,5 @@ import{r as t,h as e,H as i,g as s,c as n}from"./p-13c3cc4f.js";import{W as r}fr
22
22
  /*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class ld{constructor(t){let e=this;e.id=t.id;e.label=e.id;e.width=t.width;e.height=t.height;e.bitrate=t.bandwidth;e.frameRate=t.frameRate;e.enabled_=t.enabled;Object.defineProperty(e,"enabled",{get(){return e.enabled_()},set(t){e.enabled_(t)}});return e}}class ud extends cd.EventTarget{constructor(){super();let t=this;t.levels_=[];t.selectedIndex_=-1;Object.defineProperty(t,"selectedIndex",{get(){return t.selectedIndex_}});Object.defineProperty(t,"length",{get(){return t.levels_.length}});t[Symbol.iterator]=()=>t.levels_.values();return t}addQualityLevel(t){let e=this.getQualityLevelById(t.id);if(e){return e}const i=this.levels_.length;e=new ld(t);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(e);this.trigger({qualityLevel:e,type:"addqualitylevel"});return e}removeQualityLevel(t){let e=null;for(let i=0,s=this.length;i<s;i++){if(this[i]===t){e=this.levels_.splice(i,1)[0];if(this.selectedIndex_===i){this.selectedIndex_=-1}else if(this.selectedIndex_>i){this.selectedIndex_--}break}}if(e){this.trigger({qualityLevel:t,type:"removequalitylevel"})}return e}getQualityLevelById(t){for(let e=0,i=this.length;e<i;e++){const i=this[e];if(i.id===t){return i}}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}ud.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const Fb in ud.prototype.allowedEvents_){ud.prototype["on"+Fb]=null}var fd="4.1.0";const dd=function(t,e){const i=t.qualityLevels;const s=new ud;const n=function(){s.dispose();t.qualityLevels=i;t.off("dispose",n)};t.on("dispose",n);t.qualityLevels=()=>s;t.qualityLevels.VERSION=fd;return s};const pd=function(t){return dd(this,cd.obj.merge({},t))};cd.registerPlugin("qualityLevels",pd);pd.VERSION=fd;
23
23
  /*! @name @videojs/http-streaming @version 3.13.2 @license Apache-2.0 */const vd=Ee;const md=(t,e)=>{if(e&&e.responseURL&&t!==e.responseURL){return e.responseURL}return t};const gd=t=>{if(cd.log.debug){return cd.log.debug.bind(cd,"VHS:",`${t} >`)}return function(){}};function bd(...t){const e=cd.obj||cd;const i=e.merge||e.mergeOptions;return i.apply(e,t)}function yd(...t){const e=cd.time||cd;const i=e.createTimeRanges||e.createTimeRanges;return i.apply(e,t)}function jd(t){if(t.length===0){return"Buffered Ranges are empty"}let e="Buffered Ranges: \n";for(let i=0;i<t.length;i++){const s=t.start(i);const n=t.end(i);e+=`${s} --\x3e ${n}. Duration (${n-s})\n`}return e}const wd=1/30;const Td=wd*3;const kd=function(t,e){const i=[];let s;if(t&&t.length){for(s=0;s<t.length;s++){if(e(t.start(s),t.end(s))){i.push([t.start(s),t.end(s)])}}}return yd(i)};const Sd=function(t,e){return kd(t,(function(t,i){return t-Td<=e&&i+Td>=e}))};const xd=function(t,e){return kd(t,(function(t){return t-wd>=e}))};const Ad=function(t){if(t.length<2){return yd()}const e=[];for(let i=1;i<t.length;i++){const s=t.end(i-1);const n=t.start(i);e.push([s,n])}return yd(e)};const Ed=function(t,e){let i=null;let s=null;let n=0;const r=[];const o=[];if(!t||!t.length||!e||!e.length){return yd()}let a=t.length;while(a--){r.push({time:t.start(a),type:"start"});r.push({time:t.end(a),type:"end"})}a=e.length;while(a--){r.push({time:e.start(a),type:"start"});r.push({time:e.end(a),type:"end"})}r.sort((function(t,e){return t.time-e.time}));for(a=0;a<r.length;a++){if(r[a].type==="start"){n++;if(n===2){i=r[a].time}}else if(r[a].type==="end"){n--;if(n===1){s=r[a].time}}if(i!==null&&s!==null){o.push([i,s]);i=null;s=null}}return yd(o)};const Id=t=>{const e=[];if(!t||!t.length){return""}for(let i=0;i<t.length;i++){e.push(t.start(i)+" => "+t.end(i))}return e.join(", ")};const Dd=function(t,e,i=1){const s=t.length?t.end(t.length-1):0;return(s-e)/i};const Cd=t=>{const e=[];for(let i=0;i<t.length;i++){e.push({start:t.start(i),end:t.end(i)})}return e};const Nd=function(t,e){if(t===e){return false}if(!t&&e||!e&&t){return true}if(t.length!==e.length){return true}for(let i=0;i<t.length;i++){if(t.start(i)!==e.start(i)||t.end(i)!==e.end(i)){return true}}return false};const _d=function(t){if(!t||!t.length||!t.end){return}return t.end(t.length-1)};const Od=function(t,e){let i=0;if(!t||!t.length){return i}for(let s=0;s<t.length;s++){const n=t.start(s);const r=t.end(s);if(e>r){continue}if(e>n&&e<=r){i+=r-e;continue}i+=r-n}return i};const Md=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach((function(t){i+=t.duration}));(e.preloadHints||[]).forEach((function(e){if(e.type==="PART"){i+=t.partTargetDuration}}));return i};const Rd=t=>(t.segments||[]).reduce(((t,e,i)=>{if(e.parts){e.parts.forEach((function(s,n){t.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:e})}))}else{t.push({duration:e.duration,segmentIndex:i,partIndex:null,segment:e,part:null})}return t}),[]);const Ld=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]};const Pd=({preloadSegment:t})=>{if(!t){return}const{parts:e,preloadHints:i}=t;let s=(i||[]).reduce(((t,e)=>t+(e.type==="PART"?1:0)),0);s+=e&&e.length?e.length:0;return s};const $d=(t,e)=>{if(e.endList){return 0}if(t&&t.suggestedPresentationDelay){return t.suggestedPresentationDelay}const i=Ld(e).length>0;if(i&&e.serverControl&&e.serverControl.partHoldBack){return e.serverControl.partHoldBack}else if(i&&e.partTargetDuration){return e.partTargetDuration*3}else if(e.serverControl&&e.serverControl.holdBack){return e.serverControl.holdBack}else if(e.targetDuration){return e.targetDuration*3}return 0};const Fd=function(t,e){let i=0;let s=e-t.mediaSequence;let n=t.segments[s];if(n){if(typeof n.start!=="undefined"){return{result:n.start,precise:true}}if(typeof n.end!=="undefined"){return{result:n.end-n.duration,precise:true}}}while(s--){n=t.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=Md(t,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const Ud=function(t,e){let i=0;let s;let n=e-t.mediaSequence;for(;n<t.segments.length;n++){s=t.segments[n];if(typeof s.start!=="undefined"){return{result:s.start-i,precise:true}}i+=Md(t,s);if(typeof s.end!=="undefined"){return{result:s.end-i,precise:true}}}return{result:-1,precise:false}};const Bd=function(t,e,i){if(typeof e==="undefined"){e=t.mediaSequence+t.segments.length}if(e<t.mediaSequence){return 0}const s=Fd(t,e);if(s.precise){return s.result}const n=Ud(t,e);if(n.precise){return n.result}return s.result+i};const qd=function(t,e,i){if(!t){return 0}if(typeof i!=="number"){i=0}if(typeof e==="undefined"){if(t.totalDuration){return t.totalDuration}if(!t.endList){return z.Infinity}}return Bd(t,e,i)};const Vd=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:s}){let n=0;if(i>s){[i,s]=[s,i]}if(i<0){for(let e=i;e<Math.min(0,s);e++){n+=t}i=0}for(let t=i;t<s;t++){n+=e[t].duration}return n};const zd=function(t,e,i,s){if(!t||!t.segments){return null}if(t.endList){return qd(t)}if(e===null){return null}e=e||0;let n=Bd(t,t.mediaSequence+t.segments.length,e);if(i){s=typeof s==="number"?s:$d(null,t);n-=s}return Math.max(0,n)};const Hd=function(t,e,i){const s=true;const n=e||0;let r=zd(t,e,s,i);if(r===null){return yd()}if(r<n){r=n}return yd(n,r)};const Xd=function({playlist:t,currentTime:e,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let o=e-n;const a=Rd(t);let h=0;for(let t=0;t<a.length;t++){const e=a[t];if(i!==e.segmentIndex){continue}if(typeof s==="number"&&typeof e.partIndex==="number"&&s!==e.partIndex){continue}h=t;break}if(o<0){if(h>0){for(let e=h-1;e>=0;e--){const i=a[e];o+=i.duration;if(r){if(o<0){continue}}else if(o+wd<=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Vd({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}}return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}if(h<0){for(let i=h;i<0;i++){o-=t.targetDuration;if(o<0){return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}}h=0}for(let e=h;e<a.length;e++){const i=a[e];o-=i.duration;const s=i.duration>wd;const c=o===0;const l=s&&o+wd>=0;if(c||l){if(e!==a.length-1){continue}}if(r){if(o>0){continue}}else if(o-wd>=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Vd({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}return{segmentIndex:a[a.length-1].segmentIndex,partIndex:a[a.length-1].partIndex,startTime:e}};const Gd=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()};const Yd=function(t){return t.excludeUntil&&t.excludeUntil===Infinity};const Wd=function(t){const e=Gd(t);return!t.disabled&&!e};const Jd=function(t){return t.disabled};const Kd=function(t){for(let e=0;e<t.segments.length;e++){if(t.segments[e].key){return true}}return false};const Qd=function(t,e){return e.attributes&&e.attributes[t]};const Zd=function(t,e,i,s=0){if(!Qd("BANDWIDTH",i)){return NaN}const n=t*i.attributes.BANDWIDTH;return(n-s*8)/e};const tp=(t,e)=>{if(t.playlists.length===1){return true}const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter((t=>{if(!Wd(t)){return false}return(t.attributes.BANDWIDTH||0)<i})).length===0};const ep=(t,e)=>{if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}if(t.id&&e.id&&t.id===e.id){return true}if(t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri){return true}if(t.uri&&e.uri&&t.uri===e.uri){return true}return false};const ip=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let s=false;for(const t in i){for(const n in i[t]){s=e(i[t][n]);if(s){break}}if(s){break}}return!!s};const sp=t=>{if(!t||!t.playlists||!t.playlists.length){const e=ip(t,(t=>t.playlists&&t.playlists.length||t.uri));return e}for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];const s=i.attributes&&i.attributes.CODECS;if(s&&s.split(",").every((t=>Ye(t)))){continue}const n=ip(t,(t=>ep(i,t)));if(n){continue}return false}return true};var np={liveEdgeDelay:$d,duration:qd,seekable:Hd,getMediaInfoForTime:Xd,isEnabled:Wd,isDisabled:Jd,isExcluded:Gd,isIncompatible:Yd,playlistEnd:zd,isAes:Kd,hasAttribute:Qd,estimateSegmentRequestTime:Zd,isLowestEnabledRendition:tp,isAudioOnly:sp,playlistMatch:ep,segmentDurationWithParts:Md};const{log:rp}=cd;const op=(t,e)=>`${t}-${e}`;const ap=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`;const hp=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const o=new Be;if(t){o.on("warn",t)}if(e){o.on("info",e)}s.forEach((t=>o.addParser(t)));n.forEach((t=>o.addTagMapper(t)));o.push(i);o.end();const a=o.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(t){if(a.hasOwnProperty(t)){delete a[t]}}));if(a.segments){a.segments.forEach((function(t){["parts","preloadHints"].forEach((function(e){if(t.hasOwnProperty(e)){delete t[e]}}))}))}}if(!a.targetDuration){let e=10;if(a.segments&&a.segments.length){e=a.segments.reduce(((t,e)=>Math.max(t,e.duration)),0)}if(t){t({message:`manifest has no targetDuration defaulting to ${e}`})}a.targetDuration=e}const h=Ld(a);if(h.length&&!a.partTargetDuration){const e=h.reduce(((t,e)=>Math.max(t,e.duration)),0);if(t){t({message:`manifest has no partTargetDuration defaulting to ${e}`});rp.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")}a.partTargetDuration=e}return a};const cp=(t,e)=>{if(!t.mediaGroups){return}["AUDIO","SUBTITLES"].forEach((i=>{if(!t.mediaGroups[i]){return}for(const s in t.mediaGroups[i]){for(const n in t.mediaGroups[i][s]){const r=t.mediaGroups[i][s][n];e(r,i,s,n)}}}))};const lp=({playlist:t,uri:e,id:i})=>{t.id=i;t.playlistErrors_=0;if(e){t.uri=e}t.attributes=t.attributes||{}};const up=t=>{let e=t.playlists.length;while(e--){const i=t.playlists[e];lp({playlist:i,id:op(e,i.uri)});i.resolvedUri=vd(t.uri,i.uri);t.playlists[i.id]=i;t.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){rp.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const fp=t=>{cp(t,(e=>{if(e.uri){e.resolvedUri=vd(t.uri,e.uri)}}))};const dp=(t,e)=>{const i=op(0,e);const s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:z.location.href,resolvedUri:z.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};s.playlists[i]=s.playlists[0];s.playlists[e]=s.playlists[0];return s};const pp=(t,e,i=ap)=>{t.uri=e;for(let e=0;e<t.playlists.length;e++){if(!t.playlists[e].uri){const i=`placeholder-uri-${e}`;t.playlists[e].uri=i}}const s=sp(t);cp(t,((e,n,r,o)=>{if(!e.playlists||!e.playlists.length){if(s&&n==="AUDIO"&&!e.uri){for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r){return}}}e.playlists=[it({},e)]}e.playlists.forEach((function(e,s){const a=i(n,r,o,e);const h=op(s,a);if(e.uri){e.resolvedUri=e.resolvedUri||vd(t.uri,e.uri)}else{e.uri=s===0?a:h;e.resolvedUri=e.uri}e.id=e.id||h;e.attributes=e.attributes||{};t.playlists[e.id]=e;t.playlists[e.uri]=e}))}));up(t);fp(t)};class vp{constructor(){this.offset_=null;this.pendingDateRanges_=new Map;this.processedDateRanges_=new Map}setOffset(t=[]){if(this.offset_!==null){return}if(!t.length){return}const[e]=t;if(e.programDateTime===undefined){return}this.offset_=e.programDateTime/1e3}setPendingDateRanges(t=[]){if(!t.length){return}const[e]=t;const i=e.startDate.getTime();this.trimProcessedDateRanges_(i);this.pendingDateRanges_=t.reduce(((t,e)=>{t.set(e.id,e);return t}),new Map)}processDateRange(t){this.pendingDateRanges_.delete(t.id);this.processedDateRanges_.set(t.id,t)}getDateRangesToProcess(){if(this.offset_===null){return[]}const t={};const e=[];this.pendingDateRanges_.forEach(((i,s)=>{if(this.processedDateRanges_.has(s)){return}i.startTime=i.startDate.getTime()/1e3-this.offset_;i.processDateRange=()=>this.processDateRange(i);e.push(i);if(!i.class){return}if(t[i.class]){const e=t[i.class].push(i);i.classListIndex=e-1}else{t[i.class]=[i];i.classListIndex=0}}));for(const i of e){const e=t[i.class]||[];if(i.endDate){i.endTime=i.endDate.getTime()/1e3-this.offset_}else if(i.endOnNext&&e[i.classListIndex+1]){i.endTime=e[i.classListIndex+1].startTime}else if(i.duration){i.endTime=i.startTime+i.duration}else if(i.plannedDuration){i.endTime=i.startTime+i.plannedDuration}else{i.endTime=i.startTime}}return e}trimProcessedDateRanges_(t){const e=new Map(this.processedDateRanges_);e.forEach(((e,i)=>{if(e.startDate.getTime()<t){this.processedDateRanges_.delete(i)}}))}}const mp=22;const gp=({requestType:t,request:e,error:i,parseFailure:s})=>{const n=e.status<200||e.status>299;const r=e.status>=400&&e.status<=499;const o={uri:e.uri,requestType:t};const a=n&&!r||s;if(i&&r){o.error=it({},i);o.errorType=cd.Error.NetworkRequestFailed}else if(e.aborted){o.errorType=cd.Error.NetworkRequestAborted}else if(e.timedout){o.erroType=cd.Error.NetworkRequestTimeout}else if(a){const t=s?cd.Error.NetworkBodyParserFailed:cd.Error.NetworkBadStatus;o.errorType=t;o.status=e.status;o.headers=e.headers}return o};const{EventTarget:bp}=cd;const yp=(t,e)=>{if(e.endList||!e.serverControl){return t}const i={};if(e.serverControl.canBlockReload){const{preloadSegment:t}=e;let s=e.mediaSequence+e.segments.length;if(t){const n=t.parts||[];const r=Pd(e)-1;if(r>-1&&r!==n.length-1){i._HLS_part=r}if(r>-1||n.length){s--}}i._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil){i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const e=new z.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(t){if(!i.hasOwnProperty(t)){return}e.searchParams.set(t,i[t])}));t=e.toString()}return t};const jp=(t,e)=>{if(!t){return e}const i=bd(t,e);if(t.preloadHints&&!e.preloadHints){delete i.preloadHints}if(t.parts&&!e.parts){delete i.parts}else if(t.parts&&e.parts){for(let s=0;s<e.parts.length;s++){if(t.parts&&t.parts[s]){i.parts[s]=bd(t.parts[s],e.parts[s])}}}if(!t.skipped&&e.skipped){i.skipped=false}if(t.preload&&!e.preload){i.preload=false}return i};const wp=(t,e,i)=>{const s=t.slice();const n=e.slice();i=i||0;const r=[];let o;for(let t=0;t<n.length;t++){const e=s[t+i];const a=n[t];if(e){o=e.map||o;r.push(jp(e,a))}else{if(o&&!a.map){a.map=o}r.push(a)}}return r};const Tp=(t,e)=>{if(!t.resolvedUri&&t.uri){t.resolvedUri=vd(e,t.uri)}if(t.key&&!t.key.resolvedUri){t.key.resolvedUri=vd(e,t.key.uri)}if(t.map&&!t.map.resolvedUri){t.map.resolvedUri=vd(e,t.map.uri)}if(t.map&&t.map.key&&!t.map.key.resolvedUri){t.map.key.resolvedUri=vd(e,t.map.key.uri)}if(t.parts&&t.parts.length){t.parts.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=vd(e,t.uri)}))}if(t.preloadHints&&t.preloadHints.length){t.preloadHints.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=vd(e,t.uri)}))}};const kp=function(t){const e=t.segments||[];const i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let t=0;t<i.preloadHints.length;t++){if(i.preloadHints[t].type==="MAP"){return e}}}i.duration=t.targetDuration;i.preload=true;e.push(i)}return e};const Sp=(t,e)=>t===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment;const xp=(t,e,i=Sp)=>{const s=bd(t,{});const n=s.playlists[e.id];if(!n){return null}if(i(n,e)){return null}e.segments=kp(e);const r=bd(n,e);if(r.preloadSegment&&!e.preloadSegment){delete r.preloadSegment}if(n.segments){if(e.skip){e.segments=e.segments||[];for(let t=0;t<e.skip.skippedSegments;t++){e.segments.unshift({skipped:true})}}r.segments=wp(n.segments,e.segments,e.mediaSequence-n.mediaSequence)}r.segments.forEach((t=>{Tp(t,r.resolvedUri)}));for(let t=0;t<s.playlists.length;t++){if(s.playlists[t].id===e.id){s.playlists[t]=r}}s.playlists[e.id]=r;s.playlists[e.uri]=r;cp(t,((t,i,s,n)=>{if(!t.playlists){return}for(let i=0;i<t.playlists.length;i++){if(e.id===t.playlists[i].id){t.playlists[i]=r}}}));return s};const Ap=(t,e)=>{const i=t.segments||[];const s=i[i.length-1];const n=s&&s.parts&&s.parts[s.parts.length-1];const r=n&&n.duration||s&&s.duration;if(e&&r){return r*1e3}return(t.partTargetDuration||t.targetDuration||10)*500};const Ep=(t,e,i)=>{if(!t){return}const s=[];t.forEach((t=>{if(!t.attributes){return}const{BANDWIDTH:e,RESOLUTION:i,CODECS:n}=t.attributes;s.push({id:t.id,bandwidth:e,resolution:i,codecs:n})}));return{type:e,isLive:i,renditions:s}};class Ip extends bp{constructor(t,e,i={}){super();if(!t){throw new Error("A non-empty playlist URL or object is required")}this.logger_=gd("PlaylistLoader");const{withCredentials:s=false}=i;this.src=t;this.vhs_=e;this.withCredentials=s;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=e.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.dateRangesStorage_=new vp;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const t=this.media();if(!t){return}this.dateRangesStorage_.setOffset(t.segments);this.dateRangesStorage_.setPendingDateRanges(t.dateRanges);const e=this.dateRangesStorage_.getDateRangesToProcess();if(!e.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(e)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const t=this.media();let e=vd(this.main.uri,t.uri);if(this.llhls){e=yp(e,t)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:e,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,e)=>{if(!this.request){return}if(t){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(t,e,i){const{uri:s,id:n}=e;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:t.status,message:`HLS playlist request error at URL: ${s}.`,responseText:t.responseText,code:t.status>=500?4:2,metadata:gp({requestType:t.requestType,request:t,error:t.error})};this.trigger("error")}parseManifest_({url:t,manifestString:e}){try{return hp({onwarn:({message:e})=>this.logger_(`m3u8-parser warn for ${t}: ${e}`),oninfo:({message:e})=>this.logger_(`m3u8-parser info for ${t}: ${e}`),manifestString:e,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(t){this.error=t;this.error.metadata={errorType:cd.Error.StreamingHlsPlaylistParserError,error:t}}}haveMetadata({playlistString:t,playlistObject:e,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const r=e||this.parseManifest_({url:i,manifestString:t});r.lastRequest=Date.now();lp({playlist:r,uri:i,id:s});const o=xp(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration;this.pendingMedia_=null;if(o){this.main=o;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(Ap(this.media(),!!o));n.parsedPlaylist=Ep(this.main.playlists,n.playlistInfo.type,!this.media_.endList);this.trigger({type:"playlistparsecomplete",metadata:n});this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();z.clearTimeout(this.mediaUpdateTimeout);z.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new vp;this.off()}stopRequest(){if(this.request){const t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t,e){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof t==="string"){if(!this.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.main.playlists[t]}z.clearTimeout(this.finalRenditionTimeout);if(e){const e=(t.partTargetDuration||t.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=z.setTimeout(this.media.bind(this,t,false),e);return}const i=this.state;const s=!this.media_||t.id!==this.media_.id;const n=this.main.playlists[t.id];if(n&&n.endList||t.endList&&t.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(s){this.trigger("mediachanging");if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(Ap(t,true));if(!s){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=t;const r={playlistInfo:{type:"media",uri:t.uri}};this.trigger({type:"playlistrequeststart",metadata:r});this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,s)=>{if(!this.request){return}t.lastRequest=Date.now();t.resolvedUri=md(t.resolvedUri,s);if(e){return this.playlistRequestError(this.request,t,i)}this.trigger({type:"playlistrequestcomplete",metadata:r});this.haveMetadata({playlistString:s.responseText,url:t.uri,id:t.id});if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}))}pause(){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(t){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const e=this.media();if(t){const t=e?(e.partTargetDuration||e.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=z.setTimeout((()=>{this.mediaUpdateTimeout=null;this.load()}),t);return}if(!this.started){this.start();return}if(e&&!e.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(t){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=z.setTimeout((()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(t)}),t)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=z.location.href}this.src.resolvedUri=this.src.uri;setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);return}const t={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:t});this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,i)=>{if(!this.request){return}this.request=null;if(e){this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:gp({requestType:i.requestType,request:i,error:e})};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.trigger({type:"playlistrequestcomplete",metadata:t});this.src=md(this.src,i);this.trigger({type:"playlistparsestart",metadata:t});const s=this.parseManifest_({manifestString:i.responseText,url:this.src});t.parsedPlaylist=Ep(s.playlists,t.playlistInfo.type,false);this.trigger({type:"playlistparsecomplete",metadata:t});this.setupInitialPlaylist(s)}))}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(t){this.state="HAVE_MAIN_MANIFEST";if(t.playlists){this.main=t;pp(this.main,this.srcUri());t.playlists.forEach((t=>{t.segments=kp(t);t.segments.forEach((e=>{Tp(e,t.resolvedUri)}))}));this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const e=this.srcUri()||z.location.href;this.main=dp(t,e);this.haveMetadata({playlistObject:t,url:e,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}updateOrDeleteClone(t,e){const i=this.main;const s=t.ID;let n=i.playlists.length;while(n--){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const o=r.resolvedUri;const a=r.id;if(e){const e=this.createCloneURI_(r.resolvedUri,t);const o=op(s,e);const a=this.createCloneAttributes_(s,r.attributes);const h=this.createClonePlaylist_(r,o,t,a);i.playlists[n]=h;i.playlists[o]=h;i.playlists[e]=h}else{i.playlists.splice(n,1)}delete i.playlists[a];delete i.playlists[o]}}this.updateOrDeleteCloneMedia(t,e)}updateOrDeleteCloneMedia(t,e){const i=this.main;const s=t.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{if(!i.mediaGroups[t]||!i.mediaGroups[t][s]){return}for(const e in i.mediaGroups[t]){if(e===s){for(const s in i.mediaGroups[t][e]){const n=i.mediaGroups[t][e][s];n.playlists.forEach(((t,e)=>{const s=i.playlists[t.id];const n=s.id;const r=s.resolvedUri;delete i.playlists[n];delete i.playlists[r]}))}delete i.mediaGroups[t][e]}}}));if(e){this.createClonedMediaGroups_(t)}}addClonePathway(t,e={}){const i=this.main;const s=i.playlists.length;const n=this.createCloneURI_(e.resolvedUri,t);const r=op(t.ID,n);const o=this.createCloneAttributes_(t.ID,e.attributes);const a=this.createClonePlaylist_(e,r,t,o);i.playlists[s]=a;i.playlists[r]=a;i.playlists[n]=a;this.createClonedMediaGroups_(t)}createClonedMediaGroups_(t){const e=t.ID;const i=t["BASE-ID"];const s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{if(!s.mediaGroups[n]||s.mediaGroups[n][e]){return}for(const r in s.mediaGroups[n]){if(r===i){s.mediaGroups[n][e]={}}else{continue}for(const i in s.mediaGroups[n][r]){const o=s.mediaGroups[n][r][i];s.mediaGroups[n][e][i]=it({},o);const a=s.mediaGroups[n][e][i];const h=this.createCloneURI_(o.resolvedUri,t);a.resolvedUri=h;a.uri=h;a.playlists=[];o.playlists.forEach(((r,o)=>{const h=s.playlists[r.id];const c=ap(n,e,i);const l=op(e,c);if(h&&!s.playlists[l]){const e=this.createClonePlaylist_(h,l,t);const i=e.resolvedUri;s.playlists[l]=e;s.playlists[i]=e}a.playlists[o]=this.createClonePlaylist_(r,l,t)}))}}}))}createClonePlaylist_(t,e,i,s){const n=this.createCloneURI_(t.resolvedUri,i);const r={resolvedUri:n,uri:n,id:e};if(t.segments){r.segments=[]}if(s){r.attributes=s}return bd(t,r)}createCloneURI_(t,e){const i=new URL(t);i.hostname=e["URI-REPLACEMENT"].HOST;const s=e["URI-REPLACEMENT"].PARAMS;for(const t of Object.keys(s)){i.searchParams.set(t,s[t])}return i.href}createCloneAttributes_(t,e){const i={["PATHWAY-ID"]:t};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((s=>{if(e[s]){i[s]=t}}));return i}getKeyIdSet(t){if(t.contentProtection){const e=new Set;for(const i in t.contentProtection){const s=t.contentProtection[i].attributes.keyId;if(s){e.add(s.toLowerCase())}}return e}}}const Dp=function(t,e,i,s){const n=t.responseType==="arraybuffer"?t.response:t.responseText;if(!e&&n){t.responseTime=Date.now();t.roundTripTime=t.responseTime-t.requestTime;t.bytesReceived=n.byteLength||n.length;if(!t.bandwidth){t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3)}}if(i.headers){t.responseHeaders=i.headers}if(e&&e.code==="ETIMEDOUT"){t.timedout=true}if(!e&&!t.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){e=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))}s(e,t)};const Cp=(t,e)=>{if(!t||!t.size){return}let i=e;t.forEach((t=>{i=t(i)}));return i};const Np=(t,e,i,s)=>{if(!t||!t.size){return}t.forEach((t=>{t(e,i,s)}))};const _p=function(){const t=function t(e,i){e=bd({timeout:45e3},e);const s=t.beforeRequest||cd.Vhs.xhr.beforeRequest;const n=t._requestCallbackSet||cd.Vhs.xhr._requestCallbackSet||new Set;const r=t._responseCallbackSet||cd.Vhs.xhr._responseCallbackSet;if(s&&typeof s==="function"){cd.log.warn("beforeRequest is deprecated, use onRequest instead.");n.add(s)}const o=cd.Vhs.xhr.original===true?cd.xhr:cd.Vhs.xhr;const a=Cp(n,e);n.delete(s);const h=o(a||e,(function(t,e){Np(r,h,t,e);return Dp(h,t,e,i)}));const c=h.abort;h.abort=function(){h.aborted=true;return c.apply(h,arguments)};h.uri=e.uri;h.requestType=e.requestType;h.requestTime=Date.now();return h};t.original=true;return t};const Op=function(t){let e;const i=t.offset;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){e=z.BigInt(t.offset)+z.BigInt(t.length)-z.BigInt(1)}else{e=t.offset+t.length-1}return"bytes="+i+"-"+e};const Mp=function(t){const e={};if(t.byterange){e.Range=Op(t.byterange)}return e};const Rp=function(t,e){return t.start(e)+"-"+t.end(e)};const Lp=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")};const Pp=function(t){if(t>=32&&t<126){return String.fromCharCode(t)}return"."};const $p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(oi(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};const Fp=function(t){const e=t.byterange||{length:Infinity,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")};const Up=function(t){return t.resolvedUri};const Bp=t=>{const e=Array.prototype.slice.call(t);const i=16;let s="";let n;let r;for(let t=0;t<e.length/i;t++){n=e.slice(t*i,t*i+i).map(Lp).join("");r=e.slice(t*i,t*i+i).map(Pp).join("");s+=n+" "+r+"\n"}return s};const qp=({bytes:t})=>Bp(t);const Vp=t=>{let e="";let i;for(i=0;i<t.length;i++){e+=Rp(t,i)+" "}return e};var zp=Object.freeze({__proto__:null,createTransferableMessage:$p,initSegmentId:Fp,segmentKeyId:Up,hexDump:Bp,tagDump:qp,textRanges:Vp});const Hp=.25;const Xp=(t,e)=>{if(!e.dateTimeObject){return null}const i=e.videoTimingInfo.transmuxerPrependedSeconds;const s=e.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=t-n;return new Date(e.dateTimeObject.getTime()+r*1e3)};const Gp=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds;const Yp=(t,e)=>{let i;try{i=new Date(t)}catch(t){return null}if(!e||!e.segments||e.segments.length===0){return null}let s=e.segments[0];if(i<new Date(s.dateTimeObject)){return null}for(let t=0;t<e.segments.length-1;t++){s=e.segments[t];const n=new Date(e.segments[t+1].dateTimeObject);if(i<n){break}}const n=e.segments[e.segments.length-1];const r=n.dateTimeObject;const o=n.videoTimingInfo?Gp(n.videoTimingInfo):n.duration+n.duration*Hp;const a=new Date(r.getTime()+o*1e3);if(i>a){return null}if(i>new Date(r)){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:np.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const Wp=(t,e)=>{if(!e||!e.segments||e.segments.length===0){return null}let i=0;let s;for(let n=0;n<e.segments.length;n++){s=e.segments[n];i=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:i+s.duration;if(t<=i){break}}const n=e.segments[e.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<t){return null}if(t>i){if(t>i+n.duration*Hp){return null}s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:i-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}};const Jp=(t,e)=>{let i;let s;try{i=new Date(t);s=new Date(e)}catch(t){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const Kp=t=>{if(!t.segments||t.segments.length===0){return false}for(let e=0;e<t.segments.length;e++){const i=t.segments[e];if(!i.dateTimeObject){return false}}return true};const Qp=({playlist:t,time:e=undefined,callback:i})=>{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!t||e===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=Wp(e,t);if(!s){return i({message:"valid programTime was not found"})}if(s.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}const n={mediaSeconds:e};const r=Xp(e,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const Zp=({programTime:t,playlist:e,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:o})=>{if(!o){throw new Error("seekToProgramTime: callback must be provided")}if(typeof t==="undefined"||!e||!s){return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!e.endList&&!r.hasStarted_){return o({message:"player must be playing a live stream to start buffering"})}if(!Kp(e)){return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri})}const a=Yp(t,e);if(!a){return o({message:`${t} was not found in the stream`})}const h=a.segment;const c=Jp(h.dateTimeObject,t);if(a.type==="estimate"){if(i===0){return o({message:`${t} is not buffered yet. Try again`})}s(a.estimatedStart+c);r.one("seeked",(()=>{Zp({programTime:t,playlist:e,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:o})}));return}const l=h.start+c;const u=()=>o(null,r.currentTime());r.one("seeked",u);if(n){r.pause()}s(l)};const tv=(t,e)=>{if(t.readyState===4){return e()}return};const ev=(t,e,i,s)=>{let n=[];let r;let o=false;const a=function(t,e,s,n){e.abort();o=true;return i(t,e,s,n)};const h=function(t,e){if(o){return}if(t){t.metadata=gp({requestType:s,request:e,error:t});return a(t,e,"",n)}const i=e.responseText.substring(n&&n.byteLength||0,e.responseText.length);n=pi(n,di(i,true));r=r||go(n);if(n.length<10||r&&n.length<r+2){return tv(e,(()=>a(t,e,"",n)))}const h=Uo(n);if(h==="ts"&&n.length<188){return tv(e,(()=>a(t,e,"",n)))}if(!h&&n.length<376){return tv(e,(()=>a(t,e,"",n)))}return a(null,e,h,n)};const c={uri:t,beforeSend(t){t.overrideMimeType("text/plain; charset=x-user-defined");t.addEventListener("progress",(function({total:e,loaded:i}){return Dp(t,null,{statusCode:t.status},h)}))}};const l=e(c,(function(t,e){return Dp(l,t,e,h)}));return l};const{EventTarget:iv}=cd;const sv=function(t,e){if(!Sp(t,e)){return false}if(t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length)){return false}else if(!t.sidx&&e.sidx||t.sidx&&!e.sidx){return false}if(t.segments&&!e.segments||!t.segments&&e.segments){return false}if(!t.segments&&!e.segments){return true}for(let i=0;i<t.segments.length;i++){const s=t.segments[i];const n=e.segments[i];if(s.uri!==n.uri){return false}if(!s.byterange&&!n.byterange){continue}const r=s.byterange;const o=n.byterange;if(r&&!o||!r&&o){return false}if(r.offset!==o.offset||r.length!==o.length){return false}}return true};const nv=(t,e,i,s)=>{const n=s.attributes.NAME||i;return`placeholder-uri-${t}-${e}-${n}`};const rv=({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=oo(t,{manifestUri:e,clientOffset:i,sidxMapping:s,previousManifest:n});pp(r,e,nv);return r};const ov=(t,e)=>{cp(t,((i,s,n,r)=>{if(!(r in e.mediaGroups[s][n])){delete t.mediaGroups[s][n][r]}}))};const av=(t,e,i)=>{let s=true;let n=bd(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let t=0;t<e.playlists.length;t++){const r=e.playlists[t];if(r.sidx){const t=fr(r.sidx);if(i&&i[t]&&i[t].sidx){sr(r,i[t].sidx,r.sidx.resolvedUri)}}const o=xp(n,r,sv);if(o){n=o;s=false}}cp(e,((t,e,i,r)=>{if(t.playlists&&t.playlists.length){const o=t.playlists[0].id;const a=xp(n,t.playlists[0],sv);if(a){n=a;if(!(r in n.mediaGroups[e][i])){n.mediaGroups[e][i][r]=t}n.mediaGroups[e][i][r].playlists[0]=n.playlists[o];s=false}}}));ov(n,e);if(e.minimumUpdatePeriod!==t.minimumUpdatePeriod){s=false}if(s){return null}return n};const hv=(t,e)=>{const i=Boolean(!t.map&&!e.map);const s=i||Boolean(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length);return s&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length};const cv=(t,e)=>{const i={};for(const s in t){const n=t[s];const r=n.sidx;if(r){const t=fr(r);if(!e[t]){break}const s=e[t].sidxInfo;if(hv(s,r)){i[t]=e[t]}}}return i};const lv=(t,e)=>{const i=cv(t.playlists,e);let s=i;cp(t,((t,i,n,r)=>{if(t.playlists&&t.playlists.length){const i=t.playlists;s=bd(s,cv(i,e))}}));return s};class uv extends iv{constructor(t,e,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=e;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!t){throw new Error("A non-empty playlist URL or object is required")}this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()}));this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)}));this.state="HAVE_NOTHING";this.loadedPlaylists_={};this.logger_=gd("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=t;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=t}}requestErrored_(t,e,i){if(!this.request){return true}this.request=null;if(t){this.error=typeof t==="object"&&!(t instanceof Error)?t:{status:e.status,message:"DASH request error at URL: "+e.uri,response:e.response,code:2,metadata:t.metadata};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(t,e,i){const s=t.sidx&&fr(t.sidx);if(!t.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){this.mediaRequest_=z.setTimeout((()=>i(false)),0);return}const n=md(t.sidx.resolvedUri);const r=(n,r)=>{if(this.requestErrored_(n,r,e)){return}const o=this.mainPlaylistLoader_.sidxMapping_;const{requestType:a}=r;let h;try{h=po(hi(r.response).subarray(8))}catch(t){t.metadata=gp({requestType:a,request:r,parseFailure:true});this.requestErrored_(t,r,e);return}o[s]={sidxInfo:t.sidx,sidx:h};sr(t,h,t.sidx.resolvedUri);return i(true)};const o="dash-sidx";this.request=ev(n,this.vhs_.xhr,((e,i,s,o)=>{if(e){return r(e,i)}if(!s||s!=="mp4"){const e=s||"unknown";return r({status:i.status,message:`Unsupported ${e} container type for sidx segment at URL: ${n}`,response:"",playlist:t,internal:true,playlistExclusionDuration:Infinity,code:2},i)}const{offset:a,length:h}=t.sidx.byterange;if(o.length>=h+a){return r(e,{response:o.subarray(a,a+h),status:i.status,uri:i.uri})}this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Mp({byterange:t.sidx.byterange})},r)}),o)}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};z.clearTimeout(this.minimumUpdatePeriodTimeout_);z.clearTimeout(this.mediaRequest_);z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const e=this.state;if(typeof t==="string"){if(!this.mainPlaylistLoader_.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.mainPlaylistLoader_.main.playlists[t]}const i=!this.media_||t.id!==this.media_.id;if(i&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(i){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!i){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,e,(i=>{this.haveMetadata({startingState:e,playlist:t})}))}haveMetadata({startingState:t,playlist:e}){this.state="HAVE_METADATA";this.loadedPlaylists_[e.id]=e;this.mediaRequest_=null;this.refreshMedia_(e.id);if(t==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){z.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(t){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const e=this.media();if(t){const t=e?e.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=z.setTimeout((()=>this.load()),t);return}if(!this.started){this.start();return}if(e&&!e.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=z.setTimeout((()=>this.haveMain_()),0);return}this.requestMain_(((t,e)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}}))}requestMain_(t){const e={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:e});this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((i,s)=>{if(i){const{requestType:t}=s;i.metadata=gp({requestType:t,request:s,error:i})}if(this.requestErrored_(i,s)){if(this.state==="HAVE_NOTHING"){this.started=false}return}this.trigger({type:"manifestrequestcomplete",metadata:e});const n=s.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=s.responseText;if(s.responseHeaders&&s.responseHeaders.date){this.mainLoaded_=Date.parse(s.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=md(this.mainPlaylistLoader_.srcUrl,s);if(n){this.handleMain_();this.syncClientServerClock_((()=>t(s,n)));return}return t(s,n)}))}syncClientServerClock_(t){const e=ao(this.mainPlaylistLoader_.mainXml_);if(e===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}if(e.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=e.value-Date.now();return t()}this.request=this.vhs_.xhr({uri:vd(this.mainPlaylistLoader_.srcUrl,e.value),method:e.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,s)=>{if(!this.request){return}if(i){const{requestType:e}=s;this.error.metadata=gp({requestType:e,request:s,error:i});this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}let n;if(e.method==="HEAD"){if(!s.responseHeaders||!s.responseHeaders.date){n=this.mainLoaded_}else{n=Date.parse(s.responseHeaders.date)}}else{n=Date.parse(s.responseText)}this.mainPlaylistLoader_.clientOffset_=n-Date.now();t()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const t=this.mainPlaylistLoader_.main;const e={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:e});let i;try{i=rv({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t})}catch(t){this.error=t;this.error.metadata={errorType:cd.Error.StreamingDashManifestParserError,error:t};this.trigger("error")}if(t){i=av(t,i,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=i?i:t;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=s}if(!t||i&&i.minimumUpdatePeriod!==t.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(i);if(i){const{duration:t,endList:s}=i;const n=[];i.playlists.forEach((t=>{n.push({id:t.id,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS})}));const r={duration:t,isLive:!s,renditions:n};e.parsedManifest=r;this.trigger({type:"manifestparsecomplete",metadata:e})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const t=this.mainPlaylistLoader_;if(t.createMupOnMedia_){t.off("loadedmetadata",t.createMupOnMedia_);t.createMupOnMedia_=null}if(t.minimumUpdatePeriodTimeout_){z.clearTimeout(t.minimumUpdatePeriodTimeout_);t.minimumUpdatePeriodTimeout_=null}let e=t.main&&t.main.minimumUpdatePeriod;if(e===0){if(t.media()){e=t.media().targetDuration*1e3}else{t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_;t.one("loadedmetadata",t.createMupOnMedia_)}}if(typeof e!=="number"||e<=0){if(e<0){this.logger_(`found invalid minimumUpdatePeriod of ${e}, not setting a timeout`)}return}this.createMUPTimeout_(e)}createMUPTimeout_(t){const e=this.mainPlaylistLoader_;e.minimumUpdatePeriodTimeout_=z.setTimeout((()=>{e.minimumUpdatePeriodTimeout_=null;e.trigger("minimumUpdatePeriod");e.createMUPTimeout_(t)}),t)}refreshXml_(){this.requestMain_(((t,e)=>{if(!e){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=lv(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,(t=>{this.refreshMedia_(this.media().id)}))}))}refreshMedia_(t){if(!t){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const e=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==e[t];if(i){this.media_=e[t]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const t=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=z.setTimeout((()=>{this.trigger("mediaupdatetimeout");t()}),Ap(this.media(),Boolean(i)))};t()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(t){if(t&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map((t=>({cueTime:t.start,frames:[{data:t.messageData}]})));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(t){if(t.contentProtection){const e=new Set;for(const i in t.contentProtection){const s=t.contentProtection[i].attributes["cenc:default_KID"];if(s){e.add(s.replace(/-/g,"").toLowerCase())}}return e}}}var fv={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const dv=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let i=0;i<t.length;i++){e[i]=t.charCodeAt(i)}return e.buffer};const pv=function(t){t.on=t.addEventListener;t.off=t.removeEventListener;return t};const vv=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(e){const i=new BlobBuilder;i.append(t);return URL.createObjectURL(i.getBlob())}};const mv=function(t){return function(){const e=vv(t);const i=pv(new Worker(e));i.objURL=e;const s=i.terminate;i.on=i.addEventListener;i.off=i.removeEventListener;i.terminate=function(){URL.revokeObjectURL(e);return s.call(this)};return i}};const gv=function(t){return`var browserWorkerPolyFill = ${pv.toString()};\n`+"browserWorkerPolyFill(self);\n"+t};const bv=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)};const yv=gv(bv((function(){var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var e=function(){this.init=function(){var t={};this.on=function(e,i){if(!t[e]){t[e]=[]}t[e]=t[e].concat(i)};this.off=function(e,i){var s;if(!t[e]){return false}s=t[e].indexOf(i);t[e]=t[e].slice();t[e].splice(s,1);return s>-1};this.trigger=function(e){var i,s,n,r;i=t[e];if(!i){return}if(arguments.length===2){n=i.length;for(s=0;s<n;++s){i[s].call(this,arguments[1])}}else{r=[];s=arguments.length;for(s=1;s<arguments.length;++s){r.push(arguments[s])}n=i.length;for(s=0;s<n;++s){i[s].apply(this,r)}}};this.dispose=function(){t={}}}};e.prototype.pipe=function(t){this.on("data",(function(e){t.push(e)}));this.on("done",(function(e){t.flush(e)}));this.on("partialdone",(function(e){t.partialFlush(e)}));this.on("endedtimeline",(function(e){t.endTimeline(e)}));this.on("reset",(function(e){t.reset(e)}));return t};e.prototype.push=function(t){this.trigger("data",t)};e.prototype.flush=function(t){this.trigger("done",t)};e.prototype.partialFlush=function(t){this.trigger("partialdone",t)};e.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)};e.prototype.reset=function(t){this.trigger("reset",t)};var i=e;var s=Math.pow(2,32);var n=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);var i;if(e.getBigUint64){i=e.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return e.getUint32(0)*s+e.getUint32(4)};var r={getUint64:n,MAX_UINT32:s};var o=r.MAX_UINT32;var a,h,c,l,u,f,d,p,v,m,g,b,y,j,w,T,k,S,x,A,E,I,D,C,N,_,O,M,R,L,P,$,F,U,B,q;(function(){var t;D={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if(typeof Uint8Array==="undefined"){return}for(t in D){if(D.hasOwnProperty(t)){D[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]}}C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);_=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);N=new Uint8Array([0,0,0,1]);O=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]);M=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);R={video:O,audio:M};$=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);P=new Uint8Array([0,0,0,0,0,0,0,0]);F=new Uint8Array([0,0,0,0,0,0,0,0]);U=F;B=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);q=F;L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();a=function(t){var e=[],i=0,s,n,r;for(s=1;s<arguments.length;s++){e.push(arguments[s])}s=e.length;while(s--){i+=e[s].byteLength}n=new Uint8Array(i+8);r=new DataView(n.buffer,n.byteOffset,n.byteLength);r.setUint32(0,n.byteLength);n.set(t,4);for(s=0,i=8;s<e.length;s++){n.set(e[s],i);i+=e[s].byteLength}return n};h=function(){return a(D.dinf,a(D.dref,$))};c=function(t){return a(D.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))};l=function(){return a(D.ftyp,C,N,C,_)};T=function(t){return a(D.hdlr,R[t])};u=function(t){return a(D.mdat,t)};w=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,t.duration&255,85,196,0,0]);if(t.samplerate){e[12]=t.samplerate>>>24&255;e[13]=t.samplerate>>>16&255;e[14]=t.samplerate>>>8&255;e[15]=t.samplerate&255}return a(D.mdhd,e)};j=function(t){return a(D.mdia,w(t),T(t.type),d(t))};f=function(t){return a(D.mfhd,new Uint8Array([0,0,0,0,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255]))};d=function(t){return a(D.minf,t.type==="video"?a(D.vmhd,L):a(D.smhd,P),h(),S(t))};p=function(t,e){var i=[],s=e.length;while(s--){i[s]=A(e[s])}return a.apply(null,[D.moof,f(t)].concat(i))};v=function(t){var e=t.length,i=[];while(e--){i[e]=b(t[e])}return a.apply(null,[D.moov,g(4294967295)].concat(i).concat(m(t)))};m=function(t){var e=t.length,i=[];while(e--){i[e]=E(t[e])}return a.apply(null,[D.mvex].concat(i))};g=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(D.mvhd,e)};k=function(t){var e=t.samples||[],i=new Uint8Array(4+e.length),s,n;for(n=0;n<e.length;n++){s=e[n].flags;i[n+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return a(D.sdtp,i)};S=function(t){return a(D.stbl,x(t),a(D.stts,q),a(D.stsc,U),a(D.stsz,B),a(D.stco,F))};(function(){var t,e;x=function(i){return a(D.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),i.type==="video"?t(i):e(i))};t=function(t){var e=t.sps||[],i=t.pps||[],s=[],n=[],r,o;for(r=0;r<e.length;r++){s.push((e[r].byteLength&65280)>>>8);s.push(e[r].byteLength&255);s=s.concat(Array.prototype.slice.call(e[r]))}for(r=0;r<i.length;r++){n.push((i[r].byteLength&65280)>>>8);n.push(i[r].byteLength&255);n=n.concat(Array.prototype.slice.call(i[r]))}o=[D.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(t.width&65280)>>8,t.width&255,(t.height&65280)>>8,t.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(D.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([e.length],s,[i.length],n))),a(D.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(t.sarRatio){var h=t.sarRatio[0],c=t.sarRatio[1];o.push(a(D.pasp,new Uint8Array([(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,(c&4278190080)>>24,(c&16711680)>>16,(c&65280)>>8,c&255])))}return a.apply(null,o)};e=function(t){return a(D.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(t.channelcount&65280)>>8,t.channelcount&255,(t.samplesize&65280)>>8,t.samplesize&255,0,0,0,0,(t.samplerate&65280)>>8,t.samplerate&255,0,0]),c(t))}})();y=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,0,(t.duration&4278190080)>>24,(t.duration&16711680)>>16,(t.duration&65280)>>8,t.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(t.width&65280)>>8,t.width&255,0,0,(t.height&65280)>>8,t.height&255,0,0]);return a(D.tkhd,e)};A=function(t){var e,i,s,n,r,h,c;e=a(D.tfhd,new Uint8Array([0,0,0,58,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));h=Math.floor(t.baseMediaDecodeTime/o);c=Math.floor(t.baseMediaDecodeTime%o);i=a(D.tfdt,new Uint8Array([1,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255]));r=32+20+8+16+8+8;if(t.type==="audio"){s=I(t,r);return a(D.traf,e,i,s)}n=k(t);s=I(t,n.length+r);return a(D.traf,e,i,s,n)};b=function(t){t.duration=t.duration||4294967295;return a(D.trak,y(t),j(t))};E=function(t){var e=new Uint8Array([0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(t.type!=="video"){e[e.length-1]=0}return a(D.trex,e)};(function(){var t,e,i;i=function(t,e){var i=0,s=0,n=0,r=0;if(t.length){if(t[0].duration!==undefined){i=1}if(t[0].size!==undefined){s=2}if(t[0].flags!==undefined){n=4}if(t[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(t.length&4278190080)>>>24,(t.length&16711680)>>>16,(t.length&65280)>>>8,t.length&255,(e&4278190080)>>>24,(e&16711680)>>>16,(e&65280)>>>8,e&255]};e=function(t,e){var s,n,r,o,h,c;o=t.samples||[];e+=8+12+16*o.length;r=i(o,e);n=new Uint8Array(r.length+o.length*16);n.set(r);s=r.length;for(c=0;c<o.length;c++){h=o[c];n[s++]=(h.duration&4278190080)>>>24;n[s++]=(h.duration&16711680)>>>16;n[s++]=(h.duration&65280)>>>8;n[s++]=h.duration&255;n[s++]=(h.size&4278190080)>>>24;n[s++]=(h.size&16711680)>>>16;n[s++]=(h.size&65280)>>>8;n[s++]=h.size&255;n[s++]=h.flags.isLeading<<2|h.flags.dependsOn;n[s++]=h.flags.isDependedOn<<6|h.flags.hasRedundancy<<4|h.flags.paddingValue<<1|h.flags.isNonSyncSample;n[s++]=h.flags.degradationPriority&240<<8;n[s++]=h.flags.degradationPriority&15;n[s++]=(h.compositionTimeOffset&4278190080)>>>24;n[s++]=(h.compositionTimeOffset&16711680)>>>16;n[s++]=(h.compositionTimeOffset&65280)>>>8;n[s++]=h.compositionTimeOffset&255}return a(D.trun,n)};t=function(t,e){var s,n,r,o,h,c;o=t.samples||[];e+=8+12+8*o.length;r=i(o,e);s=new Uint8Array(r.length+o.length*8);s.set(r);n=r.length;for(c=0;c<o.length;c++){h=o[c];s[n++]=(h.duration&4278190080)>>>24;s[n++]=(h.duration&16711680)>>>16;s[n++]=(h.duration&65280)>>>8;s[n++]=h.duration&255;s[n++]=(h.size&4278190080)>>>24;s[n++]=(h.size&16711680)>>>16;s[n++]=(h.size&65280)>>>8;s[n++]=h.size&255}return a(D.trun,s)};I=function(i,s){if(i.type==="audio"){return t(i,s)}return e(i,s)}})();var V={ftyp:l,mdat:u,moof:p,moov:v,initSegment:function(t){var e=l(),i=v(t),s;s=new Uint8Array(e.byteLength+i.byteLength);s.set(e);s.set(i,e.byteLength);return s}};var z=function(t){var e,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(e=0;e<t.length;e++){i=t[e];if(i.nalUnitType==="access_unit_delimiter_rbsp"){if(s.length){s.duration=i.dts-s.dts;n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s)}s=[i];s.byteLength=i.data.byteLength;s.pts=i.pts;s.dts=i.dts}else{if(i.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){s.keyFrame=true}s.duration=i.dts-s.dts;s.byteLength+=i.data.byteLength;s.push(i)}}if(n.length&&(!s.duration||s.duration<=0)){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s);return n};var H=function(t){var e,i,s=[],n=[];s.byteLength=0;s.nalCount=0;s.duration=0;s.pts=t[0].pts;s.dts=t[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=t[0].pts;n.dts=t[0].dts;for(e=0;e<t.length;e++){i=t[e];if(i.keyFrame){if(s.length){n.push(s);n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration}s=[i];s.nalCount=i.length;s.byteLength=i.byteLength;s.pts=i.pts;s.dts=i.dts;s.duration=i.duration}else{s.duration+=i.duration;s.nalCount+=i.length;s.byteLength+=i.byteLength;s.push(i)}}if(n.length&&s.duration<=0){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration;n.push(s);return n};var X=function(t){var e;if(!t[0][0].keyFrame&&t.length>1){e=t.shift();t.byteLength-=e.byteLength;t.nalCount-=e.nalCount;t[0][0].dts=e.dts;t[0][0].pts=e.pts;t[0][0].duration+=e.duration}return t};var G=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var Y=function(t,e){var i=G();i.dataOffset=e;i.compositionTimeOffset=t.pts-t.dts;i.duration=t.duration;i.size=4*t.length;i.size+=t.byteLength;if(t.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var W=function(t,e){var i,s,n,r,o,a=e||0,h=[];for(i=0;i<t.length;i++){r=t[i];for(s=0;s<r.length;s++){o=r[s];n=Y(o,a);a+=n.size;h.push(n)}}return h};var J=function(t){var e,i,s,n,r,o,a=0,h=t.byteLength,c=t.nalCount,l=h+4*c,u=new Uint8Array(l),f=new DataView(u.buffer);for(e=0;e<t.length;e++){n=t[e];for(i=0;i<n.length;i++){r=n[i];for(s=0;s<r.length;s++){o=r[s];f.setUint32(a,o.data.byteLength);a+=4;u.set(o.data,a);a+=o.data.byteLength}}}return u};var K=function(t,e){var i,s=e||0,n=[];i=Y(t,s);n.push(i);return n};var Q=function(t){var e,i,s=0,n=t.byteLength,r=t.length,o=n+4*r,a=new Uint8Array(o),h=new DataView(a.buffer);for(e=0;e<t.length;e++){i=t[e];h.setUint32(s,i.data.byteLength);s+=4;a.set(i.data,s);s+=i.data.byteLength}return a};var Z={groupNalsIntoFrames:z,groupFramesIntoGops:H,extendFirstKeyFrame:X,generateSampleTable:W,concatenateNalData:J,generateSampleTableForFrame:K,concatenateNalDataForFrame:Q};var tt=[33,16,5,32,164,27];var et=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var it=function(t){var e=[];while(t--){e.push(0)}return e};var st=function(t){return Object.keys(t).reduce((function(e,i){e[i]=new Uint8Array(t[i].reduce((function(t,e){return t.concat(e)}),[]));return e}),{})};var nt;var rt=function(){if(!nt){var t={96e3:[tt,[227,64],it(154),[56]],88200:[tt,[231],it(170),[56]],64e3:[tt,[248,192],it(240),[56]],48e3:[tt,[255,192],it(268),[55,148,128],it(54),[112]],44100:[tt,[255,192],it(268),[55,163,128],it(84),[112]],32e3:[tt,[255,192],it(268),[55,234],it(226),[112]],24e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,112],it(126),[224]],16e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,255],it(269),[223,108],it(195),[1,192]],12e3:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,253,128],it(259),[56]],11025:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,255,192],it(268),[55,175,128],it(108),[112]],8e3:[et,it(268),[3,121,16],it(47),[7]]};nt=st(t)}return nt};var ot=9e4,at,ht,ct,lt,ut,ft,dt;at=function(t){return t*ot};ht=function(t,e){return t*e};ct=function(t){return t/ot};lt=function(t,e){return t/e};ut=function(t,e){return at(lt(t,e))};ft=function(t,e){return ht(ct(t),e)};dt=function(t,e,i){return ct(i?t:t-e)};var pt={ONE_SECOND_IN_TS:ot,secondsToVideoTs:at,secondsToAudioTs:ht,videoTsToSeconds:ct,audioTsToSeconds:lt,audioTsToVideoTs:ut,videoTsToAudioTs:ft,metadataTsToSeconds:dt};var vt=rt;var mt=pt;var gt=function(t){var e,i,s=0;for(e=0;e<t.length;e++){i=t[e];s+=i.data.byteLength}return s};var bt=function(t,e,i,s){var n,r=0,o=0,a=0,h=0,c,l,u;if(!e.length){return}n=mt.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate);r=Math.ceil(mt.ONE_SECOND_IN_TS/(t.samplerate/1024));if(i&&s){o=n-Math.max(i,s);a=Math.floor(o/r);h=a*r}if(a<1||h>mt.ONE_SECOND_IN_TS/2){return}c=vt()[t.samplerate];if(!c){c=e[0].data}for(l=0;l<a;l++){u=e[0];e.splice(0,0,{data:c,dts:u.dts-r,pts:u.pts-r})}t.baseMediaDecodeTime-=Math.floor(mt.videoTsToAudioTs(h,t.samplerate));return h};var yt=function(t,e,i){if(e.minSegmentDts>=i){return t}e.minSegmentDts=Infinity;return t.filter((function(t){if(t.dts>=i){e.minSegmentDts=Math.min(e.minSegmentDts,t.dts);e.minSegmentPts=e.minSegmentDts;return true}return false}))};var jt=function(t){var e,i,s=[];for(e=0;e<t.length;e++){i=t[e];s.push({size:i.data.byteLength,duration:1024})}return s};var wt=function(t){var e,i,s=0,n=new Uint8Array(gt(t));for(e=0;e<t.length;e++){i=t[e];n.set(i.data,s);s+=i.data.byteLength}return n};var Tt={prefixWithSilence:bt,trimAdtsFramesByEarliestDts:yt,generateSampleTable:jt,concatenateFrameData:wt};var kt=pt.ONE_SECOND_IN_TS;var St=function(t,e){if(typeof e.pts==="number"){if(t.timelineStartInfo.pts===undefined){t.timelineStartInfo.pts=e.pts}if(t.minSegmentPts===undefined){t.minSegmentPts=e.pts}else{t.minSegmentPts=Math.min(t.minSegmentPts,e.pts)}if(t.maxSegmentPts===undefined){t.maxSegmentPts=e.pts}else{t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)}}if(typeof e.dts==="number"){if(t.timelineStartInfo.dts===undefined){t.timelineStartInfo.dts=e.dts}if(t.minSegmentDts===undefined){t.minSegmentDts=e.dts}else{t.minSegmentDts=Math.min(t.minSegmentDts,e.dts)}if(t.maxSegmentDts===undefined){t.maxSegmentDts=e.dts}else{t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts)}}};var xt=function(t){delete t.minSegmentDts;delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts};var At=function(t,e){var i,s,n=t.minSegmentDts;if(!e){n-=t.timelineStartInfo.dts}i=t.timelineStartInfo.baseMediaDecodeTime;i+=n;i=Math.max(0,i);if(t.type==="audio"){s=t.samplerate/kt;i*=s;i=Math.floor(i)}return i};var Et={clearDtsInfo:xt,calculateTrackBaseMediaDecodeTime:At,collectDtsInfo:St};var It=4,Dt=128;var Ct=function(t){var e=0,i={payloadType:-1,payloadSize:0},s=0,n=0;while(e<t.byteLength){if(t[e]===Dt){break}while(t[e]===255){s+=255;e++}s+=t[e++];while(t[e]===255){n+=255;e++}n+=t[e++];if(!i.payload&&s===It){var r=String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6]);if(r==="GA94"){i.payloadType=s;i.payloadSize=n;i.payload=t.subarray(e,e+n);break}else{i.payload=void 0}}e+=n;s=0;n=0}return i};var Nt=function(t){if(t.payload[0]!==181){return null}if((t.payload[1]<<8|t.payload[2])!==49){return null}if(String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"){return null}if(t.payload[7]!==3){return null}return t.payload.subarray(8,t.payload.length-1)};var _t=function(t,e){var i=[],s,n,r,o;if(!(e[0]&64)){return i}n=e[0]&31;for(s=0;s<n;s++){r=s*3;o={type:e[r+2]&3,pts:t};if(e[r+2]&4){o.ccData=e[r+3]<<8|e[r+4];i.push(o)}}return i};var Ot=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};var Mt={parseSei:Ct,parseUserData:Nt,parseCaptionPackets:_t,discardEmulationPreventionBytes:Ot,USER_DATA_REGISTERED_ITU_T_T35:It};var Rt=i;var Lt=Mt;var Pt=function(t){t=t||{};Pt.prototype.init.call(this);this.parse708captions_=typeof t.parse708captions==="boolean"?t.parse708captions:true;this.captionPackets_=[];this.ccStreams_=[new Wt(0,0),new Wt(0,1),new Wt(1,0),new Wt(1,1)];if(this.parse708captions_){this.cc708Stream_=new Vt({captionServices:t.captionServices})}this.reset();this.ccStreams_.forEach((function(t){t.on("data",this.trigger.bind(this,"data"));t.on("partialdone",this.trigger.bind(this,"partialdone"));t.on("done",this.trigger.bind(this,"done"))}),this);if(this.parse708captions_){this.cc708Stream_.on("data",this.trigger.bind(this,"data"));this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone"));this.cc708Stream_.on("done",this.trigger.bind(this,"done"))}};Pt.prototype=new Rt;Pt.prototype.push=function(t){var e,i,s;if(t.nalUnitType!=="sei_rbsp"){return}e=Lt.parseSei(t.escapedRBSP);if(!e.payload){return}if(e.payloadType!==Lt.USER_DATA_REGISTERED_ITU_T_T35){return}i=Lt.parseUserData(e);if(!i){return}if(t.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}s=Lt.parseCaptionPackets(t.pts,i);this.captionPackets_=this.captionPackets_.concat(s);if(this.latestDts_!==t.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=t.dts};Pt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach((function(e){return t==="flush"?e.flush():e.partialFlush()}),this)};Pt.prototype.flushStream=function(t){if(!this.captionPackets_.length){this.flushCCStreams(t);return}this.captionPackets_.forEach((function(t,e){t.presortIndex=e}));this.captionPackets_.sort((function(t,e){if(t.pts===e.pts){return t.presortIndex-e.presortIndex}return t.pts-e.pts}));this.captionPackets_.forEach((function(t){if(t.type<2){this.dispatchCea608Packet(t)}else{this.dispatchCea708Packet(t)}}),this);this.captionPackets_.length=0;this.flushCCStreams(t)};Pt.prototype.flush=function(){return this.flushStream("flush")};Pt.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Pt.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach((function(t){t.reset()}))};Pt.prototype.dispatchCea608Packet=function(t){if(this.setsTextOrXDSActive(t)){this.activeCea608Channel_[t.type]=null}else if(this.setsChannel1Active(t)){this.activeCea608Channel_[t.type]=0}else if(this.setsChannel2Active(t)){this.activeCea608Channel_[t.type]=1}if(this.activeCea608Channel_[t.type]===null){return}this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)};Pt.prototype.setsChannel1Active=function(t){return(t.ccData&30720)===4096};Pt.prototype.setsChannel2Active=function(t){return(t.ccData&30720)===6144};Pt.prototype.setsTextOrXDSActive=function(t){return(t.ccData&28928)===256||(t.ccData&30974)===4138||(t.ccData&30974)===6186};Pt.prototype.dispatchCea708Packet=function(t){if(this.parse708captions_){this.cc708Stream_.push(t)}};var $t={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600};var Ft=function(t){var e=$t[t]||t;if(t&4096&&t===e){return""}return String.fromCharCode(e)};var Ut=function(t){return 32<=t&&t<=127||160<=t&&t<=255};var Bt=function(t){this.windowNum=t;this.reset()};Bt.prototype.reset=function(){this.clearText();this.pendingNewLine=false;this.winAttr={};this.penAttr={};this.penLoc={};this.penColor={};this.visible=0;this.rowLock=0;this.columnLock=0;this.priority=0;this.relativePositioning=0;this.anchorVertical=0;this.anchorHorizontal=0;this.anchorPoint=0;this.rowCount=1;this.virtualRowCount=this.rowCount+1;this.columnCount=41;this.windowStyle=0;this.penStyle=0};Bt.prototype.getText=function(){return this.rows.join("\n")};Bt.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};Bt.prototype.newLine=function(t){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(t)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};Bt.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};Bt.prototype.addText=function(t){this.rows[this.rowIdx]+=t};Bt.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var qt=function(t,e,i){this.serviceNum=t;this.text="";this.currentWindow=new Bt(-1);this.windows=[];this.stream=i;if(typeof e==="string"){this.createTextDecoder(e)}};qt.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++){this.windows[i]=new Bt(i);if(typeof e==="function"){this.windows[i].beforeRowOverflow=e}}};qt.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]};qt.prototype.createTextDecoder=function(t){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(t)}catch(e){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+t+" encoding. "+e})}}};var Vt=function(t){t=t||{};Vt.prototype.init.call(this);var e=this;var i=t.captionServices||{};var s={};var n;Object.keys(i).forEach((t=>{n=i[t];if(/^SERVICE/.test(t)){s[t]=n.encoding}}));this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(t){if(t.type===3){e.new708Packet();e.add708Bytes(t)}else{if(e.current708Packet===null){e.new708Packet()}e.add708Bytes(t)}}};Vt.prototype=new Rt;Vt.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};Vt.prototype.add708Bytes=function(t){var e=t.ccData;var i=e>>>8;var s=e&255;this.current708Packet.ptsVals.push(t.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};Vt.prototype.push708Packet=function(){var t=this.current708Packet;var e=t.data;var i=null;var s=null;var n=0;var r=e[n++];t.seq=r>>6;t.sizeCode=r&63;for(;n<e.length;n++){r=e[n++];i=r>>5;s=r&31;if(i===7&&s>0){r=e[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};Vt.prototype.pushServiceBlock=function(t,e,i){var s;var n=e;var r=this.current708Packet.data;var o=this.services[t];if(!o){o=this.initService(t,n)}for(;n<e+i&&n<r.length;n++){s=r[n];if(Ut(s)){n=this.handleText(n,o)}else if(s===24){n=this.multiByteCharacter(n,o)}else if(s===16){n=this.extendedCommands(n,o)}else if(128<=s&&s<=135){n=this.setCurrentWindow(n,o)}else if(152<=s&&s<=159){n=this.defineWindow(n,o)}else if(s===136){n=this.clearWindows(n,o)}else if(s===140){n=this.deleteWindows(n,o)}else if(s===137){n=this.displayWindows(n,o)}else if(s===138){n=this.hideWindows(n,o)}else if(s===139){n=this.toggleWindows(n,o)}else if(s===151){n=this.setWindowAttributes(n,o)}else if(s===144){n=this.setPenAttributes(n,o)}else if(s===145){n=this.setPenColor(n,o)}else if(s===146){n=this.setPenLocation(n,o)}else if(s===143){o=this.reset(n,o)}else if(s===8){o.currentWindow.backspace()}else if(s===12){o.currentWindow.clearText()}else if(s===13){o.currentWindow.pendingNewLine=true}else if(s===14){o.currentWindow.clearText()}else if(s===141){n++}else;}};Vt.prototype.extendedCommands=function(t,e){var i=this.current708Packet.data;var s=i[++t];if(Ut(s)){t=this.handleText(t,e,{isExtended:true})}return t};Vt.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]};Vt.prototype.initService=function(t,e){var i="SERVICE"+t;var s=this;var i;var n;if(i in this.serviceEncodings){n=this.serviceEncodings[i]}this.services[t]=new qt(t,n,s);this.services[t].init(this.getPts(e),(function(e){s.flushDisplayed(e,s.services[t])}));return this.services[t]};Vt.prototype.handleText=function(t,e,i){var s=i&&i.isExtended;var n=i&&i.isMultiByte;var r=this.current708Packet.data;var o=s?4096:0;var a=r[t];var h=r[t+1];var c=e.currentWindow;var l;var u;function f(t){return t.map((t=>("0"+(t&255).toString(16)).slice(-2))).join("")}if(n){u=[a,h];t++}else{u=[a]}if(e.textDecoder_&&!s){l=e.textDecoder_.decode(new Uint8Array(u))}else{if(n){const t=f(u);l=String.fromCharCode(parseInt(t,16))}else{l=Ft(o|a)}}if(c.pendingNewLine&&!c.isEmpty()){c.newLine(this.getPts(t))}c.pendingNewLine=false;c.addText(l);return t};Vt.prototype.multiByteCharacter=function(t,e){var i=this.current708Packet.data;var s=i[t+1];var n=i[t+2];if(Ut(s)&&Ut(n)){t=this.handleText(++t,e,{isMultiByte:true})}return t};Vt.prototype.setCurrentWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);return t};Vt.prototype.defineWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);var r=e.currentWindow;s=i[++t];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++t];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++t];r.anchorHorizontal=s;s=i[++t];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++t];r.columnCount=s&63;s=i[++t];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return t};Vt.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.winAttr;s=i[++t];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++t];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++t];n.borderType+=(s&128)>>5;n.wordWrap=(s&64)>>6;n.printDirection=(s&48)>>4;n.scrollDirection=(s&12)>>2;n.justify=s&3;s=i[++t];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return t};Vt.prototype.flushDisplayed=function(t,e){var i=[];for(var s=0;s<8;s++){if(e.windows[s].visible&&!e.windows[s].isEmpty()){i.push(e.windows[s].getText())}}e.endPts=t;e.text=i.join("\n\n");this.pushCaption(e);e.startPts=t};Vt.prototype.pushCaption=function(t){if(t.text!==""){this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum});t.text="";t.startPts=t.endPts}};Vt.prototype.displayWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=1}}return t};Vt.prototype.hideWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=0}}return t};Vt.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible^=1}}return t};Vt.prototype.clearWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].clearText()}}return t};Vt.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].reset()}}return t};Vt.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penAttr;s=i[++t];n.textTag=(s&240)>>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++t];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return t};Vt.prototype.setPenColor=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penColor;s=i[++t];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++t];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++t];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return t};Vt.prototype.setPenLocation=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penLoc;e.currentWindow.pendingNewLine=true;s=i[++t];n.row=s&15;s=i[++t];n.column=s&63;return t};Vt.prototype.reset=function(t,e){var i=this.getPts(t);this.flushDisplayed(i,e);return this.initService(e.serviceNum,t)};var zt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496};var Ht=function(t){if(t===null){return""}t=zt[t]||t;return String.fromCharCode(t)};var Xt=14;var Gt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var Yt=function(){var t=[],e=Xt+1;while(e--){t.push({text:"",indent:0,offset:0})}return t};var Wt=function(t,e){Wt.prototype.init.call(this);this.field_=t||0;this.dataChannel_=e||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(t){var e,i,s,n,r;e=t.ccData&32639;if(e===this.lastControlCode_){this.lastControlCode_=null;return}if((e&61440)===4096){this.lastControlCode_=e}else if(e!==this.PADDING_){this.lastControlCode_=null}s=e>>>8;n=e&255;if(e===this.PADDING_){return}else if(e===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(e===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(t.pts);this.flushDisplayed(t.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=t.pts}else if(e===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(t.pts)}else if(e===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(t.pts)}else if(e===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(t.pts)}else if(e===this.CARRIAGE_RETURN_){this.clearFormatting(t.pts);this.flushDisplayed(t.pts);this.shiftRowsUp_();this.startPts_=t.pts}else if(e===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}}else if(e===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(t.pts);this.displayed_=Yt()}else if(e===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Yt()}else if(e===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(t.pts);this.displayed_=Yt()}this.mode_="paintOn";this.startPts_=t.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=Ht(s|n);this[this.mode_](t.pts,r);this.column_++}else if(this.isExtCharacter(s,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}s=(s&3)<<8;r=Ht(s|n);this[this.mode_](t.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(t.pts);this[this.mode_](t.pts," ");this.column_++;if((n&14)===14){this.addFormatting(t.pts,["i"])}if((n&1)===1){this.addFormatting(t.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){const t=n&3;this.nonDisplayed_[this.row_].offset=t;this.column_+=t}else if(this.isPAC(s,n)){var o=Gt.indexOf(e&7968);if(this.mode_==="rollUp"){if(o-this.rollUpRows_+1<0){o=this.rollUpRows_-1}this.setRollUp(t.pts,o)}if(o!==this.row_&&o>=0&&o<=14){this.clearFormatting(t.pts);this.row_=o}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(t.pts,["u"])}if((e&16)===16){const t=(e&14)>>1;this.column_=t*4;this.nonDisplayed_[this.row_].indent+=t}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(t.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=Ht(s);r+=Ht(n);this[this.mode_](t.pts,r);this.column_+=r.length}}};Wt.prototype=new Rt;Wt.prototype.flushDisplayed=function(t){const e=t=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."})};const i=[];this.displayed_.forEach(((t,s)=>{if(t&&t.text&&t.text.length){try{t.text=t.text.trim()}catch(t){e(s)}if(t.text.length){i.push({text:t.text,line:s+1,position:10+Math.min(70,t.indent*10)+t.offset*2.5})}}else if(t===undefined||t===null){e(s)}}));if(i.length){this.trigger("data",{startPts:this.startPts_,endPts:t,content:i,stream:this.name_})}};Wt.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Yt();this.nonDisplayed_=Yt();this.lastControlCode_=null;this.column_=0;this.row_=Xt;this.rollUpRows_=2;this.formatting_=[]};Wt.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};Wt.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63};Wt.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63};Wt.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47};Wt.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35};Wt.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127};Wt.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127};Wt.prototype.isNormalChar=function(t){return t>=32&&t<=127};Wt.prototype.setRollUp=function(t,e){if(this.mode_!=="rollUp"){this.row_=Xt;this.mode_="rollUp";this.flushDisplayed(t);this.nonDisplayed_=Yt();this.displayed_=Yt()}if(e!==undefined&&e!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[e-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]={text:"",indent:0,offset:0}}}if(e===undefined){e=this.row_}this.topRow_=e-this.rollUpRows_+1};Wt.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce((function(t,e){return t+"<"+e+">"}),"");this[this.mode_](t,i)};Wt.prototype.clearFormatting=function(t){if(!this.formatting_.length){return}var e=this.formatting_.reverse().reduce((function(t,e){return t+"</"+e+">"}),"");this.formatting_=[];this[this.mode_](t,e)};Wt.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_].text;i+=e;this.nonDisplayed_[this.row_].text=i};Wt.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};Wt.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.row_+1;t<Xt+1;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.topRow_;t<this.row_;t++){this.displayed_[t]=this.displayed_[t+1]}this.displayed_[this.row_]={text:"",indent:0,offset:0}};Wt.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};var Jt={CaptionStream:Pt,Cea608Stream:Wt,Cea708Stream:Vt};var Kt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var Qt=i;var Zt=8589934592;var te=4294967296;var ee="shared";var ie=function(t,e){var i=1;if(t>e){i=-1}while(Math.abs(e-t)>te){t+=i*Zt}return t};var se=function(t){var e,i;se.prototype.init.call(this);this.type_=t||ee;this.push=function(t){if(t.type==="metadata"){this.trigger("data",t);return}if(this.type_!==ee&&t.type!==this.type_){return}if(i===undefined){i=t.dts}t.dts=ie(t.dts,i);t.pts=ie(t.pts,i);e=t.dts;this.trigger("data",t)};this.flush=function(){i=e;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;e=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};se.prototype=new Qt;var ne={TimestampRolloverStream:se,handleRollover:ie};var re=(t,e,i)=>{if(!t){return-1}var s=i;for(;s<t.length;s++){if(t[s]===e){return s}}return-1};var oe={typedArrayIndexOf:re};var ae=oe.typedArrayIndexOf,he={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ce=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n},le=function(t,e,i){return decodeURIComponent(ce(t,e,i))},ue=function(t,e,i){return unescape(ce(t,e,i))},fe=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},de={APIC:function(t){var e=1,i,s,n="--\x3e";if(t.data[0]!==he.Utf8){return}i=ae(t.data,0,e);if(i<0){return}t.mimeType=ue(t.data,e,i);e=i+1;t.pictureType=t.data[e];e++;s=ae(t.data,0,e);if(s<0){return}t.description=le(t.data,e,s);e=s+1;if(t.mimeType===n){t.url=ue(t.data,e,t.data.length)}else{t.pictureData=t.data.subarray(e,t.data.length)}},"T*":function(t){if(t.data[0]!==he.Utf8){return}t.value=le(t.data,1,t.data.length).replace(/\0*$/,"");t.values=t.value.split("\0")},TXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=le(t.data,1,e);t.value=le(t.data,e+1,t.data.length).replace(/\0*$/,"");t.data=t.value},"W*":function(t){t.url=ue(t.data,0,t.data.length).replace(/\0.*$/,"")},WXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=le(t.data,1,e);t.url=ue(t.data,e+1,t.data.length).replace(/\0.*$/,"")},PRIV:function(t){var e;for(e=0;e<t.data.length;e++){if(t.data[e]===0){t.owner=ue(t.data,0,e);break}}t.privateData=t.data.subarray(e+1);t.data=t.privateData}};var pe=function(t){var e,i,s=10,n=0,r=[];if(t.length<10||t[0]!=="I".charCodeAt(0)||t[1]!=="D".charCodeAt(0)||t[2]!=="3".charCodeAt(0)){return}n=fe(t.subarray(6,10));n+=10;var o=t[5]&64;if(o){s+=4;s+=fe(t.subarray(10,14));n-=fe(t.subarray(16,20))}do{e=fe(t.subarray(s+4,s+8));if(e<1){break}i=String.fromCharCode(t[s],t[s+1],t[s+2],t[s+3]);var a={id:i,data:t.subarray(s+10,s+e+10)};a.key=a.id;if(de[a.id]){de[a.id](a)}else if(a.id[0]==="T"){de["T*"](a)}else if(a.id[0]==="W"){de["W*"](a)}r.push(a);s+=10;s+=e}while(s<n);return r};var ve={parseId3Frames:pe,parseSyncSafeInteger:fe,frameParsers:de};var me=i,ge=Kt,be=ve,ye;ye=function(t){var e={descriptor:t&&t.descriptor},i=0,s=[],n=0,r;ye.prototype.init.call(this);this.dispatchType=ge.METADATA_STREAM_TYPE.toString(16);if(e.descriptor){for(r=0;r<e.descriptor.length;r++){this.dispatchType+=("00"+e.descriptor[r].toString(16)).slice(-2)}}this.push=function(t){var e,r,o,a,h,c;if(t.type!=="timed-metadata"){return}if(t.dataAlignmentIndicator){n=0;s.length=0}if(s.length===0&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}s.push(t);n+=t.data.byteLength;if(s.length===1){i=be.parseSyncSafeInteger(t.data.subarray(6,10));i+=10}if(n<i){return}e={data:new Uint8Array(i),frames:[],pts:s[0].pts,dts:s[0].dts};for(h=0;h<i;){e.data.set(s[0].data.subarray(0,i-h),h);h+=s[0].data.byteLength;n-=s[0].data.byteLength;s.shift()}r=10;if(e.data[5]&64){r+=4;r+=be.parseSyncSafeInteger(e.data.subarray(10,14));i-=be.parseSyncSafeInteger(e.data.subarray(16,20))}do{o=be.parseSyncSafeInteger(e.data.subarray(r+4,r+8));if(o<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}c=String.fromCharCode(e.data[r],e.data[r+1],e.data[r+2],e.data[r+3]);a={id:c,data:e.data.subarray(r+10,r+o+10)};a.key=a.id;if(be.frameParsers[a.id]){be.frameParsers[a.id](a)}else if(a.id[0]==="T"){be.frameParsers["T*"](a)}else if(a.id[0]==="W"){be.frameParsers["W*"](a)}if(a.owner==="com.apple.streaming.transportStreamTimestamp"){var l=a.data,u=(l[3]&1)<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;u*=4;u+=l[7]&3;a.timeStamp=u;if(e.pts===undefined&&e.dts===undefined){e.pts=a.timeStamp;e.dts=a.timeStamp}this.trigger("timestamp",a)}e.frames.push(a);r+=10;r+=o}while(r<i);this.trigger("data",e)}};ye.prototype=new me;var je=ye;var we=i,Te=Jt,ke=Kt,Se=ne.TimestampRolloverStream;var xe,Ae,Ee;var Ie=188,De=71;xe=function(){var t=new Uint8Array(Ie),e=0;xe.prototype.init.call(this);this.push=function(i){var s=0,n=Ie,r;if(e){r=new Uint8Array(i.byteLength+e);r.set(t.subarray(0,e));r.set(i,e);e=0}else{r=i}while(n<r.byteLength){if(r[s]===De&&r[n]===De){this.trigger("data",r.subarray(s,n));s+=Ie;n+=Ie;continue}s++;n++}if(s<r.byteLength){t.set(r.subarray(s),0);e=r.byteLength-s}};this.flush=function(){if(e===Ie&&t[0]===De){this.trigger("data",t);e=0}this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.reset=function(){e=0;this.trigger("reset")}};xe.prototype=new we;Ae=function(){var t,e,i,s;Ae.prototype.init.call(this);s=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;t=function(t,s){var n=0;if(s.payloadUnitStartIndicator){n+=t[n]+1}if(s.type==="pat"){e(t.subarray(n),s)}else{i(t.subarray(n),s)}};e=function(t,e){e.section_number=t[7];e.last_section_number=t[8];s.pmtPid=(t[10]&31)<<8|t[11];e.pmtPid=s.pmtPid};i=function(t,e){var i,n,r,o;if(!(t[5]&1)){return}s.programMapTable={video:null,audio:null,"timed-metadata":{}};i=(t[1]&15)<<8|t[2];n=3+i-4;r=(t[10]&15)<<8|t[11];o=12+r;while(o<n){var a=t[o];var h=(t[o+1]&31)<<8|t[o+2];if(a===ke.H264_STREAM_TYPE&&s.programMapTable.video===null){s.programMapTable.video=h}else if(a===ke.ADTS_STREAM_TYPE&&s.programMapTable.audio===null){s.programMapTable.audio=h}else if(a===ke.METADATA_STREAM_TYPE){s.programMapTable["timed-metadata"][h]=a}o+=((t[o+3]&15)<<8|t[o+4])+5}e.programMapTable=s.programMapTable};this.push=function(e){var i={},s=4;i.payloadUnitStartIndicator=!!(e[1]&64);i.pid=e[1]&31;i.pid<<=8;i.pid|=e[2];if((e[3]&48)>>>4>1){s+=e[s]+1}if(i.pid===0){i.type="pat";t(e.subarray(s),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";t(e.subarray(s),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,s,i])}else{this.processPes_(e,s,i)}};this.processPes_=function(t,e,i){if(i.pid===this.programMapTable.video){i.streamType=ke.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=ke.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=t.subarray(e);this.trigger("data",i)}};Ae.prototype=new we;Ae.STREAM_TYPES={h264:27,adts:15};Ee=function(){var t=this,e=false,i={data:[],size:0},s={data:[],size:0},n={data:[],size:0},r,o=function(t,e){var i;const s=t[0]<<16|t[1]<<8|t[2];e.data=new Uint8Array;if(s!==1){return}e.packetLength=6+(t[4]<<8|t[5]);e.dataAlignmentIndicator=(t[6]&4)!==0;i=t[7];if(i&192){e.pts=(t[9]&14)<<27|(t[10]&255)<<20|(t[11]&254)<<12|(t[12]&255)<<5|(t[13]&254)>>>3;e.pts*=4;e.pts+=(t[13]&6)>>>1;e.dts=e.pts;if(i&64){e.dts=(t[14]&14)<<27|(t[15]&255)<<20|(t[16]&254)<<12|(t[17]&255)<<5|(t[18]&254)>>>3;e.dts*=4;e.dts+=(t[18]&6)>>>1}}e.data=t.subarray(9+t[8])},a=function(e,i,s){var n=new Uint8Array(e.size),r={type:i},a=0,h=0,c=false,l;if(!e.data.length||e.size<9){return}r.trackId=e.data[0].pid;for(a=0;a<e.data.length;a++){l=e.data[a];n.set(l.data,h);h+=l.data.byteLength}o(n,r);c=i==="video"||r.packetLength<=e.size;if(s||c){e.size=0;e.data.length=0}if(c){t.trigger("data",r)}};Ee.prototype.init.call(this);this.push=function(o){({pat:function(){},pes:function(){var t,e;switch(o.streamType){case ke.H264_STREAM_TYPE:t=i;e="video";break;case ke.ADTS_STREAM_TYPE:t=s;e="audio";break;case ke.METADATA_STREAM_TYPE:t=n;e="timed-metadata";break;default:return}if(o.payloadUnitStartIndicator){a(t,e,true)}t.data.push(o);t.size+=o.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};r=o.programMapTable;if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}e=true;t.trigger("data",i)}})[o.type]()};this.reset=function(){i.size=0;i.data.length=0;s.size=0;s.data.length=0;this.trigger("reset")};this.flushStreams_=function(){a(i,"video");a(s,"audio");a(n,"timed-metadata")};this.flush=function(){if(!e&&r){var i={type:"metadata",tracks:[]};if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}t.trigger("data",i)}e=false;this.flushStreams_();this.trigger("done")}};Ee.prototype=new we;var Ce={PAT_PID:0,MP2T_PACKET_LENGTH:Ie,TransportPacketStream:xe,TransportParseStream:Ae,ElementaryStream:Ee,TimestampRolloverStream:Se,CaptionStream:Te.CaptionStream,Cea608Stream:Te.Cea608Stream,Cea708Stream:Te.Cea708Stream,MetadataStream:je};for(var Ne in ke){if(ke.hasOwnProperty(Ne)){Ce[Ne]=ke[Ne]}}var _e=Ce;var Oe=i;var Me=pt.ONE_SECOND_IN_TS;var Re;var Le=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Re=function(t){var e,i=0;Re.prototype.init.call(this);this.skipWarn_=function(t,e){this.trigger("log",{level:"warn",message:`adts skiping bytes ${t} to ${e} in frame ${i} outside syncword`})};this.push=function(s){var n=0,r,o,a,h,c;if(!t){i=0}if(s.type!=="audio"){return}if(e&&e.length){a=e;e=new Uint8Array(a.byteLength+s.data.byteLength);e.set(a);e.set(s.data,a.byteLength)}else{e=s.data}var l;while(n+7<e.length){if(e[n]!==255||(e[n+1]&246)!==240){if(typeof l!=="number"){l=n}n++;continue}if(typeof l==="number"){this.skipWarn_(l,n);l=null}o=(~e[n+1]&1)*2;r=(e[n+3]&3)<<11|e[n+4]<<3|(e[n+5]&224)>>5;h=((e[n+6]&3)+1)*1024;c=h*Me/Le[(e[n+2]&60)>>>2];if(e.byteLength-n<r){break}this.trigger("data",{pts:s.pts+i*c,dts:s.dts+i*c,sampleCount:h,audioobjecttype:(e[n+2]>>>6&3)+1,channelcount:(e[n+2]&1)<<2|(e[n+3]&192)>>>6,samplerate:Le[(e[n+2]&60)>>>2],samplingfrequencyindex:(e[n+2]&60)>>>2,samplesize:16,data:e.subarray(n+7+o,n+r)});i++;n+=r}if(typeof l==="number"){this.skipWarn_(l,n);l=null}e=e.subarray(n)};this.flush=function(){i=0;this.trigger("done")};this.reset=function(){e=void 0;this.trigger("reset")};this.endTimeline=function(){e=void 0;this.trigger("endedtimeline")}};Re.prototype=new Oe;var Pe=Re;var $e;$e=function(t){var e=t.byteLength,i=0,s=0;this.length=function(){return 8*e};this.bitsAvailable=function(){return 8*e+s};this.loadWord=function(){var n=t.byteLength-e,r=new Uint8Array(4),o=Math.min(4,e);if(o===0){throw new Error("no bytes available")}r.set(t.subarray(n,n+o));i=new DataView(r.buffer).getUint32(0);s=o*8;e-=o};this.skipBits=function(t){var n;if(s>t){i<<=t;s-=t}else{t-=s;n=Math.floor(t/8);t-=n*8;e-=n;this.loadWord();i<<=t;s-=t}};this.readBits=function(t){var n=Math.min(s,t),r=i>>>32-n;s-=n;if(s>0){i<<=n}else if(e>0){this.loadWord()}n=t-n;if(n>0){return r<<n|this.readBits(n)}return r};this.skipLeadingZeros=function(){var t;for(t=0;t<s;++t){if((i&2147483648>>>t)!==0){i<<=t;s-=t;return t}}this.loadWord();return t+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1};this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();if(1&t){return 1+t>>>1}return-1*(t>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Fe=$e;var Ue=i;var Be=Fe;var qe,Ve;var ze;Ve=function(){var t=0,e,i;Ve.prototype.init.call(this);this.push=function(s){var n;if(!i){i=s.data}else{n=new Uint8Array(i.byteLength+s.data.byteLength);n.set(i);n.set(s.data,i.byteLength);i=n}var r=i.byteLength;for(;t<r-3;t++){if(i[t+2]===1){e=t+5;break}}while(e<r){switch(i[e]){case 0:if(i[e-1]!==0){e+=2;break}else if(i[e-2]!==0){e++;break}if(t+3!==e-2){this.trigger("data",i.subarray(t+3,e-2))}do{e++}while(i[e]!==1&&e<r);t=e-2;e+=3;break;case 1:if(i[e-1]!==0||i[e-2]!==0){e+=3;break}this.trigger("data",i.subarray(t+3,e-2));t=e-2;e+=3;break;default:e+=3;break}}i=i.subarray(t);e-=t;t=0};this.reset=function(){i=null;t=0;this.trigger("reset")};this.flush=function(){if(i&&i.byteLength>3){this.trigger("data",i.subarray(t+3))}i=null;t=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};Ve.prototype=new Ue;ze={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};qe=function(){var t=new Ve,e,i,s,n,r,o,a;qe.prototype.init.call(this);e=this;this.push=function(e){if(e.type!=="video"){return}i=e.trackId;s=e.pts;n=e.dts;t.push(e)};t.on("data",(function(t){var a={trackId:i,pts:s,dts:n,data:t,nalUnitTypeCode:t[0]&31};switch(a.nalUnitTypeCode){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp";a.escapedRBSP=r(t.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp";a.escapedRBSP=r(t.subarray(1));a.config=o(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",a)}));t.on("done",(function(){e.trigger("done")}));t.on("partialdone",(function(){e.trigger("partialdone")}));t.on("reset",(function(){e.trigger("reset")}));t.on("endedtimeline",(function(){e.trigger("endedtimeline")}));this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};a=function(t,e){var i=8,s=8,n,r;for(n=0;n<t;n++){if(s!==0){r=e.readExpGolomb();s=(i+r+256)%256}i=s===0?i:s}};r=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};o=function(t){var e=0,i=0,s=0,n=0,r,o,h,c,l,u,f,d,p,v,m,g=[1,1],b,y;r=new Be(t);o=r.readUnsignedByte();c=r.readUnsignedByte();h=r.readUnsignedByte();r.skipUnsignedExpGolomb();if(ze[o]){l=r.readUnsignedExpGolomb();if(l===3){r.skipBits(1)}r.skipUnsignedExpGolomb();r.skipUnsignedExpGolomb();r.skipBits(1);if(r.readBoolean()){m=l!==3?8:12;for(y=0;y<m;y++){if(r.readBoolean()){if(y<6){a(16,r)}else{a(64,r)}}}}}r.skipUnsignedExpGolomb();u=r.readUnsignedExpGolomb();if(u===0){r.readUnsignedExpGolomb()}else if(u===1){r.skipBits(1);r.skipExpGolomb();r.skipExpGolomb();f=r.readUnsignedExpGolomb();for(y=0;y<f;y++){r.skipExpGolomb()}}r.skipUnsignedExpGolomb();r.skipBits(1);d=r.readUnsignedExpGolomb();p=r.readUnsignedExpGolomb();v=r.readBits(1);if(v===0){r.skipBits(1)}r.skipBits(1);if(r.readBoolean()){e=r.readUnsignedExpGolomb();i=r.readUnsignedExpGolomb();s=r.readUnsignedExpGolomb();n=r.readUnsignedExpGolomb()}if(r.readBoolean()){if(r.readBoolean()){b=r.readUnsignedByte();switch(b){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[r.readUnsignedByte()<<8|r.readUnsignedByte(),r.readUnsignedByte()<<8|r.readUnsignedByte()];break}}}}return{profileIdc:o,levelIdc:h,profileCompatibility:c,width:(d+1)*16-e*2-i*2,height:(2-v)*(p+1)*16-s*2-n*2,sarRatio:g}}};qe.prototype=new Ue;var He={H264Stream:qe,NalByteStream:Ve};var Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var Ge=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9],s=t[e+5],n=(s&16)>>4;i=i>=0?i:0;if(n){return i+20}return i+10};var Ye=function(t,e){if(t.length-e<10||t[e]!=="I".charCodeAt(0)||t[e+1]!=="D".charCodeAt(0)||t[e+2]!=="3".charCodeAt(0)){return e}e+=Ge(t,e);return Ye(t,e)};var We=function(t){var e=Ye(t,0);return t.length>=e+2&&(t[e]&255)===255&&(t[e+1]&240)===240&&(t[e+1]&22)===16};var Je=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]};var Ke=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n};var Qe=function(t,e,i){return unescape(Ke(t,e,i))};var Ze=function(t,e){var i=(t[e+5]&224)>>5,s=t[e+4]<<3,n=t[e+3]&3<<11;return n|s|i};var ti=function(t,e){if(t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(t[e]&255===255&&(t[e+1]&240)===240){return"audio"}return null};var ei=function(t){var e=0;while(e+5<t.length){if(t[e]!==255||(t[e+1]&246)!==240){e++;continue}return Xe[(t[e+2]&60)>>>2]}return null};var ii=function(t){var e,i,s,n;e=10;if(t[5]&64){e+=4;e+=Je(t.subarray(10,14))}do{i=Je(t.subarray(e+4,e+8));if(i<1){return null}n=String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3]);if(n==="PRIV"){s=t.subarray(e+10,e+i+10);for(var r=0;r<s.byteLength;r++){if(s[r]===0){var o=Qe(s,0,r);if(o==="com.apple.streaming.transportStreamTimestamp"){var a=s.subarray(r+1);var h=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;h*=4;h+=a[7]&3;return h}break}}}e+=10;e+=i}while(e<t.byteLength);return null};var si={isLikelyAacData:We,parseId3TagSize:Ge,parseAdtsSize:Ze,parseType:ti,parseSampleRate:ei,parseAacTimestamp:ii};var ni=i;var ri=si;var oi;oi=function(){var t=new Uint8Array,e=0;oi.prototype.init.call(this);this.setTimestamp=function(t){e=t};this.push=function(i){var s=0,n=0,r,o,a,h;if(t.length){h=t.length;t=new Uint8Array(i.byteLength+h);t.set(t.subarray(0,h));t.set(i,h)}else{t=i}while(t.length-n>=3){if(t[n]==="I".charCodeAt(0)&&t[n+1]==="D".charCodeAt(0)&&t[n+2]==="3".charCodeAt(0)){if(t.length-n<10){break}s=ri.parseId3TagSize(t,n);if(n+s>t.length){break}o={type:"timed-metadata",data:t.subarray(n,n+s)};this.trigger("data",o);n+=s;continue}else if((t[n]&255)===255&&(t[n+1]&240)===240){if(t.length-n<7){break}s=ri.parseAdtsSize(t,n);if(n+s>t.length){break}a={type:"audio",data:t.subarray(n,n+s),pts:e,dts:e};this.trigger("data",a);n+=s;continue}n++}r=t.length-n;if(r>0){t=t.subarray(n)}else{t=new Uint8Array}};this.reset=function(){t=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){t=new Uint8Array;this.trigger("endedtimeline")}};oi.prototype=new ni;var ai=oi;var hi=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var ci=hi;var li=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var ui=li;var fi=i;var di=V;var pi=Z;var vi=Tt;var mi=Et;var gi=_e;var bi=pt;var yi=Pe;var ji=He.H264Stream;var wi=ai;var Ti=si.isLikelyAacData;var ki=pt.ONE_SECOND_IN_TS;var Si=ci;var xi=ui;var Ai,Ei,Ii,Di;var Ci=function(t,e){e.stream=t;this.trigger("log",e)};var Ni=function(t,e){var i=Object.keys(e);for(var s=0;s<i.length;s++){var n=i[s];if(n==="headOfPipeline"||!e[n].on){continue}e[n].on("log",Ci.bind(t,n))}};var _i=function(t,e){var i;if(t.length!==e.length){return false}for(i=0;i<t.length;i++){if(t[i]!==e[i]){return false}}return true};var Oi=function(t,e,i,s,n,r){var o=i-e,a=s-e,h=n-i;return{start:{dts:t,pts:t+o},end:{dts:t+a,pts:t+h},prependedContentDuration:r,baseMediaDecodeTime:t}};Ei=function(t,e){var i=[],s,n=0,r=0,o=Infinity;e=e||{};s=e.firstSequenceNumber||0;Ei.prototype.init.call(this);this.push=function(e){mi.collectDtsInfo(t,e);if(t){Si.forEach((function(i){t[i]=e[i]}))}i.push(e)};this.setEarliestDts=function(t){n=t};this.setVideoBaseMediaDecodeTime=function(t){o=t};this.setAudioAppendStart=function(t){r=t};this.flush=function(){var a,h,c,l,u,f,d;if(i.length===0){this.trigger("done","AudioSegmentStream");return}a=vi.trimAdtsFramesByEarliestDts(i,t,n);t.baseMediaDecodeTime=mi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);d=vi.prefixWithSilence(t,a,r,o);t.samples=vi.generateSampleTable(a);c=di.mdat(vi.concatenateFrameData(a));i=[];h=di.moof(s,[t]);l=new Uint8Array(h.byteLength+c.byteLength);s++;l.set(h);l.set(c,h.byteLength);mi.clearDtsInfo(t);u=Math.ceil(ki*1024/t.samplerate);if(a.length){f=a.length*u;this.trigger("segmentTimingInfo",Oi(bi.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),a[0].dts,a[0].pts,a[0].dts+f,a[0].pts+f,d||0));this.trigger("timingInfo",{start:a[0].pts,end:a[0].pts+f})}this.trigger("data",{track:t,boxes:l});this.trigger("done","AudioSegmentStream")};this.reset=function(){mi.clearDtsInfo(t);i=[];this.trigger("reset")}};Ei.prototype=new fi;Ai=function(t,e){var i,s=[],n=[],r,o;e=e||{};i=e.firstSequenceNumber||0;Ai.prototype.init.call(this);delete t.minPTS;this.gopCache_=[];this.push=function(e){mi.collectDtsInfo(t,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!r){r=e.config;t.sps=[e.data];xi.forEach((function(e){t[e]=r[e]}),this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!o){o=e.data;t.pps=[e.data]}s.push(e)};this.flush=function(){var r,o,a,h,c,l,u=0,f,d;while(s.length){if(s[0].nalUnitType==="access_unit_delimiter_rbsp"){break}s.shift()}if(s.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}r=pi.groupNalsIntoFrames(s);a=pi.groupFramesIntoGops(r);if(!a[0][0].keyFrame){o=this.getGopForFusion_(s[0],t);if(o){u=o.duration;a.unshift(o);a.byteLength+=o.byteLength;a.nalCount+=o.nalCount;a.pts=o.pts;a.dts=o.dts;a.duration+=o.duration}else{a=pi.extendFirstKeyFrame(a)}}if(n.length){var p;if(e.alignGopsAtEnd){p=this.alignGopsAtEnd_(a)}else{p=this.alignGopsAtStart_(a)}if(!p){this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}mi.clearDtsInfo(t);a=p}mi.collectDtsInfo(t,a);t.samples=pi.generateSampleTable(a);c=di.mdat(pi.concatenateNalData(a));t.baseMediaDecodeTime=mi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);this.trigger("processedGopsInfo",a.map((function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})));f=a[0];d=a[a.length-1];this.trigger("segmentTimingInfo",Oi(t.baseMediaDecodeTime,f.dts,f.pts,d.dts+d.duration,d.pts+d.duration,u));this.trigger("timingInfo",{start:a[0].pts,end:a[a.length-1].pts+a[a.length-1].duration});this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime);this.trigger("timelineStartInfo",t.timelineStartInfo);h=di.moof(i,[t]);l=new Uint8Array(h.byteLength+c.byteLength);i++;l.set(h);l.set(c,h.byteLength);this.trigger("data",{track:t,boxes:l});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();s=[];this.gopCache_.length=0;n.length=0;this.trigger("reset")};this.resetStream_=function(){mi.clearDtsInfo(t);r=undefined;o=undefined};this.getGopForFusion_=function(e){var i=45e3,s=1e4,n=Infinity,r,o,a,h,c;for(c=0;c<this.gopCache_.length;c++){h=this.gopCache_[c];a=h.gop;if(!(t.pps&&_i(t.pps[0],h.pps[0]))||!(t.sps&&_i(t.sps[0],h.sps[0]))){continue}if(a.dts<t.timelineStartInfo.dts){continue}r=e.dts-a.dts-a.duration;if(r>=-s&&r<=i){if(!o||n>r){o=h;n=r}}}if(o){return o.gop}return null};this.alignGopsAtStart_=function(t){var e,i,s,r,o,a,h,c;o=t.byteLength;a=t.nalCount;h=t.duration;e=i=0;while(e<n.length&&i<t.length){s=n[e];r=t[i];if(s.pts===r.pts){break}if(r.pts>s.pts){e++;continue}i++;o-=r.byteLength;a-=r.nalCount;h-=r.duration}if(i===0){return t}if(i===t.length){return null}c=t.slice(i);c.byteLength=o;c.duration=h;c.nalCount=a;c.pts=c[0].pts;c.dts=c[0].dts;return c};this.alignGopsAtEnd_=function(t){var e,i,s,r,o,a;e=n.length-1;i=t.length-1;o=null;a=false;while(e>=0&&i>=0){s=n[e];r=t[i];if(s.pts===r.pts){a=true;break}if(s.pts>r.pts){e--;continue}if(e===n.length-1){o=i}i--}if(!a&&o===null){return null}var h;if(a){h=i}else{h=o}if(h===0){return t}var c=t.slice(h);var l=c.reduce((function(t,e){t.byteLength+=e.byteLength;t.duration+=e.duration;t.nalCount+=e.nalCount;return t}),{byteLength:0,duration:0,nalCount:0});c.byteLength=l.byteLength;c.duration=l.duration;c.nalCount=l.nalCount;c.pts=c[0].pts;c.dts=c[0].dts;return c};this.alignGopsWith=function(t){n=t}};Ai.prototype=new fi;Di=function(t,e){this.numberOfTracks=0;this.metadataStream=e;t=t||{};if(typeof t.remux!=="undefined"){this.remuxTracks=!!t.remux}else{this.remuxTracks=true}if(typeof t.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=t.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Di.prototype.init.call(this);this.push=function(t){if(t.content||t.text){return this.pendingCaptions.push(t)}if(t.frames){return this.pendingMetadata.push(t)}this.pendingTracks.push(t.track);this.pendingBytes+=t.boxes.byteLength;if(t.track.type==="video"){this.videoTrack=t.track;this.pendingBoxes.push(t.boxes)}if(t.track.type==="audio"){this.audioTrack=t.track;this.pendingBoxes.unshift(t.boxes)}}};Di.prototype=new fi;Di.prototype.flush=function(t){var e=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,o=0,a;if(this.pendingTracks.length<this.numberOfTracks){if(t!=="VideoSegmentStream"&&t!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){o=this.videoTrack.timelineStartInfo.pts;xi.forEach((function(t){i.info[t]=this.videoTrack[t]}),this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;Si.forEach((function(t){i.info[t]=this.audioTrack[t]}),this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=di.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(a=0;a<this.pendingBoxes.length;a++){i.data.set(this.pendingBoxes[a],e);e+=this.pendingBoxes[a].byteLength}for(a=0;a<this.pendingCaptions.length;a++){s=this.pendingCaptions[a];s.startTime=bi.metadataTsToSeconds(s.startPts,o,this.keepOriginalTimestamps);s.endTime=bi.metadataTsToSeconds(s.endPts,o,this.keepOriginalTimestamps);i.captionStreams[s.stream]=true;i.captions.push(s)}for(a=0;a<this.pendingMetadata.length;a++){n=this.pendingMetadata[a];n.cueTime=bi.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps);i.metadata.push(n)}i.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingCaptions.length=0;this.pendingBytes=0;this.pendingMetadata.length=0;this.trigger("data",i);for(a=0;a<i.captions.length;a++){s=i.captions[a];this.trigger("caption",s)}for(a=0;a<i.metadata.length;a++){n=i.metadata[a];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Di.prototype.setRemux=function(t){this.remuxTracks=t};Ii=function(t){var e=this,i=true,s,n;Ii.prototype.init.call(this);t=t||{};this.baseMediaDecodeTime=t.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="aac";i.metadataStream=new gi.MetadataStream;i.aacStream=new wi;i.audioTimestampRolloverStream=new gi.TimestampRolloverStream("audio");i.timedMetadataTimestampRolloverStream=new gi.TimestampRolloverStream("timed-metadata");i.adtsStream=new yi;i.coalesceStream=new Di(t,i.metadataStream);i.headOfPipeline=i.aacStream;i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream);i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream);i.metadataStream.on("timestamp",(function(t){i.aacStream.setTimestamp(t.timeStamp)}));i.aacStream.on("data",(function(r){if(r.type!=="timed-metadata"&&r.type!=="audio"||i.audioSegmentStream){return}n=n||{timelineStartInfo:{baseMediaDecodeTime:e.baseMediaDecodeTime},codec:"adts",type:"audio"};i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ei(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream);e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Ni(this,i)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new gi.MetadataStream;i.packetStream=new gi.TransportPacketStream;i.parseStream=new gi.TransportParseStream;i.elementaryStream=new gi.ElementaryStream;i.timestampRolloverStream=new gi.TimestampRolloverStream;i.adtsStream=new yi;i.h264Stream=new ji;i.captionStream=new gi.CaptionStream(t);i.coalesceStream=new Di(t,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",(function(r){var o;if(r.type==="metadata"){o=r.tracks.length;while(o--){if(!s&&r.tracks[o].type==="video"){s=r.tracks[o];s.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}else if(!n&&r.tracks[o].type==="audio"){n=r.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}}if(s&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new Ai(s,t);i.videoSegmentStream.on("log",e.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",(function(s){if(n&&!t.keepOriginalTimestamps){n.timelineStartInfo=s;i.audioSegmentStream.setEarliestDts(s.dts-e.baseMediaDecodeTime)}}));i.videoSegmentStream.on("processedGopsInfo",e.trigger.bind(e,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",(function(t){if(n){i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}}));i.videoSegmentStream.on("timingInfo",e.trigger.bind(e,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(n&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ei(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",(function(t){t.dispatchType=i.metadataStream.dispatchType;e.trigger("id3Frame",t)}));i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Ni(this,i)};this.setBaseMediaDecodeTime=function(e){var i=this.transmuxPipeline_;if(!t.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(n){n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;mi.clearDtsInfo(n);if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(s){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[]}s.timelineStartInfo.dts=undefined;s.timelineStartInfo.pts=undefined;mi.clearDtsInfo(s);i.captionStream.reset()}if(i.timestampRolloverStream){i.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(t){if(n){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)}};this.setRemux=function(e){var i=this.transmuxPipeline_;t.remux=e;if(i&&i.coalesceStream){i.coalesceStream.setRemux(e)}};this.alignGopsWith=function(t){if(s&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)}};this.getLogTrigger_=function(t){var e=this;return function(i){i.stream=t;e.trigger("log",i)}};this.push=function(t){if(i){var e=Ti(t);if(e&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!e&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(t)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Ii.prototype=new fi;var Mi={Transmuxer:Ii,VideoSegmentStream:Ai,AudioSegmentStream:Ei,AUDIO_PROPERTIES:Si,VIDEO_PROPERTIES:xi,generateSegmentTimingInfo:Oi};var Ri=function(t){return t>>>0};var Li=function(t){return("00"+t.toString(16)).slice(-2)};var Pi={toUnsigned:Ri,toHexString:Li};var $i=function(t){var e="";e+=String.fromCharCode(t[0]);e+=String.fromCharCode(t[1]);e+=String.fromCharCode(t[2]);e+=String.fromCharCode(t[3]);return e};var Fi=$i;var Ui=Pi.toUnsigned;var Bi=Fi;var qi=function(t,e){var i=[],s,n,r,o,a;if(!e.length){return null}for(s=0;s<t.byteLength;){n=Ui(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]);r=Bi(t.subarray(s+4,s+8));o=n>1?s+n:t.byteLength;if(r===e[0]){if(e.length===1){i.push(t.subarray(s+8,o))}else{a=qi(t.subarray(s+8,o),e.slice(1));if(a.length){i=i.concat(a)}}}s=o}return i};var Vi=qi;var zi=Pi.toUnsigned;var Hi=r.getUint64;var Xi=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4))};if(e.version===1){e.baseMediaDecodeTime=Hi(t.subarray(4))}else{e.baseMediaDecodeTime=zi(t[4]<<24|t[5]<<16|t[6]<<8|t[7])}return e};var Gi=Xi;var Yi=function(t){return{isLeading:(t[0]&12)>>>2,dependsOn:t[0]&3,isDependedOn:(t[1]&192)>>>6,hasRedundancy:(t[1]&48)>>>4,paddingValue:(t[1]&14)>>>1,isNonSyncSample:t[1]&1,degradationPriority:t[2]<<8|t[3]}};var Wi=Yi;var Ji=Wi;var Ki=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},i=new DataView(t.buffer,t.byteOffset,t.byteLength),s=e.flags[2]&1,n=e.flags[2]&4,r=e.flags[1]&1,o=e.flags[1]&2,a=e.flags[1]&4,h=e.flags[1]&8,c=i.getUint32(4),l=8,u;if(s){e.dataOffset=i.getInt32(l);l+=4}if(n&&c){u={flags:Ji(t.subarray(l,l+4))};l+=4;if(r){u.duration=i.getUint32(l);l+=4}if(o){u.size=i.getUint32(l);l+=4}if(h){if(e.version===1){u.compositionTimeOffset=i.getInt32(l)}else{u.compositionTimeOffset=i.getUint32(l)}l+=4}e.samples.push(u);c--}while(c--){u={};if(r){u.duration=i.getUint32(l);l+=4}if(o){u.size=i.getUint32(l);l+=4}if(a){u.flags=Ji(t.subarray(l,l+4));l+=4}if(h){if(e.version===1){u.compositionTimeOffset=i.getInt32(l)}else{u.compositionTimeOffset=i.getUint32(l)}l+=4}e.samples.push(u)}return e};var Qi=Ki;var Zi=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,o=i.flags[2]&16,a=i.flags[2]&32,h=i.flags[0]&65536,c=i.flags[0]&131072,l;l=8;if(s){l+=4;i.baseDataOffset=e.getUint32(12);l+=4}if(n){i.sampleDescriptionIndex=e.getUint32(l);l+=4}if(r){i.defaultSampleDuration=e.getUint32(l);l+=4}if(o){i.defaultSampleSize=e.getUint32(l);l+=4}if(a){i.defaultSampleFlags=e.getUint32(l)}if(h){i.durationIsEmpty=true}if(!s&&c){i.baseDataOffsetIsMoof=true}return i};var ts=Zi;var es;if(typeof window!=="undefined"){es=window}else if(typeof t!=="undefined"){es=t}else if(typeof self!=="undefined"){es=self}else{es={}}var is=es;var ss=Mt.discardEmulationPreventionBytes;var ns=Jt.CaptionStream;var rs=Vi;var os=Gi;var as=Qi;var hs=ts;var cs=is;var ls=function(t,e){var i=t;for(var s=0;s<e.length;s++){var n=e[s];if(i<n.size){return n}i-=n.size}return null};var us=function(t,e,i){var s=new DataView(t.buffer,t.byteOffset,t.byteLength),n={logs:[],seiNals:[]},r,o,a,h;for(o=0;o+4<t.length;o+=a){a=s.getUint32(o);o+=4;if(a<=0){continue}switch(t[o]&31){case 6:var c=t.subarray(o+1,o+1+a);var l=ls(o,e);r={nalUnitType:"sei_rbsp",size:a,data:c,escapedRBSP:ss(c),trackId:i};if(l){r.pts=l.pts;r.dts=l.dts;h=l}else if(h){r.pts=h.pts;r.dts=h.dts}else{n.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break}n.seiNals.push(r);break}}return n};var fs=function(t,e,i){var s=e;var n=i.defaultSampleDuration||0;var r=i.defaultSampleSize||0;var o=i.trackId;var a=[];t.forEach((function(t){var e=as(t);var i=e.samples;i.forEach((function(t){if(t.duration===undefined){t.duration=n}if(t.size===undefined){t.size=r}t.trackId=o;t.dts=s;if(t.compositionTimeOffset===undefined){t.compositionTimeOffset=0}if(typeof s==="bigint"){t.pts=s+cs.BigInt(t.compositionTimeOffset);s+=cs.BigInt(t.duration)}else{t.pts=s+t.compositionTimeOffset;s+=t.duration}}));a=a.concat(i)}));return a};var ds=function(t,e){var i=rs(t,["moof","traf"]);var s=rs(t,["mdat"]);var n={};var r=[];s.forEach((function(t,e){var s=i[e];r.push({mdat:t,traf:s})}));r.forEach((function(t){var i=t.mdat;var s=t.traf;var r=rs(s,["tfhd"]);var o=hs(r[0]);var a=o.trackId;var h=rs(s,["tfdt"]);var c=h.length>0?os(h[0]).baseMediaDecodeTime:0;var l=rs(s,["trun"]);var u;var f;if(e===a&&l.length>0){u=fs(l,c,o);f=us(i,u,a);if(!n[a]){n[a]={seiNals:[],logs:[]}}n[a].seiNals=n[a].seiNals.concat(f.seiNals);n[a].logs=n[a].logs.concat(f.logs)}}));return n};var ps=function(t,e,i){var s;if(e===null){return null}s=ds(t,e);var n=s[e]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var vs=function(){var t=false;var e;var i;var s;var n;var r;var o;this.isInitialized=function(){return t};this.init=function(i){e=new ns;t=true;o=i?i.isPartial:false;e.on("data",(function(t){t.startTime=t.startPts/n;t.endTime=t.endPts/n;r.captions.push(t);r.captionStreams[t.stream]=true}));e.on("log",(function(t){r.logs.push(t)}))};this.isNewInit=function(t,e){if(t&&t.length===0||e&&typeof e==="object"&&Object.keys(e).length===0){return false}return s!==t[0]||n!==e[s]};this.parse=function(t,e,o){var a;if(!this.isInitialized()){return null}else if(!e||!o){return null}else if(this.isNewInit(e,o)){s=e[0];n=o[s]}else if(s===null||!n){i.push(t);return null}while(i.length>0){var h=i.shift();this.parse(h,e,o)}a=ps(t,s,n);if(a&&a.logs){r.logs=r.logs.concat(a.logs)}if(a===null||!a.seiNals){if(r.logs.length){return{logs:r.logs,captions:[],captionStreams:[]}}return null}this.pushNals(a.seiNals);this.flushStream();return r};this.pushNals=function(t){if(!this.isInitialized()||!t||t.length===0){return null}t.forEach((function(t){e.push(t)}))};this.flushStream=function(){if(!this.isInitialized()){return null}if(!o){e.flush()}else{e.partialFlush()}};this.clearParsedCaptions=function(){r.captions=[];r.captionStreams={};r.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}e.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){i=[];s=null;n=null;if(!r){r={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var ms=vs;var gs=function(t){var e=0;var i=String.fromCharCode(t[e]);var s="";while(i!=="\0"){s+=i;e++;i=String.fromCharCode(t[e])}s+=i;return s};var bs={uint8ToCString:gs};var ys=bs.uint8ToCString;var js=r.getUint64;var ws=function(t){var e=4;var i=t[0];var s,n,r,o,a,h,c,l;if(i===0){s=ys(t.subarray(e));e+=s.length;n=ys(t.subarray(e));e+=n.length;var u=new DataView(t.buffer);r=u.getUint32(e);e+=4;a=u.getUint32(e);e+=4;h=u.getUint32(e);e+=4;c=u.getUint32(e);e+=4}else if(i===1){var u=new DataView(t.buffer);r=u.getUint32(e);e+=4;o=js(t.subarray(e));e+=8;h=u.getUint32(e);e+=4;c=u.getUint32(e);e+=4;s=ys(t.subarray(e));e+=s.length;n=ys(t.subarray(e));e+=n.length}l=new Uint8Array(t.subarray(e,t.byteLength));var f={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:o,presentation_time_delta:a,event_duration:h,id:c,message_data:l};return ks(i,f)?f:undefined};var Ts=function(t,e,i,s){return t||t===0?t/e:s+i/e};var ks=function(t,e){var i=e.scheme_id_uri!=="\0";var s=t===0&&Ss(e.presentation_time_delta)&&i;var n=t===1&&Ss(e.presentation_time)&&i;return!(t>1)&&s||n};var Ss=function(t){return t!==undefined||t!==null};var xs={parseEmsgBox:ws,scaleTime:Ts};var As=Pi.toUnsigned;var Es=Pi.toHexString;var Is=Vi;var Ds=Fi;var Cs=xs;var Ns=ts;var _s=Qi;var Os=Gi;var Ms=r.getUint64;var Rs,Ls,Ps,$s,Fs,Us,Bs;var qs=is;var Vs=ve.parseId3Frames;Rs=function(t){var e={},i=Is(t,["moov","trak"]);return i.reduce((function(t,e){var i,s,n,r,o;i=Is(e,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=As(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);o=Is(e,["mdia","mdhd"])[0];if(!o){return null}s=o[0];n=s===0?12:20;t[r]=As(o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3]);return t}),e)};Ls=function(t,e){var i;i=Is(e,["moof","traf"]);var s=i.reduce((function(e,i){var s=Is(i,["tfhd"])[0];var n=As(s[4]<<24|s[5]<<16|s[6]<<8|s[7]);var r=t[n]||9e4;var o=Is(i,["tfdt"])[0];var a=new DataView(o.buffer,o.byteOffset,o.byteLength);var h;if(o[0]===1){h=Ms(o.subarray(4,12))}else{h=a.getUint32(4)}let c;if(typeof h==="bigint"){c=h/qs.BigInt(r)}else if(typeof h==="number"&&!isNaN(h)){c=h/r}if(c<Number.MAX_SAFE_INTEGER){c=Number(c)}if(c<e){e=c}return e}),Infinity);return typeof s==="bigint"||isFinite(s)?s:0};Ps=function(t,e){var i=Is(e,["moof","traf"]);var s=0;var n=0;var r;if(i&&i.length){var o=Is(i[0],["tfhd"])[0];var a=Is(i[0],["trun"])[0];var h=Is(i[0],["tfdt"])[0];if(o){var c=Ns(o);r=c.trackId}if(h){var l=Os(h);s=l.baseMediaDecodeTime}if(a){var u=_s(a);if(u.samples&&u.samples.length){n=u.samples[0].compositionTimeOffset||0}}}var f=t[r]||9e4;if(typeof s==="bigint"){n=qs.BigInt(n);f=qs.BigInt(f)}var d=(s+n)/f;if(typeof d==="bigint"&&d<Number.MAX_SAFE_INTEGER){d=Number(d)}return d};$s=function(t){var e=Is(t,["moov","trak"]);var i=[];e.forEach((function(t){var e=Is(t,["mdia","hdlr"]);var s=Is(t,["tkhd"]);e.forEach((function(t,e){var n=Ds(t.subarray(8,12));var r=s[e];var o;var a;var h;if(n==="vide"){o=new DataView(r.buffer,r.byteOffset,r.byteLength);a=o.getUint8(0);h=a===0?o.getUint32(12):o.getUint32(20);i.push(h)}}))}));return i};Us=function(t){var e=t[0];var i=e===0?12:20;return As(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])};Fs=function(t){var e=Is(t,["moov","trak"]);var i=[];e.forEach((function(t){var e={};var s=Is(t,["tkhd"])[0];var n,r;if(s){n=new DataView(s.buffer,s.byteOffset,s.byteLength);r=n.getUint8(0);e.id=r===0?n.getUint32(12):n.getUint32(20)}var o=Is(t,["mdia","hdlr"])[0];if(o){var a=Ds(o.subarray(8,12));if(a==="vide"){e.type="video"}else if(a==="soun"){e.type="audio"}else{e.type=a}}var h=Is(t,["mdia","minf","stbl","stsd"])[0];if(h){var c=h.subarray(8);e.codec=Ds(c.subarray(4,8));var l=Is(c,[e.codec])[0];var u,f;if(l){if(/^[asm]vc[1-9]$/i.test(e.codec)){u=l.subarray(78);f=Ds(u.subarray(4,8));if(f==="avcC"&&u.length>11){e.codec+=".";e.codec+=Es(u[9]);e.codec+=Es(u[10]);e.codec+=Es(u[11])}else{e.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(e.codec)){u=l.subarray(28);f=Ds(u.subarray(4,8));if(f==="esds"&&u.length>20&&u[19]!==0){e.codec+="."+Es(u[19]);e.codec+="."+Es(u[20]>>>2&63).replace(/^0/,"")}else{e.codec="mp4a.40.2"}}else{e.codec=e.codec.toLowerCase()}}}var d=Is(t,["mdia","mdhd"])[0];if(d){e.timescale=Us(d)}i.push(e)}));return i};Bs=function(t,e=0){var i=Is(t,["emsg"]);return i.map((t=>{var i=Cs.parseEmsgBox(new Uint8Array(t));var s=Vs(i.message_data);return{cueTime:Cs.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,e),duration:Cs.scaleTime(i.event_duration,i.timescale),frames:s}}))};var zs={findBox:Is,parseType:Ds,timescale:Rs,startTime:Ls,compositionStartTime:Ps,videoTrackIds:$s,tracks:Fs,getTimescaleFromMediaHeader:Us,getEmsgID3:Bs};var Hs=Kt;var Xs=function(t){var e=t[1]&31;e<<=8;e|=t[2];return e};var Gs=function(t){return!!(t[1]&64)};var Ys=function(t){var e=0;if((t[3]&48)>>>4>1){e+=t[4]+1}return e};var Ws=function(t,e){var i=Xs(t);if(i===0){return"pat"}else if(i===e){return"pmt"}else if(e){return"pes"}return null};var Js=function(t){var e=Gs(t);var i=4+Ys(t);if(e){i+=t[i]+1}return(t[i+10]&31)<<8|t[i+11]};var Ks=function(t){var e={};var i=Gs(t);var s=4+Ys(t);if(i){s+=t[s]+1}if(!(t[s+5]&1)){return}var n,r,o;n=(t[s+1]&15)<<8|t[s+2];r=3+n-4;o=(t[s+10]&15)<<8|t[s+11];var a=12+o;while(a<r){var h=s+a;e[(t[h+1]&31)<<8|t[h+2]]=t[h];a+=((t[h+3]&15)<<8|t[h+4])+5}return e};var Qs=function(t,e){var i=Xs(t);var s=e[i];switch(s){case Hs.H264_STREAM_TYPE:return"video";case Hs.ADTS_STREAM_TYPE:return"audio";case Hs.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var Zs=function(t){var e=Gs(t);if(!e){return null}var i=4+Ys(t);if(i>=t.byteLength){return null}var s=null;var n;n=t[i+7];if(n&192){s={};s.pts=(t[i+9]&14)<<27|(t[i+10]&255)<<20|(t[i+11]&254)<<12|(t[i+12]&255)<<5|(t[i+13]&254)>>>3;s.pts*=4;s.pts+=(t[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(t[i+14]&14)<<27|(t[i+15]&255)<<20|(t[i+16]&254)<<12|(t[i+17]&255)<<5|(t[i+18]&254)>>>3;s.dts*=4;s.dts+=(t[i+18]&6)>>>1}}return s};var tn=function(t){switch(t){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}};var en=function(t){var e=4+Ys(t);var i=t.subarray(e);var s=0;var n=0;var r=false;var o;for(;n<i.byteLength-3;n++){if(i[n+2]===1){s=n+5;break}}while(s<i.byteLength){switch(i[s]){case 0:if(i[s-1]!==0){s+=2;break}else if(i[s-2]!==0){s++;break}if(n+3!==s-2){o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}}do{s++}while(i[s]!==1&&s<i.length);n=s-2;s+=3;break;case 1:if(i[s-1]!==0||i[s-2]!==0){s+=3;break}o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}n=s-2;s+=3;break;default:s+=3;break}}i=i.subarray(n);s-=n;n=0;if(i&&i.byteLength>3){o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var sn={parseType:Ws,parsePat:Js,parsePmt:Ks,parsePayloadUnitStartIndicator:Gs,parsePesType:Qs,parsePesTime:Zs,videoPacketContainsKeyFrame:en};var nn=Kt;var rn=ne.handleRollover;var on={};on.ts=sn;on.aac=si;var an=pt.ONE_SECOND_IN_TS;var hn=188,cn=71;var ln=function(t,e){var i=0,s=hn,n,r;while(s<t.byteLength){if(t[i]===cn&&t[s]===cn){n=t.subarray(i,s);r=on.ts.parseType(n,e.pid);switch(r){case"pat":e.pid=on.ts.parsePat(n);break;case"pmt":var o=on.ts.parsePmt(n);e.table=e.table||{};Object.keys(o).forEach((function(t){e.table[t]=o[t]}));break}i+=hn;s+=hn;continue}i++;s++}};var un=function(t,e,i){var s=0,n=hn,r,o,a,h,c;var l=false;while(n<=t.byteLength){if(t[s]===cn&&(t[n]===cn||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){c=on.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);l=true}}break}if(l){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;l=false;while(s>=0){if(t[s]===cn&&(t[n]===cn||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){c=on.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);l=true}}break}if(l){break}s-=hn;n-=hn;continue}s--;n--}};var fn=function(t,e,i){var s=0,n=hn,r,o,a,h,c,l,u,f;var d=false;var p={data:[],size:0};while(n<t.byteLength){if(t[s]===cn&&t[n]===cn){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"){if(h&&!d){c=on.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);d=true}}if(!i.firstKeyFrame){if(h){if(p.size!==0){l=new Uint8Array(p.size);u=0;while(p.data.length){f=p.data.shift();l.set(f,u);u+=f.byteLength}if(on.ts.videoPacketContainsKeyFrame(l)){var v=on.ts.parsePesTime(l);if(v){i.firstKeyFrame=v;i.firstKeyFrame.type="video"}else{console.warn("Failed to extract PTS/DTS from PES at first keyframe. "+"This could be an unusual TS segment, or else mux.js did not "+"parse your TS segment correctly. If you know your TS "+"segments do contain PTS/DTS on keyframes please file a bug "+"report! You can try ffprobe to double check for yourself.")}}p.size=0}}p.data.push(r);p.size+=r.byteLength}}break}if(d&&i.firstKeyFrame){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;d=false;while(s>=0){if(t[s]===cn&&t[n]===cn){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"&&h){c=on.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);d=true}}break}if(d){break}s-=hn;n-=hn;continue}s--;n--}};var dn=function(t,e){if(t.audio&&t.audio.length){var i=e;if(typeof i==="undefined"||isNaN(i)){i=t.audio[0].dts}t.audio.forEach((function(t){t.dts=rn(t.dts,i);t.pts=rn(t.pts,i);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}))}if(t.video&&t.video.length){var s=e;if(typeof s==="undefined"||isNaN(s)){s=t.video[0].dts}t.video.forEach((function(t){t.dts=rn(t.dts,s);t.pts=rn(t.pts,s);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}));if(t.firstKeyFrame){var n=t.firstKeyFrame;n.dts=rn(n.dts,s);n.pts=rn(n.pts,s);n.dtsTime=n.dts/an;n.ptsTime=n.pts/an}}};var pn=function(t){var e=false,i=0,s=null,n=null,r=0,o=0,a;while(t.length-o>=3){var h=on.aac.parseType(t,o);switch(h){case"timed-metadata":if(t.length-o<10){e=true;break}r=on.aac.parseId3TagSize(t,o);if(r>t.length){e=true;break}if(n===null){a=t.subarray(o,o+r);n=on.aac.parseAacTimestamp(a)}o+=r;break;case"audio":if(t.length-o<7){e=true;break}r=on.aac.parseAdtsSize(t,o);if(r>t.length){e=true;break}if(s===null){a=t.subarray(o,o+r);s=on.aac.parseSampleRate(a)}i++;o+=r;break;default:o++;break}if(e){return null}}if(s===null||n===null){return null}var c=an/s;var l={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*c,pts:n+i*1024*c}]};return l};var vn=function(t){var e={pid:null,table:null};var i={};ln(t,e);for(var s in e.table){if(e.table.hasOwnProperty(s)){var n=e.table[s];switch(n){case nn.H264_STREAM_TYPE:i.video=[];fn(t,e,i);if(i.video.length===0){delete i.video}break;case nn.ADTS_STREAM_TYPE:i.audio=[];un(t,e,i);if(i.audio.length===0){delete i.audio}break}}}return i};var mn=function(t,e){var i=on.aac.isLikelyAacData(t);var s;if(i){s=pn(t)}else{s=vn(t)}if(!s||!s.audio&&!s.video){return null}dn(s,e);return s};var gn={inspect:mn,parseAudioPes_:un};const bn=function(t,e){e.on("data",(function(e){const i=e.initSegment;e.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=e.data;e.data=s.buffer;t.postMessage({action:"data",segment:e,byteOffset:s.byteOffset,byteLength:s.byteLength},[e.data])}));e.on("done",(function(e){t.postMessage({action:"done"})}));e.on("gopInfo",(function(e){t.postMessage({action:"gopInfo",gopInfo:e})}));e.on("videoSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}));e.on("audioSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}));e.on("id3Frame",(function(e){t.postMessage({action:"id3Frame",id3Frame:e})}));e.on("caption",(function(e){t.postMessage({action:"caption",caption:e})}));e.on("trackinfo",(function(e){t.postMessage({action:"trackinfo",trackInfo:e})}));e.on("audioTimingInfo",(function(e){t.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("videoTimingInfo",(function(e){t.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("log",(function(e){t.postMessage({action:"log",log:e})}))};class yn{constructor(t,e){this.options=e||{};this.self=t;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Mi.Transmuxer(this.options);bn(this.self,this.transmuxer)}pushMp4Captions(t){if(!this.captionParser){this.captionParser=new ms;this.captionParser.init()}const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);const i=this.captionParser.parse(e,t.trackIds,t.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:e.buffer},[e.buffer])}probeMp4StartTime({timescales:t,data:e}){const i=zs.startTime(t,e);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:e},[e.buffer])}probeMp4Tracks({data:t}){const e=zs.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])}probeEmsgID3({data:t,offset:e}){const i=zs.getEmsgID3(t,e);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:t},[t.buffer])}probeTs({data:t,baseStartTime:e}){const i=typeof e==="number"&&!isNaN(e)?e*pt.ONE_SECOND_IN_TS:void 0;const s=gn.inspect(t,i);let n=null;if(s){n={hasVideo:s.video&&s.video.length===2||false,hasAudio:s.audio&&s.audio.length===2||false};if(n.hasVideo){n.videoStart=s.video[0].ptsTime}if(n.hasAudio){n.audioStart=s.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:n,data:t},[t.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(t){const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(e)}reset(){this.transmuxer.reset()}setTimestampOffset(t){const e=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pt.secondsToVideoTs(e)))}setAudioAppendStart(t){this.transmuxer.setAudioAppendStart(Math.ceil(pt.secondsToVideoTs(t.appendStart)))}setRemux(t){this.transmuxer.setRemux(t.remux)}flush(t){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}self.onmessage=function(t){if(t.data.action==="init"&&t.data.options){this.messageHandlers=new yn(self,t.data.options);return}if(!this.messageHandlers){this.messageHandlers=new yn(self)}if(t.data&&t.data.action&&t.data.action!=="init"){if(this.messageHandlers[t.data.action]){this.messageHandlers[t.data.action](t.data)}}}})));var jv=mv(yv);const wv=(t,e,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:o,metadata:a,videoFrameDtsTime:h,videoFramePtsTime:c}=t.data.segment;e.buffer.push({captions:r,captionStreams:o,metadata:a});const l=t.data.segment.boxes||{data:t.data.segment.data};const u={type:s,data:new Uint8Array(l.data,l.data.byteOffset,l.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof h!=="undefined"){u.videoFrameDtsTime=h}if(typeof c!=="undefined"){u.videoFramePtsTime=c}i(u)};const Tv=({transmuxedData:t,callback:e})=>{t.buffer=[];e(t)};const kv=(t,e)=>{e.gopInfo=t.data.gopInfo};const Sv=t=>{const{transmuxer:e,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:a,onAudioTimingInfo:h,onVideoTimingInfo:c,onVideoSegmentTimingInfo:l,onAudioSegmentTimingInfo:u,onId3:f,onCaptions:d,onDone:p,onEndedTimeline:v,onTransmuxerLog:m,isEndOfTimeline:g,segment:b,triggerSegmentEventFn:y}=t;const j={buffer:[]};let w=g;const T=i=>{if(e.currentTransmux!==t){return}if(i.data.action==="data"){wv(i,j,o)}if(i.data.action==="trackinfo"){a(i.data.trackInfo)}if(i.data.action==="gopInfo"){kv(i,j)}if(i.data.action==="audioTimingInfo"){h(i.data.audioTimingInfo)}if(i.data.action==="videoTimingInfo"){c(i.data.videoTimingInfo)}if(i.data.action==="videoSegmentTimingInfo"){l(i.data.videoSegmentTimingInfo)}if(i.data.action==="audioSegmentTimingInfo"){u(i.data.audioSegmentTimingInfo)}if(i.data.action==="id3Frame"){f([i.data.id3Frame],i.data.id3Frame.dispatchType)}if(i.data.action==="caption"){d(i.data.caption)}if(i.data.action==="endedtimeline"){w=false;v()}if(i.data.action==="log"){m(i.data.log)}if(i.data.type!=="transmuxed"){return}if(w){return}e.onmessage=null;Tv({transmuxedData:j,callback:p});xv(e)};const k=()=>{const t={message:"Received an error message from the transmuxer worker",metadata:{errorType:cd.Error.StreamingFailedToTransmuxSegment,segmentInfo:Gm({segment:b})}};p(null,t)};e.onmessage=T;e.onerror=k;if(s){e.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){e.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){e.postMessage({action:"setRemux",remux:r})}if(i.byteLength){const t=i instanceof ArrayBuffer?i:i.buffer;const s=i instanceof ArrayBuffer?0:i.byteOffset;y({type:"segmenttransmuxingstart",segment:b});e.postMessage({action:"push",data:t,byteOffset:s,byteLength:i.byteLength},[t])}if(g){e.postMessage({action:"endTimeline"})}e.postMessage({action:"flush"})};const xv=t=>{t.currentTransmux=null;if(t.transmuxQueue.length){t.currentTransmux=t.transmuxQueue.shift();if(typeof t.currentTransmux==="function"){t.currentTransmux()}else{Sv(t.currentTransmux)}}};const Av=(t,e)=>{t.postMessage({action:e});xv(t)};const Ev=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t;Av(e,t);return}e.transmuxQueue.push(Av.bind(null,e,t))};const Iv=t=>{Ev("reset",t)};const Dv=t=>{Ev("endTimeline",t)};const Cv=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t;Sv(t);return}t.transmuxer.transmuxQueue.push(t)};const Nv=t=>{const e=new jv;e.currentTransmux=null;e.transmuxQueue=[];const i=e.terminate;e.terminate=()=>{e.currentTransmux=null;e.transmuxQueue.length=0;return i.call(e)};e.postMessage({action:"init",options:t});return e};var _v={reset:Iv,endTimeline:Dv,transmux:Cv,createTransmuxer:Nv};const Ov=function(t){const e=t.transmuxer;const i=t.endAction||t.action;const s=t.callback;const n=it({},t,{endAction:null,transmuxer:null,callback:null});const r=n=>{if(n.data.action!==i){return}e.removeEventListener("message",r);if(n.data.data){n.data.data=new Uint8Array(n.data.data,t.byteOffset||0,t.byteLength||n.data.data.byteLength);if(t.data){t.data=n.data.data}}s(n.data)};e.addEventListener("message",r);if(t.data){const i=t.data instanceof ArrayBuffer;n.byteOffset=i?0:t.data.byteOffset;n.byteLength=t.data.byteLength;const s=[i?t.data:t.data.buffer];e.postMessage(n,s)}else{e.postMessage(n)}};const Mv={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const Rv=t=>{t.forEach((t=>{t.abort()}))};const Lv=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0});const Pv=t=>{const e=t.target;const i=Date.now()-e.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=t.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const $v=(t,e)=>{const{requestType:i}=e;const s=gp({requestType:i,request:e,error:t});if(e.timedout){return{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Mv.TIMEOUT,xhr:e,metadata:s}}if(e.aborted){return{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Mv.ABORTED,xhr:e,metadata:s}}if(t){return{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Mv.FAILURE,xhr:e,metadata:s}}if(e.responseType==="arraybuffer"&&e.response.byteLength===0){return{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Mv.FAILURE,xhr:e,metadata:s}}return null};const Fv=(t,e,i,s)=>(n,r)=>{const o=r.response;const a=$v(n,r);if(a){return i(a,t)}if(o.byteLength!==16){return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Mv.FAILURE,xhr:r},t)}const h=new DataView(o);const c=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let t=0;t<e.length;t++){e[t].bytes=c}const l={uri:r.uri};s({type:"segmentkeyloadcomplete",segment:t,keyInfo:l});return i(null,t)};const Uv=(t,e)=>{const i=Uo(t.map.bytes);if(i!=="mp4"){const s=t.map.resolvedUri||t.map.uri;const n=i||"unknown";return e({internal:true,message:`Found unsupported ${n} container for initialization segment at URL: ${s}`,code:Mv.FAILURE,metadata:{mediaType:n}})}Ov({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:i,data:s})=>{t.map.bytes=s;i.forEach((function(e){t.map.tracks=t.map.tracks||{};if(t.map.tracks[e.type]){return}t.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){t.map.timescales=t.map.timescales||{};t.map.timescales[e.id]=e.timescale}}));return e(null)}})};const Bv=({segment:t,finishProcessingFn:e,triggerSegmentEventFn:i})=>(s,n)=>{const r=$v(s,n);if(r){return e(r,t)}const o=new Uint8Array(n.response);i({type:"segmentloaded",segment:t});if(t.map.key){t.map.encryptedBytes=o;return e(null,t)}t.map.bytes=o;Uv(t,(function(i){if(i){i.xhr=n;i.status=n.status;return e(i,t)}e(null,t)}))};const qv=({segment:t,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:s})=>(n,r)=>{const o=$v(n,r);if(o){return e(o,t)}s({type:"segmentloaded",segment:t});const a=i==="arraybuffer"||!r.responseText?r.response:dv(r.responseText.substring(t.lastReachedChar||0));t.stats=Lv(r);if(t.key){t.encryptedBytes=new Uint8Array(a)}else{t.bytes=new Uint8Array(a)}return e(null,t)};const Vv=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{const p=t.map&&t.map.tracks||{};const v=Boolean(p.audio&&p.video);let m=s.bind(null,t,"audio","start");const g=s.bind(null,t,"audio","end");let b=s.bind(null,t,"video","start");const y=s.bind(null,t,"video","end");const j=()=>Cv({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:v,onData:e=>{e.type=e.type==="combined"?"video":e.type;l(t,e)},onTrackInfo:e=>{if(i){if(v){e.isMuxed=true}i(t,e)}},onAudioTimingInfo:t=>{if(m&&typeof t.start!=="undefined"){m(t.start);m=null}if(g&&typeof t.end!=="undefined"){g(t.end)}},onVideoTimingInfo:t=>{if(b&&typeof t.start!=="undefined"){b(t.start);b=null}if(y&&typeof t.end!=="undefined"){y(t.end)}},onVideoSegmentTimingInfo:e=>{const i={pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}};d({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:i});n(e)},onAudioSegmentTimingInfo:e=>{const i={pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}};d({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:i});r(e)},onId3:(e,i)=>{o(t,e,i)},onCaptions:e=>{a(t,[e])},isEndOfTimeline:h,onEndedTimeline:()=>{c()},onTransmuxerLog:f,onDone:(e,i)=>{if(!u){return}e.type=e.type==="combined"?"video":e.type;d({type:"segmenttransmuxingcomplete",segment:t});u(i,t,e)},segment:t,triggerSegmentEventFn:d});Ov({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:s=>{t.bytes=e=s.data;const n=s.result;if(n){i(t,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:v});i=null}j()}})};const zv=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{let p=new Uint8Array(e);if(Bo(p)){t.isFmp4=true;const{tracks:n}=t.map;const r={isFmp4:true,hasVideo:!!n.video,hasAudio:!!n.audio};if(n.audio&&n.audio.codec&&n.audio.codec!=="enca"){r.audioCodec=n.audio.codec}if(n.video&&n.video.codec&&n.video.codec!=="encv"){r.videoCodec=n.video.codec}if(n.video&&n.audio){r.isMuxed=true}i(t,r);const h=(e,i)=>{l(t,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"});if(i&&i.length){o(t,i)}if(e&&e.length){a(t,e)}u(null,t,{})};Ov({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:({data:i,startTime:o})=>{e=i.buffer;t.bytes=p=i;if(r.hasAudio&&!r.isMuxed){s(t,"audio","start",o)}if(r.hasVideo){s(t,"video","start",o)}Ov({action:"probeEmsgID3",data:p,transmuxer:t.transmuxer,offset:o,callback:({emsgData:i,id3Frames:s})=>{e=i.buffer;t.bytes=p=i;if(!n.video||!i.byteLength||!t.transmuxer){h(undefined,s);return}Ov({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[n.video.id],callback:i=>{e=i.data.buffer;t.bytes=p=i.data;i.logs.forEach((function(t){f(bd(t,{stream:"mp4CaptionParser"}))}));h(i.captions,s)}})}})}});return}if(!t.transmuxer){u(null,t,{});return}if(typeof t.container==="undefined"){t.container=Uo(p)}if(t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:false,hasVideo:false});u(null,t,{});return}Vv({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})};const Hv=function({id:t,key:e,encryptedBytes:i,decryptionWorker:s,segment:n,doneFn:r},o){const a=e=>{if(e.data.source===t){s.removeEventListener("message",a);const t=e.data.decrypted;o(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};s.onerror=()=>{const t="An error occurred in the decryption worker";const e=Gm({segment:n});const i={message:t,metadata:{error:new Error(t),errorType:cd.Error.StreamingFailedToDecryptSegment,segmentInfo:e,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};r(i,n)};s.addEventListener("message",a);let h;if(e.bytes.slice){h=e.bytes.slice()}else{h=new Uint32Array(Array.prototype.slice.call(e.bytes))}s.postMessage($p({source:t,encrypted:i,key:h,iv:e.iv}),[i.buffer,h.buffer])};const Xv=({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{d({type:"segmentdecryptionstart"});Hv({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:u},(t=>{e.bytes=t;d({type:"segmentdecryptioncomplete",segment:e});zv({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})}))};const Gv=({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{let p=0;let v=false;return(m,g)=>{if(v){return}if(m){v=true;Rv(t);return u(m,g)}p+=1;if(p===t.length){const p=function(){if(g.encryptedBytes){return Xv({decryptionWorker:e,segment:g,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})}zv({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})};g.endOfAllRequests=Date.now();if(g.map&&g.map.encryptedBytes&&!g.map.bytes){d({type:"segmentdecryptionstart",segment:g});return Hv({decryptionWorker:e,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key,segment:g,doneFn:u},(e=>{g.map.bytes=e;d({type:"segmentdecryptioncomplete",segment:g});Uv(g,(e=>{if(e){Rv(t);return u(e,g)}p()}))}))}p()}}};const Yv=({loadendState:t,abortFn:e})=>i=>{const s=i.target;if(s.aborted&&e&&!t.calledAbortFn){e();t.calledAbortFn=true}};const Wv=({segment:t,progressFn:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l})=>i=>{const s=i.target;if(s.aborted){return}t.stats=bd(t.stats,Pv(i));if(!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived){t.stats.firstBytesReceivedAt=Date.now()}return e(i,t)};const Jv=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g})=>{const b=[];const y=Gv({activeXhrs:b,decryptionWorker:i,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g});if(s.key&&!s.key.bytes){const i=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){i.push(s.map.key)}const n=bd(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const r=Fv(s,i,y,g);const o={uri:s.key.resolvedUri};g({type:"segmentkeyloadstart",segment:s,keyInfo:o});const a=t(n,r);b.push(a)}if(s.map&&!s.map.bytes){const i=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(i){const i=bd(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const n=Fv(s,[s.map.key],y,g);const r={uri:s.map.key.resolvedUri};g({type:"segmentkeyloadstart",segment:s,keyInfo:r});const o=t(i,n);b.push(o)}const n=bd(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Mp(s.map),requestType:"segment-media-initialization"});const r=Bv({segment:s,finishProcessingFn:y,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const o=t(n,r);b.push(o)}const j=bd(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Mp(s),requestType:"segment"});const w=qv({segment:s,finishProcessingFn:y,responseType:j.responseType,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const T=t(j,w);T.addEventListener("progress",Wv({segment:s,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p}));b.push(T);const k={};b.forEach((t=>{t.addEventListener("loadend",Yv({loadendState:k,abortFn:n}))}));return()=>Rv(b)};const Kv=gd("CodecUtils");const Qv=function(t){const e=t.attributes||{};if(e.CODECS){return Xe(e.CODECS)}};const Zv=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]};const tm=(t,e)=>{if(!Zv(t,e)){return true}const i=e.attributes||{};const s=t.mediaGroups.AUDIO[i.AUDIO];for(const t in s){if(!s[t].uri&&!s[t].playlists){return true}}return false};const em=function(t){const e={};t.forEach((({mediaType:t,type:i,details:s})=>{e[t]=e[t]||[];e[t].push(He(`${i}${s}`))}));Object.keys(e).forEach((function(t){if(e[t].length>1){Kv(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);e[t]=null;return}e[t]=e[t][0]}));return e};const im=function(t){let e=0;if(t.audio){e++}if(t.video){e++}return e};const sm=function(t,e){const i=e.attributes||{};const s=em(Qv(e)||[]);if(Zv(t,e)&&!s.audio){if(!tm(t,e)){const e=em(Ge(t,i.AUDIO)||[]);if(e.audio){s.audio=e.audio}}}return s};const nm=gd("PlaylistSelector");const rm=function(t){if(!t||!t.playlist){return}const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})};const om=function(t,e){if(!t){return""}const i=z.getComputedStyle(t);if(!i){return""}return i[e]};const am=function(t,e){const i=t.slice();t.sort((function(t,s){const n=e(t,s);if(n===0){return i.indexOf(t)-i.indexOf(s)}return n}))};const hm=function(t,e){let i;let s;if(t.attributes.BANDWIDTH){i=t.attributes.BANDWIDTH}i=i||z.Number.MAX_VALUE;if(e.attributes.BANDWIDTH){s=e.attributes.BANDWIDTH}s=s||z.Number.MAX_VALUE;return i-s};const cm=function(t,e){let i;let s;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){i=t.attributes.RESOLUTION.width}i=i||z.Number.MAX_VALUE;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){s=e.attributes.RESOLUTION.width}s=s||z.Number.MAX_VALUE;if(i===s&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-e.attributes.BANDWIDTH}return i-s};let lm=function(t,e,i,s,n,r){if(!t){return}const o={bandwidth:e,width:i,height:s,limitRenditionByPlayerDimensions:n};let a=t.playlists;if(np.isAudioOnly(t)){a=r.getAudioTrackPlaylists_();o.audioOnly=true}let h=a.map((t=>{let e;const i=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;const s=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;e=t.attributes&&t.attributes.BANDWIDTH;e=e||z.Number.MAX_VALUE;return{bandwidth:e,width:i,height:s,playlist:t}}));am(h,((t,e)=>t.bandwidth-e.bandwidth));h=h.filter((t=>!np.isIncompatible(t.playlist)));let c=h.filter((t=>np.isEnabled(t.playlist)));if(!c.length){c=h.filter((t=>!np.isDisabled(t.playlist)))}const l=c.filter((t=>t.bandwidth*fv.BANDWIDTH_VARIANCE<e));let u=l[l.length-1];const f=l.filter((t=>t.bandwidth===u.bandwidth))[0];if(n===false){const t=f||c[0]||h[0];if(t&&t.playlist){let e="sortedPlaylistReps";if(f){e="bandwidthBestRep"}if(c[0]){e="enabledPlaylistReps"}nm(`choosing ${rm(t)} using ${e} with options`,o);return t.playlist}nm("could not choose a playlist with options",o);return null}const d=l.filter((t=>t.width&&t.height));am(d,((t,e)=>t.width-e.width));const p=d.filter((t=>t.width===i&&t.height===s));u=p[p.length-1];const v=p.filter((t=>t.bandwidth===u.bandwidth))[0];let m;let g;let b;if(!v){m=d.filter((t=>t.width>i||t.height>s));g=m.filter((t=>t.width===m[0].width&&t.height===m[0].height));u=g[g.length-1];b=g.filter((t=>t.bandwidth===u.bandwidth))[0]}let y;if(r.leastPixelDiffSelector){const t=d.map((t=>{t.pixelDiff=Math.abs(t.width-i)+Math.abs(t.height-s);return t}));am(t,((t,e)=>{if(t.pixelDiff===e.pixelDiff){return e.bandwidth-t.bandwidth}return t.pixelDiff-e.pixelDiff}));y=t[0]}const j=y||b||v||f||c[0]||h[0];if(j&&j.playlist){let t="sortedPlaylistReps";if(y){t="leastPixelDiffRep"}else if(b){t="resolutionPlusOneRep"}else if(v){t="resolutionBestRep"}else if(f){t="bandwidthBestRep"}else if(c[0]){t="enabledPlaylistReps"}nm(`choosing ${rm(j)} using ${t} with options`,o);return j.playlist}nm("could not choose a playlist with options",o);return null};const um=function(){let t=this.useDevicePixelRatio?z.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){t=this.customPixelRatio}return lm(this.playlists.main,this.systemBandwidth,parseInt(om(this.tech_.el(),"width"),10)*t,parseInt(om(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.playlistController_)};const fm=function(t){let e=-1;let i=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){let s=this.useDevicePixelRatio?z.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){s=this.customPixelRatio}if(e<0){e=this.systemBandwidth;i=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==i){e=t*this.systemBandwidth+(1-t)*e;i=this.systemBandwidth}return lm(this.playlists.main,e,parseInt(om(this.tech_.el(),"width"),10)*s,parseInt(om(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const dm=function(t){const{main:e,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:a,syncController:h}=t;const c=e.playlists.filter((t=>!np.isIncompatible(t)));let l=c.filter(np.isEnabled);if(!l.length){l=c.filter((t=>!np.isDisabled(t)))}const u=l.filter(np.hasAttribute.bind(null,"BANDWIDTH"));const f=u.map((t=>{const e=h.getSyncPoint(t,n,a,i);const c=e?1:2;const l=np.estimateSegmentRequestTime(r,s,t);const u=l*c-o;return{playlist:t,rebufferingImpact:u}}));const d=f.filter((t=>t.rebufferingImpact<=0));am(d,((t,e)=>hm(e.playlist,t.playlist)));if(d.length){return d[0]}am(f,((t,e)=>t.rebufferingImpact-e.rebufferingImpact));return f[0]||null};const pm=function(){const t=this.playlists.main.playlists.filter(np.isEnabled);am(t,((t,e)=>hm(t,e)));const e=t.filter((t=>!!sm(this.playlists.main,t).video));return e[0]||null};const vm=t=>{let e=0;let i;if(t.bytes){i=new Uint8Array(t.bytes);t.segments.forEach((t=>{i.set(t,e);e+=t.byteLength}))}return i};function mm(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch(t){return""}}const gm=function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let s=i;if(/^cc708_/.test(i)){s="SERVICE"+i.split("_")[1]}const n=e.textTracks().getTrackById(s);if(n){t[i]=n}else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let r=i;let o=i;let a=false;const h=n[s];if(h){r=h.label;o=h.language;a=h.default}t[i]=e.addRemoteTextTrack({kind:"captions",id:s,default:a,label:r,language:o},false).track}}};const bm=function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e){return}const s=z.WebKitDataCue||z.VTTCue;e.forEach((e=>{const n=e.stream;if(e.content){e.content.forEach((r=>{const o=new s(e.startTime+i,e.endTime+i,r.text);o.line=r.line;o.align="left";o.position=r.position;o.positionAlign="line-left";t[n].addCue(o)}))}else{t[n].addCue(new s(e.startTime+i,e.endTime+i,e.text))}}))};const ym=function(t){Object.defineProperties(t.frame,{id:{get(){cd.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return t.value.key}},value:{get(){cd.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return t.value.data}},privateData:{get(){cd.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return t.value.data}}})};const jm=({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:s})=>{if(!e){return}const n=z.WebKitDataCue||z.VTTCue;const r=t.metadataTrack_;if(!r){return}e.forEach((t=>{const e=t.cueTime+i;if(typeof e!=="number"||z.isNaN(e)||e<0||!(e<Infinity)){return}if(!t.frames||!t.frames.length){return}t.frames.forEach((t=>{const i=new n(e,e,t.value||t.url||t.data||"");i.frame=t;i.value=t;ym(i);r.addCue(i)}))}));if(!r.cues||!r.cues.length){return}const o=r.cues;const a=[];for(let t=0;t<o.length;t++){if(o[t]){a.push(o[t])}}const h=a.reduce(((t,e)=>{const i=t[e.startTime]||[];i.push(e);t[e.startTime]=i;return t}),{});const c=Object.keys(h).sort(((t,e)=>Number(t)-Number(e)));c.forEach(((t,e)=>{const i=h[t];const n=isFinite(s)?s:t;const r=Number(c[e+1])||n;i.forEach((t=>{t.endTime=r}))}))};const wm={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"};const Tm=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]);const km=({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i){return}const s=z.WebKitDataCue||z.VTTCue;e.forEach((t=>{for(const e of Object.keys(t)){if(Tm.has(e)){continue}const n=new s(t.startTime,t.endTime,"");n.id=t.id;n.type="com.apple.quicktime.HLS";n.value={key:wm[e],data:t[e]};if(e==="scte35Out"||e==="scte35In"){n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer}i.addCue(n)}t.processDateRange()}))};const Sm=(t,e,i)=>{if(t.metadataTrack_){return}t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!cd.browser.IS_ANY_SAFARI){t.metadataTrack_.inBandMetadataTrackDispatchType=e}};const xm=function(t,e,i){let s;let n;if(!i){return}if(!i.cues){return}s=i.cues.length;while(s--){n=i.cues[s];if(n.startTime>=t&&n.endTime<=e){i.removeCue(n)}}};const Am=function(t){const e=t.cues;if(!e){return}const i={};for(let s=e.length-1;s>=0;s--){const n=e[s];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(i[r]){t.removeCue(n)}else{i[r]=n}}};const Em=(t,e,i)=>{if(typeof e==="undefined"||e===null||!t.length){return[]}const s=Math.ceil((e-i+3)*Jo.ONE_SECOND_IN_TS);let n;for(n=0;n<t.length;n++){if(t[n].pts>s){break}}return t.slice(n)};const Im=(t,e,i)=>{if(!e.length){return t}if(i){return e.slice()}const s=e[0].pts;let n=0;for(n;n<t.length;n++){if(t[n].pts>=s){break}}return t.slice(0,n).concat(e)};const Dm=(t,e,i,s)=>{const n=Math.ceil((e-s)*Jo.ONE_SECOND_IN_TS);const r=Math.ceil((i-s)*Jo.ONE_SECOND_IN_TS);const o=t.slice();let a=t.length;while(a--){if(t[a].pts<=r){break}}if(a===-1){return o}let h=a+1;while(h--){if(t[h].pts<=n){break}}h=Math.max(h,0);o.splice(h,a-h+1);return o};const Cm=function(t,e){if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}const i=Object.keys(t).sort();const s=Object.keys(e).sort();if(i.length!==s.length){return false}for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n]){return false}if(t[r]!==e[r]){return false}}return true};const Nm=function(t,e,i){e=e||[];const s=[];let n=0;for(let r=0;r<e.length;r++){const o=e[r];if(t===o.timeline){s.push(r);n+=o.duration;if(n>i){return r}}}if(s.length===0){return 0}return s[s.length-1]};const _m=1;const Om=500;const Mm=t=>typeof t==="number"&&isFinite(t);const Rm=1/60;const Lm=(t,e,i)=>{if(t!=="main"||!e||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(e.hasVideo&&!i.hasVideo){return"Only audio found in segment when we expected video."+" We can't switch to audio only from a stream that had video."+" To get rid of this message, please add codec information to the manifest."}if(!e.hasVideo&&i.hasVideo){return"Video found in segment when we expected only audio."+" We can't switch to a stream with video from an audio only stream."+" To get rid of this message, please add codec information to the manifest."}return null};const Pm=(t,e,i)=>{let s=e-fv.BACK_BUFFER_LENGTH;if(t.length){s=Math.max(s,t.start(0))}const n=e-i;return Math.min(n,s)};const $m=t=>{const{startOfSegment:e,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:o,segments:a=[]},mediaIndex:h,partIndex:c,timeline:l}=t;const u=a.length-1;let f="mediaIndex/partIndex increment";if(t.getMediaInfoForTime){f=`getMediaInfoForTime (${t.getMediaInfoForTime})`}else if(t.isSyncRequest){f="getSyncSegmentCandidate (isSyncRequest)"}if(t.independent){f+=` with independent ${t.independent}`}const d=typeof c==="number";const p=t.segment.uri?"segment":"pre-segment";const v=d?Pd({preloadSegment:s})-1:0;return`${p} [${r+h}/${r+u}]`+(d?` part [${c}/${v}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(d?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${e}]`+` duration [${i}]`+` timeline [${l}]`+` selected by [${f}]`+` playlist [${o}]`};const Fm=t=>`${t}TimingInfo`;const Um=({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&t===e){return null}if(t<e){return i}return s.length?s.end(s.length-1):i};const Bm=({timelineChangeController:t,currentTimeline:e,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(e===i){return false}if(s==="audio"){const e=t.lastTimelineChange({type:"main"});return!e||e.to!==i}if(s==="main"&&n){const e=t.pendingTimelineChange({type:"audio"});if(e&&e.to===i){return false}return true}return false};const qm=t=>{if(!t){return false}const e=t.pendingTimelineChange({type:"audio"});const i=t.pendingTimelineChange({type:"main"});const s=e&&i;const n=s&&e.to!==i.to;const r=s&&e.from!==-1&&i.from!==-1;if(r&&n){return true}return false};const Vm=t=>{if(!t){return}t.pause();t.resetEverything();t.load()};const zm=t=>{let e=0;["video","audio"].forEach((function(i){const s=t[`${i}TimingInfo`];if(!s){return}const{start:n,end:r}=s;let o;if(typeof n==="bigint"||typeof r==="bigint"){o=z.BigInt(r)-z.BigInt(n)}else if(typeof n==="number"&&typeof r==="number"){o=r-n}if(typeof o!=="undefined"&&o>e){e=o}}));if(typeof e==="bigint"&&e<Number.MAX_SAFE_INTEGER){e=Number(e)}return e};const Hm=({segmentDuration:t,maxDuration:e})=>{if(!t){return false}return Math.round(t)>e+wd};const Xm=(t,e)=>{if(e!=="hls"){return null}const i=zm({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i){return null}const s=t.playlist.targetDuration;const n=Hm({segmentDuration:i,maxDuration:s*2});const r=Hm({segmentDuration:i,maxDuration:s});const o=`Segment with index ${t.mediaIndex} `+`from playlist ${t.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${t.duration} `+`and the target duration is ${s}. `+"For HLS content, a duration in excess of the target duration may result in "+"playback issues. See the HLS specification section on EXT-X-TARGETDURATION for "+"more details: "+"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";if(n||r){return{severity:n?"warn":"info",message:o}}return null};const Gm=({type:t,segment:e})=>{if(!e){return}const i=Boolean(e.key||e.map&&e.map.ke);const s=Boolean(e.map&&!e.map.bytes);const n=e.startOfSegment===undefined?e.start:e.startOfSegment;return{type:t||e.type,uri:e.resolvedUri||e.uri,start:n,duration:e.duration,isEncrypted:i,isMediaInitialization:s}};class Ym extends cd.EventTarget{constructor(t,e={}){super();if(!t){throw new TypeError("Initialization settings are required")}if(typeof t.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!t.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=t.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=t.hasPlayed;this.currentTime_=t.currentTime;this.seekable_=t.seekable;this.seeking_=t.seeking;this.duration_=t.duration;this.mediaSource_=t.mediaSource;this.vhs_=t.vhs;this.loaderType_=t.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=t.segmentMetadataTrack;this.goalBufferLength_=t.goalBufferLength;this.sourceType_=t.sourceType;this.sourceUpdater_=t.sourceUpdater;this.inbandTextTracks_=t.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=t.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=t.parse708captions;this.useDtsForTimestampOffset_=t.useDtsForTimestampOffset;this.captionServices_=t.captionServices;this.exactManifestTimings=t.exactManifestTimings;this.addMetadataToTextTrack=t.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.shouldForceTimestampOffsetAfterResync_=false;this.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=null;this.activeInitSegmentId_=null;this.initSegments_={};this.cacheEncryptionKeys_=t.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=t.decrypter;this.syncController_=t.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate");this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener("sourceopen",(()=>{if(!this.isEndOfStream_()){this.ended_=false}}));this.fetchAtBuffer_=false;this.logger_=gd(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(t){if(t!==this.state_){this.logger_(`${this.state_} -> ${t}`);this.state_=t;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}));this.sourceUpdater_.on("codecschange",(t=>{this.trigger(it({type:"codecschange"},t))}));if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",(t=>{this.trigger(it({type:"timelinechange"},t));if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return _v.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0;this.mediaAppends=0}dispose(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(t){this.audioDisabled_=!t;if(t){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(this.pendingSegment_&&this.pendingSegment_.abortRequests){this.pendingSegment_.abortRequests()}this.pendingSegment_=null;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.waitingOnRemove_=false;z.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(t){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==t){return true}return false}error(t){if(typeof t!=="undefined"){this.logger_("error occurred:",t);this.error_=t}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){_v.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return yd()}if(this.loaderType_==="main"){const{hasAudio:e,hasVideo:i,isMuxed:s}=t;if(i&&e&&!this.audioDisabled_&&!s){return this.sourceUpdater_.buffered()}if(i){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(t,e=false){if(!t){return null}const i=Fp(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}}return s||t}segmentKey(t,e=false){if(!t){return null}const i=Up(t);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&e&&!s&&t.bytes){this.keyCache_[i]=s={resolvedUri:t.resolvedUri,bytes:t.bytes}}const n={resolvedUri:(s||t).resolvedUri};if(s){n.bytes=s.bytes}return n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(t,e={}){if(!t){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=t;this.xhrOptions_=e;if(this.state==="INIT"){t.syncInfo={mediaSequence:t.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(t)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${t.id||t.uri}]`);if(this.mediaSequenceSync_){this.mediaSequenceSync_.update(t,this.currentTime_());this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${_d(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)}this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==t.uri){if(this.mediaIndex!==null){const e=!t.endList&&typeof t.partTargetDuration==="number";if(e){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=t.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const t=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!t.parts||!t.parts.length||!t.parts[this.partIndex])){const t=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=t}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=t.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,t)}pause(){if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetEverything(t){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true};this.resetLoader();this.remove(0,Infinity,t);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;if(this.mediaSequenceSync_){this.mediaSequenceSync_.resetAppendedStatus()}this.resyncLoader()}resyncLoader(){if(this.transmuxer_){_v.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;const t=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;const e=this.sourceType_==="hls"&&!t;if(e){this.shouldForceTimestampOffsetAfterResync_=true}this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(t,e,i=(()=>{}),s=false){if(e===Infinity){e=this.duration_()}if(e<=t){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const r=()=>{n--;if(n===0){i()}};if(s||!this.audioDisabled_){n++;this.sourceUpdater_.removeAudio(t,e,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=Dm(this.gopBuffer_,t,e,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(t,e,r)}for(const i in this.inbandTextTracks_){xm(t,e,this.inbandTextTracks_[i])}xm(t,e,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),Om)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const t=this.chooseNextRequest_();if(!t){return}const e={segmentInfo:Gm({type:this.loaderType_,segment:t})};this.trigger({type:"segmentselected",metadata:e});if(typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})}this.loadSegment_(t)}isEndOfStream_(t=this.mediaIndex,e=this.playlist_,i=this.partIndex){if(!e||!this.mediaSource_){return false}const s=typeof t==="number"&&e.segments[t];const n=t+1===e.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return e.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const t=this.buffered_();const e=_d(t)||0;const i=Od(t,this.currentTime_());const s=!this.hasPlayed_()&&i>=1;const n=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||s||n){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(o.isSyncRequest){o.mediaIndex=Nm(this.currentTimeline_,r,e);this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`)}else if(this.mediaIndex!==null){const t=r[this.mediaIndex];const i=typeof this.partIndex==="number"?this.partIndex:-1;o.startOfSegment=t.end?t.end:e;if(t.parts&&t.parts[i+1]){o.mediaIndex=this.mediaIndex;o.partIndex=i+1}else{o.mediaIndex=this.mediaIndex+1}}else{let t;let i;let s;const n=this.fetchAtBuffer_?e:this.currentTime_();if(this.mediaSequenceSync_){this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${n}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${e}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics)}if(this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const e=this.getSyncInfoFromMediaSequenceSync_(n);if(!e){const t="No sync info found while using media sequence sync";this.error({message:t,metadata:{errorType:cd.Error.StreamingFailedToSelectNextSegment,error:new Error(t)}});this.logger_("chooseNextRequest_ - no sync info found using media sequence sync");return null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${e.start} --\x3e ${e.end})`);t=e.segmentIndex;i=e.partIndex;s=e.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const e=np.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:n,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});t=e.segmentIndex;i=e.partIndex;s=e.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${n}`:`currentTime ${n}`;o.mediaIndex=t;o.startOfSegment=s;o.partIndex=i;this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const a=r[o.mediaIndex];let h=a&&typeof o.partIndex==="number"&&a.parts&&a.parts[o.partIndex];if(!a||typeof o.partIndex==="number"&&!h){return null}if(typeof o.partIndex!=="number"&&a.parts){o.partIndex=0;h=a.parts[0]}const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&h&&!c&&!h.independent){if(o.partIndex===0){const t=r[o.mediaIndex-1];const e=t.parts&&t.parts.length&&t.parts[t.parts.length-1];if(e&&e.independent){o.mediaIndex-=1;o.partIndex=t.parts.length-1;o.independent="previous segment"}}else if(a.parts[o.partIndex-1].independent){o.partIndex-=1;o.independent="previous part"}}const l=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(o.mediaIndex>=r.length-1&&l&&!this.seeking_()){return null}if(this.shouldForceTimestampOffsetAfterResync_){this.shouldForceTimestampOffsetAfterResync_=false;o.forceTimestampOffset=true;this.logger_("choose next request. Force timestamp offset after loader resync")}return this.generateSegmentInfo_(o)}getSyncInfoFromMediaSequenceSync_(t){if(!this.mediaSequenceSync_){return null}const e=Math.max(t,this.mediaSequenceSync_.start);if(t!==e){this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${t} to ${e}`)}const i=this.mediaSequenceSync_.getSyncInfoForTime(e);if(!i){return null}if(!i.isAppended){return i}const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);if(!s){return null}if(s.isAppended){this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!")}return s}generateSegmentInfo_(t){const{independent:e,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:a,getMediaInfoForTime:h}=t;const c=i.segments[s];const l=typeof o==="number"&&c.parts[o];const u={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:l?o:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:l&&l.duration||c.duration,segment:c,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:e};const f=typeof a!=="undefined"?a:this.isPendingTimestampOffset_;u.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:f});const d=_d(this.sourceUpdater_.audioBuffered());if(typeof d==="number"){u.audioAppendStart=d-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){u.gopsToAlignWith=Em(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return u}timestampOffsetForSegment_(t){return Um(t)}earlyAbortWhenNeeded_(t){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3){return}const e=this.currentTime_();const i=t.bandwidth;const s=this.pendingSegment_.duration;const n=np.estimateSegmentRequestTime(s,i,this.playlist_,t.bytesReceived);const r=Dd(this.buffered_(),e,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const o=dm({main:this.vhs_.playlists.main,currentTime:e,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o){return}const a=n-r;const h=a-o.rebufferingImpact;let c=.5;if(r<=wd){c=1}if(!o.playlist||o.playlist.uri===this.playlist_.uri||h<c){return}this.bandwidth=o.playlist.attributes.BANDWIDTH*fv.BANDWIDTH_VARIANCE+1;this.trigger("earlyabort")}handleAbort_(t){this.logger_(`Aborting ${$m(t)}`);this.mediaRequestsAborted+=1}handleProgress_(t,e){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}this.trigger("progress")}handleTrackInfo_(t,e){const{hasAudio:i,hasVideo:s}=e;const n={segmentInfo:Gm({type:this.loaderType_,segment:t}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n});this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.checkForIllegalMediaSwitch(e)){return}e=e||{};if(!Cm(this.currentMediaInfo_,e)){this.appendInitSegment_={audio:true,video:true};this.startingMediaInfo_=e;this.currentMediaInfo_=e;this.logger_("trackinfo update",e);this.trigger("trackinfo")}if(this.checkForAbort_(t.requestId)){return}this.pendingSegment_.trackInfo=e;if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleTimingInfo_(t,e,i,s){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const n=this.pendingSegment_;const r=Fm(e);n[r]=n[r]||{};n[r][i]=s;this.logger_(`timinginfo: ${e} - ${i} - ${s}`);if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleCaptions_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(e.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}const i=this.pendingSegment_;if(!i.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,e));return}const s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();const n={};e.forEach((t=>{n[t.stream]=n[t.stream]||{startTime:Infinity,captions:[],endTime:0};const e=n[t.stream];e.startTime=Math.min(e.startTime,t.startTime+s);e.endTime=Math.max(e.endTime,t.endTime+s);e.captions.push(t)}));Object.keys(n).forEach((t=>{const{startTime:e,endTime:i,captions:r}=n[t];const o=this.inbandTextTracks_;this.logger_(`adding cues from ${e} -> ${i} for ${t}`);gm(o,this.vhs_.tech_,t);xm(e,i,o[t]);bm({captionArray:r,inbandTextTracks:o,timestampOffset:s})}));if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(t,e,i){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,e,i));return}this.addMetadataToTextTrack(i,e,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach((t=>t()));this.metadataQueue_.caption.forEach((t=>t()));this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const t=this.callQueue_;this.callQueue_=[];t.forEach((t=>t()))}processLoadQueue_(){const t=this.loadQueue_;this.loadQueue_=[];t.forEach((t=>t()))}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const t=this.pendingSegment_;if(!t){return false}if(!this.getCurrentMediaInfo_()){return true}if(Bm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){if(qm(this.timelineChangeController_)){Vm(this)}return false}return true}getCurrentMediaInfo_(t=this.pendingSegment_){return t&&t.trackInfo||this.currentMediaInfo_}getMediaInfo_(t=this.pendingSegment_){return this.getCurrentMediaInfo_(t)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const t=this.pendingSegment_;const e=this.getCurrentMediaInfo_();if(!t||!e){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=e;if(s&&!t.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!t.audioTimingInfo){return false}if(Bm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){if(qm(this.timelineChangeController_)){Vm(this)}return false}return true}handleData_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,t,e));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(t.map){t.map=this.initSegmentForMap(t.map,true);i.segment.map=t.map}if(t.key){this.segmentKey(t.key,true)}i.isFmp4=t.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[Fm(e.type)].start}else{const t=this.getCurrentMediaInfo_();const e=this.loaderType_==="main"&&t&&t.hasVideo;let s;if(e){s=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:e,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,e.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=this.chooseNextRequest_();if(t.mediaIndex!==i.mediaIndex||t.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,e)}updateAppendInitSegmentStatus(t,e){if(this.loaderType_==="main"&&typeof t.timestampOffset==="number"&&!t.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[e]!==t.playlist){this.appendInitSegment_[e]=true}}getInitSegmentAndUpdateState_({type:t,initSegment:e,map:i,playlist:s}){if(i){const t=Fp(i);if(this.activeInitSegmentId_===t){return null}e=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=t}if(e&&this.appendInitSegment_[t]){this.playlistOfLastInitSegment_[t]=s;this.appendInitSegment_[t]=false;this.activeInitSegmentId_=null;return e}return null}handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i},s){const n=this.sourceUpdater_.audioBuffered();const r=this.sourceUpdater_.videoBuffered();if(n.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Cd(n).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Cd(r).join(", "))}const o=n.length?n.start(0):0;const a=n.length?n.end(n.length-1):0;const h=r.length?r.start(0):0;const c=r.length?r.end(r.length-1):0;if(a-o<=_m&&c-h<=_m){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${Cd(n).join(", ")}, `+`video buffer: ${Cd(r).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:t,type:e,bytes:i}));const l=this.currentTime_();const u=l-_m;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`);this.remove(0,u,(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${_m}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=z.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()}),_m*1e3)}),true)}handleAppendError_({segmentInfo:t,type:e,bytes:i},s){if(!s){return}if(s.code===mp){this.handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error({message:`${e} append of ${i.length}b failed for segment `+`#${t.mediaIndex} in playlist ${t.playlist.id}`,metadata:{errorType:cd.Error.StreamingFailedToAppendSegment}});this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:t,type:e,initSegment:i,data:s,bytes:n}){if(!n){const t=[s];let e=s.byteLength;if(i){t.unshift(i);e+=i.byteLength}n=vm({bytes:e,segments:t})}const r={segmentInfo:Gm({type:this.loaderType_,segment:t})};this.trigger({type:"segmentappendstart",metadata:r});this.sourceUpdater_.appendBuffer({segmentInfo:t,type:e,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:t,type:e,bytes:n}))}handleSegmentTimingInfo_(t,e,i){if(!this.pendingSegment_||e!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${t}TimingInfo`;if(!s[n]){s[n]={}}s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0;s[n].transmuxedPresentationStart=i.start.presentation;s[n].transmuxedDecodeStart=i.start.decode;s[n].transmuxedPresentationEnd=i.end.presentation;s[n].transmuxedDecodeEnd=i.end.decode;s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(t,e){const{type:i,data:s}=e;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:e.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,type:i,initSegment:n,data:s})}loadSegment_(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);if(typeof t.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push((()=>{const e=it({},t,{forceTimestampOffset:true});it(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)}));return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(t){if(this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)){this.gopBuffer_.length=0;t.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset})}const e=this.createSimplifiedSegmentObj_(t);const i=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex);const s=this.mediaIndex!==null;const n=t.timeline!==this.currentTimeline_&&t.timeline>0;const r=i||s&&n;this.logger_(`Requesting\n${mm(t.uri)}\n${$m(t)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}t.abortRequests=Jv({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:e,level:i,stream:s})=>{this.logger_(`${$m(t)} logged from transmuxer stream ${s} as a ${i}: ${e}`)},triggerSegmentEventFn:({type:t,segment:e,keyInfo:i,trackInfo:s,timingInfo:n})=>{const r=Gm({segment:e});const o={segmentInfo:r};if(i){o.keyInfo=i}if(s){o.trackInfo=s}if(n){o.timingInfo=n}this.trigger({type:t,metadata:o})}})}trimBackBuffer_(t){const e=Pm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(e>0){this.remove(0,e)}}createSimplifiedSegmentObj_(t){const e=t.segment;const i=t.part;const s=t.segment.key||t.segment.map&&t.segment.map.key;const n=t.segment.map&&!t.segment.map.bytes;const r={resolvedUri:i?i.resolvedUri:e.resolvedUri,byterange:i?i.byterange:e.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part,type:this.loaderType_,start:t.startOfSegment,duration:t.duration,isEncrypted:s,isMediaInitialization:n};const o=t.playlist.segments[t.mediaIndex-1];if(o&&o.timeline===e.timeline){if(o.videoTimingInfo){r.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd}else if(o.audioTimingInfo){r.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd}}if(e.key){const i=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);r.key=this.segmentKey(e.key);r.key.iv=i}if(e.map){r.map=this.initSegmentForMap(e.map)}return r}saveTransferStats_(t){this.mediaRequests+=1;if(t){this.mediaBytesTransferred+=t.bytesReceived;this.mediaTransferDuration+=t.roundTripTime}}saveBandwidthRelatedStats_(t,e){this.pendingSegment_.byteLength=e.bytesReceived;if(t<Rm){this.logger_(`Ignoring segment's bandwidth because its duration of ${t}`+` is less than the min to record ${Rm}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:e.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i});this.bandwidth=e.bandwidth;this.roundTrip=e.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");this.trigger("timeout")}segmentRequestFinished_(t,e,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,e,i));return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){return}if(e.requestId!==this.pendingSegment_.requestId){return}if(t){this.pendingSegment_=null;this.state="READY";if(t.code===Mv.ABORTED){return}this.pause();if(t.code===Mv.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1;this.error(t);this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);s.endOfAllRequests=e.endOfAllRequests;if(i.gopInfo){this.gopBuffer_=Im(this.gopBuffer_,i.gopInfo,this.safeAppend_)}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(s)}setTimeMapping_(t){const e=this.syncController_.mappingForTimeline(t);if(e!==null){this.timeMapping_=e}}updateMediaSecondsLoaded_(t){if(typeof t.start==="number"&&typeof t.end==="number"){this.mediaSecondsLoaded+=t.end-t.start}else{this.mediaSecondsLoaded+=t.duration}}shouldUpdateTransmuxerTimestampOffset_(t){if(t===null){return false}if(this.loaderType_==="main"&&t!==this.sourceUpdater_.videoTimestampOffset()){return true}if(!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset()){return true}return false}trueSegmentStart_({currentStart:t,playlist:e,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:a}){if(typeof t!=="undefined"){return t}if(!r){return a.start}const h=e.segments[i-1];if(i===0||!h||typeof h.start==="undefined"||h.end!==s+n){return s}return o.start}waitForAppendsToComplete_(t){const e=this.getCurrentMediaInfo_(t);if(!e){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:Infinity});this.trigger("error");return}const{hasAudio:i,hasVideo:s,isMuxed:n}=e;const r=this.loaderType_==="main"&&s;const o=!this.audioDisabled_&&i&&!n;t.waitingOnAppends=0;if(!t.hasAppendedData_){if(!t.timingInfo&&typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=true}t.timingInfo={start:0};t.waitingOnAppends++;if(!this.isPendingTimestampOffset_){this.updateSourceBufferTimestampOffset_(t);this.processMetadataQueue_()}this.checkAppendsDone_(t);return}if(r){t.waitingOnAppends++}if(o){t.waitingOnAppends++}if(r){this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t))}if(o){this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))}}checkAppendsDone_(t){if(this.checkForAbort_(t.requestId)){return}t.waitingOnAppends--;if(t.waitingOnAppends===0){this.handleAppendsDone_()}}checkForIllegalMediaSwitch(t){const e=Lm(this.loaderType_,this.getCurrentMediaInfo_(),t);if(e){this.error({message:e,playlistExclusionDuration:Infinity});this.trigger("error");return true}return false}updateSourceBufferTimestampOffset_(t){if(t.timestampOffset===null||typeof t.timingInfo.start!=="number"||t.changedTimestampOffset||this.loaderType_!=="main"){return}let e=false;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo});t.changedTimestampOffset=true;if(t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()){this.sourceUpdater_.videoTimestampOffset(t.timestampOffset);e=true}if(t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()){this.sourceUpdater_.audioTimestampOffset(t.timestampOffset);e=true}if(e){this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t,audioTimingInfo:e,timingInfo:i}){if(!this.useDtsForTimestampOffset_){return i.start}if(t&&typeof t.transmuxedDecodeStart==="number"){return t.transmuxedDecodeStart}if(e&&typeof e.transmuxedDecodeStart==="number"){return e.transmuxedDecodeStart}return i.start}updateTimingInfoEnd_(t){t.timingInfo=t.timingInfo||{};const e=this.getMediaInfo_();const i=this.loaderType_==="main"&&e&&e.hasVideo;const s=i&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;if(!s){return}t.timingInfo.end=typeof s.end==="number"?s.end:s.start+t.duration}handleAppendsDone_(){if(this.pendingSegment_){const t={segmentInfo:Gm({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:t})}if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}const t=this.pendingSegment_;if(t.part&&t.part.syncInfo){t.part.syncInfo.markAppended()}else if(t.segment.syncInfo){t.segment.syncInfo.markAppended()}this.updateTimingInfoEnd_(t);if(this.shouldSaveSegmentTimingInfo_){this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:this.loaderType_==="main"})}const e=Xm(t,this.sourceType_);if(e){if(e.severity==="warn"){cd.log.warn(e.message)}else{this.logger_(e.message)}}this.recordThroughput_(t);this.pendingSegment_=null;this.state="READY";if(t.isSyncRequest){this.trigger("syncinfoupdate");if(!t.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${$m(t)}`);return}}this.logger_(`Appended ${$m(t)}`);this.addSegmentMetadataCue_(t);this.fetchAtBuffer_=true;if(this.currentTimeline_!==t.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})}}this.currentTimeline_=t.timeline;this.trigger("syncinfoupdate");const i=t.segment;const s=t.part;const n=i.end&&this.currentTime_()-i.end>t.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>t.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${$m(t)}`);this.resetEverything();return}const o=this.mediaIndex!==null;if(o){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=t.mediaIndex;this.partIndex=t.partIndex;if(this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)){this.endOfStream()}this.trigger("appended");if(t.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(t){if(t.duration<Rm){this.logger_(`Ignoring segment's throughput because its duration of ${t.duration}`+` is less than the min to record ${Rm}`);return}const e=this.throughput.rate;const i=Date.now()-t.endOfAllRequests+1;const s=Math.floor(t.byteLength/i*8*1e3);this.throughput.rate+=(s-e)/++this.throughput.count}addSegmentMetadataCue_(t){if(!this.segmentMetadataTrack_){return}const e=t.segment;const i=e.start;const s=e.end;if(!Mm(i)||!Mm(s)){return}xm(i,s,this.segmentMetadataTrack_);const n=z.WebKitDataCue||z.VTTCue;const r={custom:e.custom,dateTimeObject:e.dateTimeObject,dateTimeString:e.dateTimeString,programDateTime:e.programDateTime,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:i,end:s};const o=JSON.stringify(r);const a=new n(i,s,o);a.value=r;this.segmentMetadataTrack_.addCue(a)}}function Wm(){}const Jm=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toUpperCase()))};const Km=["video","audio"];const Qm=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]};const Zm=(t,e)=>{for(let i=0;i<e.length;i++){const s=e[i];if(s.type==="mediaSource"){return null}if(s.type===t){return i}}return null};const tg=(t,e)=>{if(e.queue.length===0){return}let i=0;let s=e.queue[i];if(s.type==="mediaSource"){if(!e.updating()&&e.mediaSource.readyState!=="closed"){e.queue.shift();s.action(e);if(s.doneFn){s.doneFn()}tg("audio",e);tg("video",e)}return}if(t==="mediaSource"){return}if(!e.ready()||e.mediaSource.readyState==="closed"||Qm(t,e)){return}if(s.type!==t){i=Zm(t,e.queue);if(i===null){return}s=e.queue[i]}e.queue.splice(i,1);e.queuePending[t]=s;s.action(t,e);if(!s.doneFn){e.queuePending[t]=null;tg(t,e);return}};const eg=(t,e)=>{const i=e[`${t}Buffer`];const s=Jm(t);if(!i){return}i.removeEventListener("updateend",e[`on${s}UpdateEnd_`]);i.removeEventListener("error",e[`on${s}Error_`]);e.codecs[t]=null;e[`${t}Buffer`]=null};const ig=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1;const sg={appendBuffer:(t,e,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(!ig(n.mediaSource,r)){return}n.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${s}Buffer`);try{r.appendBuffer(t)}catch(t){n.logger_(`Error with code ${t.code} `+(t.code===mp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`);n.queuePending[s]=null;i(t)}},remove:(t,e)=>(i,s)=>{const n=s[`${i}Buffer`];if(!ig(s.mediaSource,n)){return}s.logger_(`Removing ${t} to ${e} from ${i}Buffer`);try{n.remove(t,e)}catch(n){s.logger_(`Remove ${t} to ${e} from ${i}Buffer failed`)}},timestampOffset:t=>(e,i)=>{const s=i[`${e}Buffer`];if(!ig(i.mediaSource,s)){return}i.logger_(`Setting ${e}timestampOffset to ${t}`);s.timestampOffset=t},callback:t=>(e,i)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(t){cd.log.warn("Failed to call media source endOfStream",t)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(t){cd.log.warn("Failed to set media source duration",t)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!ig(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){cd.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(t,e)=>i=>{const s=Jm(t);const n=Je(e);i.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]);r.addEventListener("error",i[`on${s}Error_`]);i.codecs[t]=e;i[`${t}Buffer`]=r},removeSourceBuffer:t=>e=>{const i=e[`${t}Buffer`];eg(t,e);if(!ig(e.mediaSource,i)){return}e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(e){cd.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,e)}},changeType:t=>(e,i)=>{const s=i[`${e}Buffer`];const n=Je(t);if(!ig(i.mediaSource,s)){return}const r=t.substring(0,t.indexOf("."));const o=i.codecs[e];const a=o.substring(0,o.indexOf("."));if(a===r){return}const h={codecsChangeInfo:{from:o,to:t}};i.trigger({type:"codecschange",metadata:h});i.logger_(`changing ${e}Buffer codec from ${o} to ${t}`);try{s.changeType(n);i.codecs[e]=t}catch(t){h.errorType=cd.Error.StreamingCodecsChangeError;h.error=t;t.metadata=h;i.error_=t;i.trigger("error");cd.log.warn(`Failed to changeType on ${e}Buffer`,t)}}};const ng=({type:t,sourceUpdater:e,action:i,doneFn:s,name:n})=>{e.queue.push({type:t,action:i,doneFn:s,name:n});tg(t,e)};const rg=(t,e)=>i=>{const s=e[`${t}Buffered`]();const n=jd(s);e.logger_(`received "updateend" event for ${t} Source Buffer: `,n);if(e.queuePending[t]){const i=e.queuePending[t].doneFn;e.queuePending[t]=null;if(i){i(e[`${t}Error_`])}}tg(t,e)};class og extends cd.EventTarget{constructor(t){super();this.mediaSource=t;this.sourceopenListener_=()=>tg("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=gd("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=rg("video",this);this.onAudioUpdateEnd_=rg("audio",this);this.onVideoError_=t=>{this.videoError_=t};this.onAudioError_=t=>{this.audioError_=t};this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(t){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(t);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(t,e){ng({type:"mediaSource",sourceUpdater:this,action:sg.addSourceBuffer(t,e),name:"addSourceBuffer"})}abort(t){ng({type:t,sourceUpdater:this,action:sg.abort(t),name:"abort"})}removeSourceBuffer(t){if(!this.canRemoveSourceBuffer()){cd.log.error("removeSourceBuffer is not supported!");return}ng({type:"mediaSource",sourceUpdater:this,action:sg.removeSourceBuffer(t),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!cd.browser.IS_FIREFOX&&z.MediaSource&&z.MediaSource.prototype&&typeof z.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return z.SourceBuffer&&z.SourceBuffer.prototype&&typeof z.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(t,e){if(!this.canChangeType()){cd.log.error("changeType is not supported!");return}ng({type:t,sourceUpdater:this,action:sg.changeType(e),name:"changeType"})}addOrChangeSourceBuffers(t){if(!t||typeof t!=="object"||Object.keys(t).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(t).forEach((e=>{const i=t[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,i)}if(this.canChangeType()){this.changeType(e,i)}}))}appendBuffer(t,e){const{segmentInfo:i,type:s,bytes:n}=t;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([t,e]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=e;ng({type:s,sourceUpdater:this,action:sg.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:e,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const t=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${t.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;t.forEach((t=>{this.appendBuffer.apply(this,t)}))}}audioBuffered(){if(!ig(this.mediaSource,this.audioBuffer)){return yd()}return this.audioBuffer.buffered?this.audioBuffer.buffered:yd()}videoBuffered(){if(!ig(this.mediaSource,this.videoBuffer)){return yd()}return this.videoBuffer.buffered?this.videoBuffer.buffered:yd()}buffered(){const t=ig(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const e=ig(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(e&&!t){return this.audioBuffered()}if(t&&!e){return this.videoBuffered()}return Ed(this.audioBuffered(),this.videoBuffered())}setDuration(t,e=Wm){ng({type:"mediaSource",sourceUpdater:this,action:sg.duration(t),name:"duration",doneFn:e})}endOfStream(t=null,e=Wm){if(typeof t!=="string"){t=undefined}ng({type:"mediaSource",sourceUpdater:this,action:sg.endOfStream(t),name:"endOfStream",doneFn:e})}removeAudio(t,e,i=Wm){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}ng({type:"audio",sourceUpdater:this,action:sg.remove(t,e),doneFn:i,name:"remove"})}removeVideo(t,e,i=Wm){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}ng({type:"video",sourceUpdater:this,action:sg.remove(t,e),doneFn:i,name:"remove"})}updating(){if(Qm("audio",this)||Qm("video",this)){return true}return false}audioTimestampOffset(t){if(typeof t!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==t){ng({type:"audio",sourceUpdater:this,action:sg.timestampOffset(t),name:"timestampOffset"});this.audioTimestampOffset_=t}return this.audioTimestampOffset_}videoTimestampOffset(t){if(typeof t!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset_!==t){ng({type:"video",sourceUpdater:this,action:sg.timestampOffset(t),name:"timestampOffset"});this.videoTimestampOffset_=t}return this.videoTimestampOffset_}audioQueueCallback(t){if(!this.audioBuffer){return}ng({type:"audio",sourceUpdater:this,action:sg.callback(t),name:"callback"})}videoQueueCallback(t){if(!this.videoBuffer){return}ng({type:"video",sourceUpdater:this,action:sg.callback(t),name:"callback"})}dispose(){this.trigger("dispose");Km.forEach((t=>{this.abort(t);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(t)}else{this[`${t}QueueCallback`]((()=>eg(t,this)))}}));this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const ag=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t)));const hg=t=>{const e=new Uint8Array(t);return Array.from(e).map((t=>t.toString(16).padStart(2,"0"))).join("")};const cg=new Uint8Array("\n\n".split("").map((t=>t.charCodeAt(0))));class lg extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class ug extends Ym{constructor(t,e={}){super(t,e);this.mediaSource_=null;this.subtitlesTrack_=null;this.featuresNativeTextTracks_=t.featuresNativeTextTracks;this.loadVttJs=t.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return yd()}const t=this.subtitlesTrack_.cues;const e=t[0].startTime;const i=t[t.length-1].startTime;return yd([[e,i]])}initSegmentForMap(t,e=false){if(!t){return null}const i=Fp(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){const e=cg.byteLength+t.bytes.byteLength;const n=new Uint8Array(e);n.set(t.bytes);n.set(cg,t.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:n}}return s||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(t){if(typeof t==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=t;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(t,e){xm(t,e,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(!t){return}if(this.syncController_.timestampOffsetForTimeline(t.timeline)===null){const t=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",t);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){while(t&&t.segment.empty){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t}stopForError(t){this.error(t);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(t,e,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(t){if(t.code===Mv.TIMEOUT){this.handleTimeout_()}if(t.code===Mv.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(t);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);if(e.key){this.segmentKey(e.key,true)}this.state="APPENDING";this.trigger("appending");const n=s.segment;if(n.map){n.map.bytes=e.map.bytes}s.bytes=e.bytes;if(typeof z.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then((()=>this.segmentRequestFinished_(t,e,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));return}n.requested=true;try{this.parseVTTCues_(s)}catch(t){this.stopForError({message:t.message,metadata:{errorType:cd.Error.StreamingVttParserError,error:t}});return}this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_);if(s.cues.length){s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}}else{s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration}}if(s.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}s.byteLength=s.bytes.byteLength;this.mediaSecondsLoaded+=n.duration;s.cues.forEach((t=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new z.VTTCue(t.startTime,t.endTime,t.text):t)}));Am(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof z.WebVTT!=="function"){throw new lg}if(typeof z.TextDecoder==="function"){e=new z.TextDecoder("utf8")}else{e=z.WebVTT.StringDecoder();i=true}const s=new z.WebVTT.Parser(z,z.vttjs,e);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};s.oncue=t.cues.push.bind(t.cues);s.ontimestampmap=e=>{t.timestampmap=e};s.onparsingerror=t=>{cd.log.warn("Error encountered when parsing cues: "+t.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=ag(e)}s.parse(e)}let n=t.bytes;if(i){n=ag(n)}s.parse(n);s.flush()}updateTimeMapping_(t,e,i){const s=t.segment;if(!e){return}if(!t.cues.length){s.empty=true;return}const{MPEGTS:n,LOCAL:r}=t.timestampmap;const o=n/Jo.ONE_SECOND_IN_TS;const a=o-r+e.mapping;t.cues.forEach((t=>{const i=t.endTime-t.startTime;const s=n===0?t.startTime+a:this.handleRollover_(t.startTime+a,e.time);t.startTime=Math.max(s,0);t.endTime=Math.max(s+i,0)}));if(!i.syncInfo){const e=t.cues[0].startTime;const n=t.cues[t.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(e,n-s.duration)}}}handleRollover_(t,e){if(e===null){return t}let i=t*Jo.ONE_SECOND_IN_TS;const s=e*Jo.ONE_SECOND_IN_TS;let n;if(s<i){n=-8589934592}else{n=8589934592}while(Math.abs(i-s)>4294967296){i+=n}return i/Jo.ONE_SECOND_IN_TS}}const fg=function(t,e){const i=t.cues;for(let t=0;t<i.length;t++){const s=i[t];if(e>=s.adStartTime&&e<=s.adEndTime){return s}}return null};const dg=function(t,e,i=0){if(!t.segments){return}let s=i;let n;for(let i=0;i<t.segments.length;i++){const r=t.segments[i];if(!n){n=fg(e,s+r.duration/2)}if(n){if("cueIn"in r){n.endTime=s;n.adEndTime=s;s+=r.duration;n=null;continue}if(s<n.endTime){s+=r.duration;continue}n.endTime+=r.duration}else{if("cueOut"in r){n=new z.VTTCue(s,s+r.duration,r.cueOut);n.adStartTime=s;n.adEndTime=s+parseFloat(r.cueOut);e.addCue(n)}if("cueOutCont"in r){const[t,i]=r.cueOutCont.split("/").map(parseFloat);n=new z.VTTCue(s,s+r.duration,"");n.adStartTime=s-t;n.adEndTime=n.adStartTime+i;e.addCue(n)}}s+=r.duration}};class pg{constructor({start:t,end:e,segmentIndex:i,partIndex:s=null,appended:n=false}){this.start_=t;this.end_=e;this.segmentIndex_=i;this.partIndex_=s;this.appended_=n}isInRange(t){return t>=this.start&&t<this.end}markAppended(){this.appended_=true}resetAppendedStatus(){this.appended_=false}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class vg{constructor(t,e=[]){this.segmentSyncInfo_=t;this.partsSyncInfo_=e}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus();this.partsSyncInfo_.forEach((t=>t.resetAppendedStatus()))}}class mg{constructor(){this.storage_=new Map;this.diagnostics_="";this.isReliable_=false;this.start_=-Infinity;this.end_=Infinity}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((t=>t.resetAppendStatus()))}update(t,e){const{mediaSequence:i,segments:s}=t;this.isReliable_=this.isReliablePlaylist_(i,s);if(!this.isReliable_){return}return this.updateStorage_(s,i,this.calculateBaseTime_(i,e))}getSyncInfoForTime(t){for(const{segmentSyncInfo:e,partsSyncInfo:i}of this.storage_.values()){if(!i.length){if(e.isInRange(t)){return e}}else{for(const e of i){if(e.isInRange(t)){return e}}}}return null}getSyncInfoForMediaSequence(t){return this.storage_.get(t)}updateStorage_(t,e,i){const s=new Map;let n="\n";let r=i;let o=e;this.start_=r;t.forEach(((t,e)=>{const i=this.storage_.get(o);const a=r;const h=a+t.duration;const c=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended);const l=new pg({start:a,end:h,appended:c,segmentIndex:e});t.syncInfo=l;let u=r;const f=(t.parts||[]).map(((t,s)=>{const r=u;const a=u+t.duration;const h=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[s]&&i.partsSyncInfo[s].isAppended);const c=new pg({start:r,end:a,appended:h,segmentIndex:e,partIndex:s});u=a;n+=`Media Sequence: ${o}.${s} | Range: ${r} --\x3e ${a} | Appended: ${h}\n`;t.syncInfo=c;return c}));s.set(o,new vg(l,f));n+=`${mm(t.resolvedUri)} | Media Sequence: ${o} | Range: ${a} --\x3e ${h} | Appended: ${c}\n`;o++;r=h}));this.end_=r;this.storage_=s;this.diagnostics_=n}calculateBaseTime_(t,e){if(!this.storage_.size){return 0}if(this.storage_.has(t)){return this.storage_.get(t).segmentSyncInfo.start}return e}isReliablePlaylist_(t,e){return t!==undefined&&t!==null&&Array.isArray(e)&&e.length}}class gg extends mg{constructor(t){super();this.parent_=t}calculateBaseTime_(t,e){if(!this.storage_.size){const e=this.parent_.getSyncInfoForMediaSequence(t);if(e){return e.segmentSyncInfo.start}return 0}return super.calculateBaseTime_(t,e)}}const bg=86400;const yg=[{name:"VOD",run:(t,e,i,s,n)=>{if(i!==Infinity){const t={time:0,segmentIndex:0,partIndex:null};return t}return null}},{name:"MediaSequence",run:(t,e,i,s,n,r)=>{const o=t.getMediaSequenceSync(r);if(!o){return null}if(!o.isReliable){return null}const a=o.getSyncInfoForTime(n);if(!a){return null}return{time:a.start,partIndex:a.partIndex,segmentIndex:a.segmentIndex}}},{name:"ProgramDateTime",run:(t,e,i,s,n)=>{if(!Object.keys(t.timelineToDatetimeMappings).length){return null}let r=null;let o=null;const a=Rd(e);n=n||0;for(let i=0;i<a.length;i++){const s=e.endList||n===0?i:a.length-(i+1);const h=a[s];const c=h.segment;const l=t.timelineToDatetimeMappings[c.timeline];if(!l||!c.dateTimeObject){continue}const u=c.dateTimeObject.getTime()/1e3;let f=u+l;if(c.parts&&typeof h.partIndex==="number"){for(let t=0;t<h.partIndex;t++){f+=c.parts[t].duration}}const d=Math.abs(n-f);if(o!==null&&(d===0||o<d)){break}o=d;r={time:f,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}return r}},{name:"Segment",run:(t,e,i,s,n)=>{let r=null;let o=null;n=n||0;const a=Rd(e);for(let t=0;t<a.length;t++){const i=e.endList||n===0?t:a.length-(t+1);const h=a[i];const c=h.segment;const l=h.part&&h.part.start||c&&c.start;if(c.timeline===s&&typeof l!=="undefined"){const t=Math.abs(n-l);if(o!==null&&o<t){break}if(!r||o===null||o>=t){o=t;r={time:l,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}}return r}},{name:"Discontinuity",run:(t,e,i,s,n)=>{let r=null;n=n||0;if(e.discontinuityStarts&&e.discontinuityStarts.length){let i=null;for(let s=0;s<e.discontinuityStarts.length;s++){const o=e.discontinuityStarts[s];const a=e.discontinuitySequence+s+1;const h=t.discontinuities[a];if(h){const t=Math.abs(n-h.time);if(i!==null&&i<t){break}if(!r||i===null||i>=t){i=t;r={time:h.time,segmentIndex:o,partIndex:null}}}}}return r}},{name:"Playlist",run:(t,e,i,s,n)=>{if(e.syncInfo){const t={time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null};return t}return null}}];class jg extends cd.EventTarget{constructor(t={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};const e=new mg;const i=new gg(e);const s=new gg(e);this.mediaSequenceStorage_={main:e,audio:i,vtt:s};this.logger_=gd("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,e,i,s,n){if(e!==Infinity){const i=yg.find((({name:t})=>t==="VOD"));return i.run(this,t,e)}const r=this.runStrategies_(t,e,i,s,n);if(!r.length){return null}for(const e of r){const{syncPoint:i,strategy:n}=e;const{segmentIndex:r,time:o}=i;if(r<0){continue}const a=t.segments[r];const h=o;const c=h+a.duration;this.logger_(`Strategy: ${n}. Current time: ${s}. selected segment: ${r}. Time: [${h} -> ${c}]}`);if(s>=h&&s<c){this.logger_("Found sync point with exact match: ",i);return i}}return this.selectSyncPoint_(r,{key:"time",value:s})}getExpiredTime(t,e){if(!t||!t.segments){return null}const i=this.runStrategies_(t,e,t.discontinuitySequence,0);if(!i.length){return null}const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});if(s.segmentIndex>0){s.time*=-1}return Math.abs(s.time+Vd({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,e,i,s,n){const r=[];for(let o=0;o<yg.length;o++){const a=yg[o];const h=a.run(this,t,e,i,s,n);if(h){h.strategy=a.name;r.push({strategy:a.name,syncPoint:h})}}return r}selectSyncPoint_(t,e){let i=t[0].syncPoint;let s=Math.abs(t[0].syncPoint[e.key]-e.value);let n=t[0].strategy;for(let r=1;r<t.length;r++){const o=Math.abs(t[r].syncPoint[e.key]-e.value);if(o<s){s=o;i=t[r].syncPoint;n=t[r].strategy}}this.logger_(`syncPoint for [${e.key}: ${e.value}] chosen with strategy`+` [${n}]: [time:${i.time},`+` segmentIndex:${i.segmentIndex}`+(typeof i.partIndex==="number"?`,partIndex:${i.partIndex}`:"")+"]");return i}saveExpiredSegmentInfo(t,e){const i=e.mediaSequence-t.mediaSequence;if(i>bg){cd.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){const i=t.segments[s];if(i&&typeof i.start!=="undefined"){e.syncInfo={mediaSequence:t.mediaSequence+s,time:i.start};this.logger_(`playlist refresh sync: [time:${e.syncInfo.time},`+` mediaSequence: ${e.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){this.timelineToDatetimeMappings={};if(t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const e=t.segments[0];const i=e.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[e.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:e}){const i=this.calculateSegmentTimeMapping_(t,t.timingInfo,e);const s=t.segment;if(i){this.saveDiscontinuitySyncInfo_(t);if(!t.playlist.syncInfo){t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&e&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].time}mappingForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].mapping}calculateSegmentTimeMapping_(t,e,i){const s=t.segment;const n=t.part;let r=this.timelines[t.timeline];let o;let a;if(typeof t.timestampOffset==="number"){r={time:t.startOfSegment,mapping:t.startOfSegment-e.start};if(i){this.timelines[t.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${t.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}o=t.startOfSegment;a=e.end+r.mapping}else if(r){o=e.start+r.mapping;a=e.end+r.mapping}else{return false}if(n){n.start=o;n.end=a}if(!s.start||o<s.start){s.start=o}s.end=a;return true}saveDiscontinuitySyncInfo_(t){const e=t.playlist;const i=t.segment;if(i.discontinuity){this.discontinuities[i.timeline]={time:i.start,accuracy:0}}else if(e.discontinuityStarts&&e.discontinuityStarts.length){for(let s=0;s<e.discontinuityStarts.length;s++){const n=e.discontinuityStarts[s];const r=e.discontinuitySequence+s+1;const o=n-t.mediaIndex;const a=Math.abs(o);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>a){let s;if(o<0){s=i.start-Vd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex,endIndex:n})}else{s=i.end+Vd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:s,accuracy:a}}}}}dispose(){this.trigger("dispose");this.off()}}class wg extends cd.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.pendingTimelineChanges_[t]={type:t,from:e,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.lastTimelineChanges_[t]={type:t,from:e,to:i};delete this.pendingTimelineChanges_[t];const s={timelineChangeInfo:{from:e,to:i}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Tg=gv(bv((function(){var t=function(){function t(){this.listeners={}}var e=t.prototype;e.on=function t(e,i){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(i)};e.off=function t(e,i){if(!this.listeners[e]){return false}var s=this.listeners[e].indexOf(i);this.listeners[e]=this.listeners[e].slice(0);this.listeners[e].splice(s,1);return s>-1};e.trigger=function t(e){var i=this.listeners[e];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var o=i.length;for(var a=0;a<o;++a){i[a].apply(this,r)}}};e.dispose=function t(){this.listeners={}};e.pipe=function t(e){this.on("data",(function(t){e.push(t)}))};return t}();
24
24
  /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(t){return t.subarray(0,t.byteLength-t[t.byteLength-1])}
25
- /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const i=function(){const t=[[[],[],[],[],[]],[[],[],[],[],[]]];const e=t[0];const i=t[1];const s=e[4];const n=i[4];let r;let o;let a;const h=[];const c=[];let l;let u;let f;let d;let p;let v;for(r=0;r<256;r++){c[(h[r]=r<<1^(r>>7)*283)^r]=r}for(o=a=0;!s[o];o^=l||1,a=c[a]||1){d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99;s[o]=d;n[d]=o;f=h[u=h[l=h[o]]];v=f*16843009^u*65537^l*257^o*16843008;p=h[d]*257^d*16843008;for(r=0;r<4;r++){e[r][o]=p=p<<24^p>>>8;i[r][d]=v=v<<24^v>>>8}}for(r=0;r<5;r++){e[r]=e[r].slice(0);i[r]=i[r].slice(0)}return t};let s=null;class n{constructor(t){if(!s){s=i()}this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let e;let n;let r;const o=this._tables[0][4];const a=this._tables[1];const h=t.length;let c=1;if(h!==4&&h!==6&&h!==8){throw new Error("Invalid aes key size")}const l=t.slice(0);const u=[];this._key=[l,u];for(e=h;e<4*h+28;e++){r=l[e-1];if(e%h===0||h===8&&e%h===4){r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[r&255];if(e%h===0){r=r<<8^r>>>24^c<<24;c=c<<1^(c>>7)*283}}l[e]=l[e-h]^r}for(n=0;e;n++,e--){r=l[n&3?e:e-4];if(e<=4||n<4){u[n]=r}else{u[n]=a[0][o[r>>>24]]^a[1][o[r>>16&255]]^a[2][o[r>>8&255]]^a[3][o[r&255]]}}}decrypt(t,e,i,s,n,r){const o=this._key[1];let a=t^o[0];let h=s^o[1];let c=i^o[2];let l=e^o[3];let u;let f;let d;const p=o.length/4-2;let v;let m=4;const g=this._tables[1];const b=g[0];const y=g[1];const j=g[2];const w=g[3];const T=g[4];for(v=0;v<p;v++){u=b[a>>>24]^y[h>>16&255]^j[c>>8&255]^w[l&255]^o[m];f=b[h>>>24]^y[c>>16&255]^j[l>>8&255]^w[a&255]^o[m+1];d=b[c>>>24]^y[l>>16&255]^j[a>>8&255]^w[h&255]^o[m+2];l=b[l>>>24]^y[a>>16&255]^j[h>>8&255]^w[c&255]^o[m+3];m+=4;a=u;h=f;c=d}for(v=0;v<4;v++){n[(3&-v)+r]=T[a>>>24]<<24^T[h>>16&255]<<16^T[c>>8&255]<<8^T[l&255]^o[m++];u=a;a=h;h=c;c=l;l=u}}}class r extends t{constructor(){super(t);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const o=function(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};const a=function(t,e,i){const s=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);const r=new n(Array.prototype.slice.call(e));const a=new Uint8Array(t.byteLength);const h=new Int32Array(a.buffer);let c;let l;let u;let f;let d;let p;let v;let m;let g;c=i[0];l=i[1];u=i[2];f=i[3];for(g=0;g<s.length;g+=4){d=o(s[g]);p=o(s[g+1]);v=o(s[g+2]);m=o(s[g+3]);r.decrypt(d,p,v,m,h,g);h[g]=o(h[g]^c);h[g+1]=o(h[g+1]^l);h[g+2]=o(h[g+2]^u);h[g+3]=o(h[g+3]^f);c=d;l=p;u=v;f=m}return a};class h{constructor(t,i,s,n){const a=h.STEP;const c=new Int32Array(t.buffer);const l=new Uint8Array(t.byteLength);let u=0;this.asyncStream_=new r;this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l));for(u=a;u<c.length;u+=a){s=new Uint32Array([o(c[u-4]),o(c[u-3]),o(c[u-2]),o(c[u-1])]);this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l))}this.asyncStream_.push((function(){n(null,e(l))}))}static get STEP(){return 32e3}decryptChunk_(t,e,i,s){return function(){const n=a(t,e,i);s.set(n,t.byteOffset)}}}var c=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var l;if(typeof window!=="undefined"){l=window}else if(typeof c!=="undefined"){l=c}else if(typeof self!=="undefined"){l=self}else{l={}}var u=l;var f=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var d=u.BigInt||Number;[d("0x1"),d("0x100"),d("0x10000"),d("0x1000000"),d("0x100000000"),d("0x10000000000"),d("0x1000000000000"),d("0x100000000000000"),d("0x10000000000000000")];const p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(f(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};self.onmessage=function(t){const e=t.data;const i=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength);const s=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4);const n=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new h(i,s,n,(function(t,i){self.postMessage(p({source:e.source,decrypted:i}),[i.buffer])}))}})));var kg=mv(Tg);const Sg=t=>{let e=t.default?"main":"alternative";if(t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0){e="main-desc"}return e};const xg=(t,e)=>{t.abort();t.pause();if(e&&e.activePlaylistLoader){e.activePlaylistLoader.pause();e.activePlaylistLoader=null}};const Ag=(t,e)=>{e.activePlaylistLoader=t;t.load()};const Eg=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:s},mediaTypes:{[t]:n}}=e;const r=n.activeTrack();const o=n.getActiveGroup();const a=n.activePlaylistLoader;const h=n.lastGroup_;if(o&&h&&o.id===h.id){return}n.lastGroup_=o;n.lastTrack_=r;xg(i,n);if(!o||o.isMainPlaylist){return}if(!o.playlistLoader){if(a){s.resetEverything()}return}i.resyncLoader();Ag(o.playlistLoader,n)};const Ig=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;s.lastGroup_=null;i.abort();i.pause()};const Dg=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:s,main:n},mediaTypes:{[t]:r}}=e;const o=r.activeTrack();const a=r.getActiveGroup();const h=r.activePlaylistLoader;const c=r.lastTrack_;if(c&&o&&c.id===o.id){return}r.lastGroup_=a;r.lastTrack_=o;xg(s,r);if(!a){return}if(a.isMainPlaylist){if(!o||!c||o.id===c.id){return}const t=e.vhs.playlistController_;const s=t.selectPlaylist();if(t.media()===s){return}r.logger_(`track change. Switching main audio from ${c.id} to ${o.id}`);i.pause();n.resetEverything();t.fastQualityChange_(s);return}if(t==="AUDIO"){if(!a.playlistLoader){n.setAudio(true);n.resetEverything();return}s.setAudio(true);n.setAudio(false)}if(h===a.playlistLoader){Ag(a.playlistLoader,r);return}if(s.track){s.track(o)}s.resetEverything();Ag(a.playlistLoader,r)};const Cg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:s}=e;const n=i.activeTrack();const r=i.activeGroup();const o=(r.filter((t=>t.default))[0]||r[0]).id;const a=i.tracks[o];if(n===a){s({error:{message:"Problem encountered loading the default audio track."}});return}cd.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const t in i.tracks){i.tracks[t].enabled=i.tracks[t]===a}i.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;cd.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");const s=i.activeTrack();if(s){s.mode="disabled"}i.onTrackChanged()}};const Ng={AUDIO:(t,e,i)=>{if(!e){return}const{tech:s,requestOptions:n,segmentLoaders:{[t]:r}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[t]:r},mediaTypes:{[t]:o}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);r.track(o.activeTrack());if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))}};const _g={AUDIO:(t,e)=>{const{vhs:i,sourceType:s,segmentLoaders:{[t]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[t]:{groups:a,tracks:h,logger_:c}},mainPlaylistLoader:l}=e;const u=sp(l.main);if(!o[t]||Object.keys(o[t]).length===0){o[t]={main:{default:{default:true}}};if(u){o[t].main.default.playlists=l.main.playlists}}for(const n in o[t]){if(!a[n]){a[n]=[]}for(const f in o[t][n]){let d=o[t][n][f];let p;if(u){c(`AUDIO group '${n}' label '${f}' is a main playlist`);d.isMainPlaylist=true;p=null}else if(s==="vhs-json"&&d.playlists){p=new Ip(d.playlists[0],i,r)}else if(d.resolvedUri){p=new Ip(d.resolvedUri,i,r)}else if(d.playlists&&s==="dash"){p=new uv(d.playlists[0],i,r,l)}else{p=null}d=bd({id:f,playlistLoader:p},d);Ng[t](t,d.playlistLoader,e);a[n].push(d);if(typeof h[f]==="undefined"){const t=new cd.AudioTrack({id:f,kind:Sg(d),enabled:false,language:d.language,default:d.default,label:f});h[f]=t}}}n.on("error",Cg[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[t]:r},requestOptions:o,main:{mediaGroups:a},mediaTypes:{[t]:{groups:h,tracks:c}},mainPlaylistLoader:l}=e;for(const r in a[t]){if(!h[r]){h[r]=[]}for(const u in a[t][r]){if(!s.options_.useForcedSubtitles&&a[t][r][u].forced){continue}let f=a[t][r][u];let d;if(n==="hls"){d=new Ip(f.resolvedUri,s,o)}else if(n==="dash"){const t=f.playlists.filter((t=>t.excludeUntil!==Infinity));if(!t.length){return}d=new uv(f.playlists[0],s,o,l)}else if(n==="vhs-json"){d=new Ip(f.playlists?f.playlists[0]:f.resolvedUri,s,o)}f=bd({id:u,playlistLoader:d},f);Ng[t](t,f.playlistLoader,e);h[r].push(f);if(typeof c[u]==="undefined"){const t=i.addRemoteTextTrack({id:u,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:u},false).track;c[u]=t}}}r.on("error",Cg[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const e in s[t]){if(!n[e]){n[e]=[]}for(const o in s[t][e]){const a=s[t][e][o];if(!/^(?:CC|SERVICE)/.test(a.instreamId)){continue}const h=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:o,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};if(h[c.instreamId]){c=bd(c,h[c.instreamId])}if(c.default===undefined){delete c.default}n[e].push(bd({id:o},a));if(typeof r[o]==="undefined"){const t=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},false).track;r[o]=t}}}}};const Og=(t,e)=>{for(let i=0;i<t.length;i++){if(ep(e,t[i])){return true}if(t[i].playlists&&Og(t[i].playlists,e)){return true}}return false};const Mg=(t,e)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[t]:{groups:n}}}=e;const r=s.media();if(!r){return null}let o=null;if(r.attributes[t]){o=n[r.attributes[t]]}const a=Object.keys(n);if(!o){if(t==="AUDIO"&&a.length>1&&sp(e.main)){for(let t=0;t<a.length;t++){const e=n[a[t]];if(Og(e,r)){o=e;break}}}else if(n.main){o=n.main}else if(a.length===1){o=n[a[0]]}}if(typeof i==="undefined"){return o}if(i===null||!o){return null}return o.filter((t=>t.id===i.id))[0]||null};const Rg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].enabled){return i[t]}}return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].mode==="showing"||i[t].mode==="hidden"){return i[t]}}return null}};const Lg=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();if(!i){return null}return e[t].activeGroup(i)};const Pg=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{_g[e](e,t)}));const{mediaTypes:e,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:o}}=t;["AUDIO","SUBTITLES"].forEach((i=>{e[i].activeGroup=Mg(i,t);e[i].activeTrack=Rg[i](i,t);e[i].onGroupChanged=Eg(i,t);e[i].onGroupChanging=Ig(i,t);e[i].onTrackChanged=Dg(i,t);e[i].getActiveGroup=Lg(i,t)}));const a=e.AUDIO.activeGroup();if(a){const t=(a.filter((t=>t.default))[0]||a[0]).id;e.AUDIO.tracks[t].enabled=true;e.AUDIO.onGroupChanged();e.AUDIO.onTrackChanged();const i=e.AUDIO.getActiveGroup();if(!i.playlistLoader){o.setAudio(true)}else{o.setAudio(false);r.setAudio(true)}}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanged()))}));i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanging()))}));const h=()=>{e.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",h);s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged);n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",h);s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}));s.clearTracks("audio");for(const t in e.AUDIO.tracks){s.audioTracks().addTrack(e.AUDIO.tracks[t])}};const $g=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Wm,activeTrack:Wm,getActiveGroup:Wm,onGroupChanged:Wm,onTrackChanged:Wm,lastTrack_:null,logger_:gd(`MediaGroups[${e}]`)}}));return t};class Fg{constructor(){this.priority_=[];this.pathwayClones_=new Map}set version(t){if(t===1){this.version_=t}}set ttl(t){this.ttl_=t||300}set reloadUri(t){if(t){this.reloadUri_=vd(this.reloadUri_,t)}}set priority(t){if(t&&t.length){this.priority_=t}}set pathwayClones(t){if(t&&t.length){this.pathwayClones_=new Map(t.map((t=>[t.ID,t])))}}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Ug extends cd.EventTarget{constructor(t,e){super();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=false;this.availablePathways_=new Set;this.steeringManifest=new Fg;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.currentPathwayClones=new Map;this.nextPathwayClones=new Map;this.excludedSteeringManifestURLs=new Set;this.logger_=gd("Content Steering");this.xhr_=t;this.getBandwidth_=e}assignTagProperties(t,e){this.manifestType_=e.serverUri?"HLS":"DASH";const i=e.serverUri||e.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`);this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=vd(t,i);this.defaultPathway=e.pathwayId||e.defaultServiceLocation;this.queryBeforeStart=e.queryBeforeStart;this.proxyServerUrl_=e.proxyServerURL;if(this.defaultPathway&&!this.queryBeforeStart){this.trigger("content-steering")}}requestSteeringManifest(t){const e=this.steeringManifest.reloadUri;if(!e){return}const i=t?e:this.getRequestURI(e);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering.");this.trigger("error");this.dispose();return}const s={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:s});this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((t,e)=>{if(t){if(e.status===410){this.logger_(`manifest request 410 ${t}.`);this.logger_(`There will be no more content steering requests to ${i} this session.`);this.excludedSteeringManifestURLs.add(i);return}if(e.status===429){const i=e.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${t}.`);this.logger_(`content steering will retry in ${i} seconds.`);this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${t}.`);this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let n;try{n=JSON.parse(this.request_.responseText)}catch(t){const e={errorType:cd.Error.StreamingContentSteeringParserError,error:t};this.trigger({type:"error",metadata:e})}this.assignSteeringProperties_(n);const r={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:r});this.startTTLTimeout_()}))}setProxyServerUrl_(t){const e=new z.URL(t);const i=new z.URL(this.proxyServerUrl_);i.searchParams.set("url",encodeURI(e.toString()));return this.setSteeringParams_(i.toString())}decodeDataUriManifest_(t){const e=JSON.parse(z.atob(t));this.assignSteeringProperties_(e)}setSteeringParams_(t){const e=new z.URL(t);const i=this.getPathway();const s=this.getBandwidth_();if(i){const t=`_${this.manifestType_}_pathway`;e.searchParams.set(t,i)}if(s){const t=`_${this.manifestType_}_throughput`;e.searchParams.set(t,s)}return e.toString()}assignSteeringProperties_(t){this.steeringManifest.version=t.VERSION;if(!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`);this.trigger("error");return}this.steeringManifest.ttl=t.TTL;this.steeringManifest.reloadUri=t["RELOAD-URI"];this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"];this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"];this.nextPathwayClones=this.steeringManifest.pathwayClones;if(!this.availablePathways_.size){this.logger_("There are no available pathways for content steering. Ending content steering.");this.trigger("error");this.dispose()}const e=t=>{for(const e of t){if(this.availablePathways_.has(e)){return e}}return[...this.availablePathways_][0]};const i=e(this.steeringManifest.priority);if(this.currentPathway!==i){this.currentPathway=i;this.trigger("content-steering")}}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t){return null}const e=t=>this.excludedSteeringManifestURLs.has(t);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!e(i)){return i}}const i=this.setSteeringParams_(t);if(!e(i)){return i}return null}startTTLTimeout_(t=this.steeringManifest.ttl){const e=t*1e3;this.ttlTimeout_=z.setTimeout((()=>{this.requestSteeringManifest()}),e)}clearTTLTimeout_(){z.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){if(this.request_){this.request_.abort()}this.request_=null}dispose(){this.off("content-steering");this.off("error");this.abort();this.clearTTLTimeout_();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=null;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.excludedSteeringManifestURLs=new Set;this.availablePathways_=new Set;this.steeringManifest=new Fg}addAvailablePathway(t){if(t){this.availablePathways_.add(t)}}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,e){return!e&&this.steeringManifest.reloadUri||e&&(vd(t,e.serverURL)!==this.steeringManifest.reloadUri||e.defaultServiceLocation!==this.defaultPathway||e.queryBeforeStart!==this.queryBeforeStart||e.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Bg=10;let qg;const Vg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const zg=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};const Hg=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:a,log:h}){if(!s){cd.log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t){h(`${c} as current playlist is not set`);return true}if(s.id===t.id){return false}const l=Boolean(Sd(e,i).length);if(!t.endList){if(!l&&typeof t.partTargetDuration==="number"){h(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}h(`${c} as current playlist is live`);return true}const u=Od(e,i);const f=a?fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:fv.MAX_BUFFER_LOW_WATER_LINE;if(o<f){h(`${c} as duration < max low water line (${o} < ${f})`);return true}const d=s.attributes.BANDWIDTH;const p=t.attributes.BANDWIDTH;if(d<p&&(!a||u<r)){let t=`${c} as next bandwidth < current bandwidth (${d} < ${p})`;if(a){t+=` and forwardBuffer < bufferHighWaterLine (${u} < ${r})`}h(t);return true}if((!a||d>p)&&u>=n){let t=`${c} as forwardBuffer >= bufferLowWaterLine (${u} >= ${n})`;if(a){t+=` and next bandwidth > current bandwidth (${d} > ${p})`}h(t);return true}h(`not ${c} as no switching criteria met`);return false};class Xg extends cd.EventTarget{constructor(t){super();const{src:e,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:o,playlistExclusionDuration:a,enableLowInitialPlaylist:h,sourceType:c,cacheEncryptionKeys:l,bufferBasedABR:u,leastPixelDiffSelector:f,captionServices:d}=t;if(!e){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=t;if(p===null||typeof p==="undefined"){p=Infinity}qg=r;this.bufferBasedABR=Boolean(u);this.leastPixelDiffSelector=Boolean(f);this.withCredentials=i;this.tech_=s;this.vhs_=s.vhs;this.player_=t.player_;this.sourceType_=c;this.useCueTags_=o;this.playlistExclusionDuration=a;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=h;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=$g();this.mediaSource=new z.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=yd();this.hasPlayed_=false;this.syncController_=new jg(t);this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new kg;this.sourceUpdater_=new og(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new wg;this.keyStatusMap_=new Map;const v={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:d,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:l,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uv(e,this.vhs_,bd(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ip(e,this.vhs_,bd(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new Ym(bd(v,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t);this.audioSegmentLoader_=new Ym(bd(v,{loaderType:"audio"}),t);this.subtitleSegmentLoader_=new ug(bd(v,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((t,e)=>{function i(){s.off("vttjserror",n);t()}function n(){s.off("vttjsloaded",i);e()}s.one("vttjsloaded",i);s.one("vttjserror",n);s.addWebVttScript_()}))}),t);const m=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new Ug(this.vhs_.xhr,m);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_()));this.tech_.on("pause",(()=>this.stopABRTimer_()));this.tech_.on("play",(()=>this.startABRTimer_()))}Vg.forEach((t=>{this[t+"_"]=zg.bind(this,t)}));this.logger_=gd("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const g=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(g,(()=>{const t=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-t;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_();const e=this.audioAppendsToLoadedData_();if(t===-1||e===-1){return-1}return t+e}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const e=this.selectPlaylist();if(e&&this.shouldSwitchToMedia_(e)){this.switchMedia_(e,t)}}switchMedia_(t,e,i){const s=this.media();const n=s&&(s.id||s.uri);const r=t&&(t.id||t.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${e}`);const i={renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:e};this.trigger({type:"renditionselected",metadata:i});this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${e}`})}this.mainPlaylistLoader_.media(t,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{const e=this.mediaTypes_[t];const i=e?e.activeGroup():null;const s=this.contentSteeringController_.getPathway();if(i&&s){const e=i.length?i[0].playlists:i.playlists;const n=e.filter((t=>t.attributes.serviceLocation===s));if(n.length){this.mediaTypes_[t].activePlaylistLoader.media(n[0])}}}))}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=z.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}z.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const t=i.main||s.length&&i[s[0]];for(const e in t){if(t[e].default){n={label:e};break}}}if(!n){return e}const r=[];for(const e in i){if(i[e][n.label]){const s=i[e][n.label];if(s.playlists&&s.playlists.length){r.push.apply(r,s.playlists)}else if(s.uri){r.push(s)}else if(t.playlists.length){for(let i=0;i<t.playlists.length;i++){const s=t.playlists[i];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===e){r.push(s)}}}}}if(!r.length){return e}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(t.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.mainSegmentLoader_.load()}Pg({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),t);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))}}));this.mainPlaylistLoader_.on("loadedplaylist",(()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}));this.mainPlaylistLoader_.on("error",(()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()}));this.mainPlaylistLoader_.on("mediachange",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(this.sourceType_==="dash"){this.mainPlaylistLoader_.load()}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}else{this.mainSegmentLoader_.load()}this.tech_.trigger({type:"mediachange",bubbles:true})}));this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged"){return}const e=this.stuckAtPlaylistEnd_(t);if(e){this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}});this.tech_.trigger("playliststuck")}}));this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}));this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}));const t=["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"];t.forEach((t=>{this.mainPlaylistLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}handleUpdatedMediaPlaylist(t){if(this.useCueTags_){this.updateAdCues_(t)}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}this.updateDuration(!t.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(t,e){const i=t.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const t in i.AUDIO){for(const e in i.AUDIO[t]){const n=i.AUDIO[t][e];if(!n.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(qg.Playlist.isAes(e)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(t){const e=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return Hg({buffered:r,currentTime:i,currentPlaylist:e,nextPlaylist:t,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")}));this.mainSegmentLoader_.on("timeout",(()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}}));if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")}))}this.mainSegmentLoader_.on("error",(()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")}));this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()}));this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}));this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()}));this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")}));this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended");this.onEndOfStream()}));this.mainSegmentLoader_.on("earlyabort",(t=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:Bg})}));const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t);this.audioSegmentLoader_.on("trackinfo",t);this.mainSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()}));const e=["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"];e.forEach((t=>{this.mainSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.audioSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.subtitleSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality");this.waitingForFastQualityPlaylistReceived_=true}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=false;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything((()=>{this.mainSegmentLoader_.load()}))}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const t=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<t.start(0)){return this.tech_.setCurrentTime(t.end(t.length-1))}}}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_){return false}if(!t.endList||t.start){const e=this.seekable();if(!e.length){return false}const i=e.end(0);let s=i;if(t.start){const n=t.start.timeOffset;if(n<0){s=Math.max(i+n,e.start(0))}else{s=Math.min(i,n)}}this.trigger("firstplay");this.tech_.setCurrentTime(s)}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const t=this.tech_.play();if(typeof t!=="undefined"&&typeof t.then==="function"){t.then(null,(t=>{}))}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length){return}const e=this.duration();t[t.length-1].endTime=isNaN(e)||Math.abs(e)===Infinity?Number.MAX_VALUE:e}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const e=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!e||e.hasVideo){t=t&&this.audioSegmentLoader_.ended_}else{t=this.audioSegmentLoader_.ended_}}if(!t){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(t){const e=this.seekable();if(!e.length){return false}const i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return false}const s=qg.Playlist.playlistEnd(t,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=Td}const o=r.end(r.length-1);return o-n<=Td&&s-o<=Td}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:i}){t=t||this.mainPlaylistLoader_.media();i=i||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!t){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}t.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const n=s.filter(Wd);const r=n.length===1&&n[0]===t;if(s.length===1&&i!==Infinity){cd.log.warn(`Problem encountered with playlist ${t.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){if(this.main().contentSteering){const e=this.pathwayAttribute_(t);const i=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(e);this.excludeThenChangePathway_();setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(e)}),i);return}let e=false;s.forEach((i=>{if(i===t){return}const s=i.excludeUntil;if(typeof s!=="undefined"&&s!==Infinity){e=true;delete i.excludeUntil}}));if(e){cd.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let o;if(t.playlistErrors_>this.maxPlaylistRetries){o=Infinity}else{o=Date.now()+i*1e3}t.excludeUntil=o;if(e.reason){t.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const a=this.selectPlaylist();if(!a){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const h=e.internal?this.logger_:cd.log.warn;const c=e.message?" "+e.message:"";h(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.`+`${c} Switching to playlist ${a.id}.`);if(a.attributes.AUDIO!==t.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(a.attributes.SUBTITLES!==t.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const l=a.targetDuration/2*1e3||5*1e3;const u=typeof a.lastRequest==="number"&&Date.now()-a.lastRequest<=l;return this.switchMedia_(a,"exclude",r||u)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(t,e){const i=[];const s=t==="all";if(s||t==="main"){i.push(this.mainPlaylistLoader_)}const n=[];if(s||t==="audio"){n.push("AUDIO")}if(s||t==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach((t=>{const e=this.mediaTypes_[t]&&this.mediaTypes_[t].activePlaylistLoader;if(e){i.push(e)}}));["main","audio","subtitle"].forEach((e=>{const s=this[`${e}SegmentLoader_`];if(s&&(t===e||t==="all")){i.push(s)}}));i.forEach((t=>e.forEach((e=>{if(typeof t[e]==="function"){t[e]()}}))))}setCurrentTime(t){const e=Sd(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(e&&e.length){return t}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const t=this.mainPlaylistLoader_.media();if(!t){return 0}if(!t.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return qg.Playlist.duration(t)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let t;if(!this.mainPlaylistLoader_){return}let e=this.mainPlaylistLoader_.media();if(!e){return}let i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){e=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}t=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(t.length===0){return}}let r;let o;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);o=this.seekable_.start(0)}if(!t){this.seekable_=n}else if(t.start(0)>n.end(0)||n.start(0)>t.end(0)){this.seekable_=n}else{this.seekable_=yd([[t.start(0)>n.start(0)?t.start(0):n.start(0),t.end(0)<n.end(0)?t.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===o){return}}this.logger_(`seekable updated [${Id(this.seekable_)}]`);const a={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:a});this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const t=this.seekable();if(!t.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1)){this.sourceUpdater_.setDuration(t.end(t.length-1))}return}const e=this.tech_.buffered();let i=qg.Playlist.duration(this.mainPlaylistLoader_.media());if(e.length>0){i=Math.max(i,e.end(e.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();this.contentSteeringController_.dispose();this.keyStatusMap_.clear();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach((t=>{const e=this.mediaTypes_[t].groups;for(const t in e){e[t].forEach((t=>{if(t.playlistLoader){t.playlistLoader.dispose()}}))}}));this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_)}this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const e=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!t?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!e||!i){return false}return true}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const e=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const i=sm(this.main(),e);const s={};const n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo){s.video=i.video||t.main.videoCodec||ti}if(t.main.isMuxed){s.video+=`,${i.audio||t.main.audioCodec||Ze}`}if(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n){s.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||Ze;t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:e,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(t,e)=>t?Ke(e):Qe(e);const o={};let a;["video","audio"].forEach((function(e){if(s.hasOwnProperty(e)&&!r(t[e].isFmp4,s[e])){const i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[];o[i].push(s[e]);if(e==="audio"){a=i}}}));if(n&&a&&e.attributes.AUDIO){const t=e.attributes.AUDIO;this.main().playlists.forEach((i=>{const s=i.attributes&&i.attributes.AUDIO;if(s===t&&i!==e){i.excludeUntil=Infinity}}));this.logger_(`excluding audio group ${t} as ${a} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const t=Object.keys(o).reduce(((t,e)=>{if(t){t+=", "}t+=`${e} does not support codec(s): "${o[e].join(",")}"`;return t}),"")+".";this.excludePlaylist({playlistToExclude:e,error:{internal:true,message:t},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];["video","audio"].forEach((e=>{const i=(Xe(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const n=(Xe(s[e]||"")[0]||{}).type;if(i&&n&&i.toLowerCase()!==n.toLowerCase()){t.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)}}));if(t.length){this.excludePlaylist({playlistToExclude:e,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.createSourceBuffers(t);const e=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(e)}excludeUnsupportedVariants_(){const t=this.main().playlists;const e=[];Object.keys(t).forEach((i=>{const s=t[i];if(e.indexOf(s.id)!==-1){return}e.push(s.id);const n=sm(this.main,s);const r=[];if(n.audio&&!Qe(n.audio)&&!Ke(n.audio)){r.push(`audio codec ${n.audio}`)}if(n.video&&!Qe(n.video)&&!Ke(n.video)){r.push(`video codec ${n.video}`)}if(n.text&&n.text==="stpp.ttml.im1t"){r.push(`text codec ${n.text}`)}if(r.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`)}}))}excludeIncompatibleVariants_(t){const e=[];const i=this.main().playlists;const s=em(Xe(t));const n=im(s);const r=s.video&&Xe(s.video)[0]||null;const o=s.audio&&Xe(s.audio)[0]||null;Object.keys(i).forEach((t=>{const s=i[t];if(e.indexOf(s.id)!==-1||s.excludeUntil===Infinity){return}e.push(s.id);const a=[];const h=sm(this.mainPlaylistLoader_.main,s);const c=im(h);if(!h.audio&&!h.video){return}if(c!==n){a.push(`codec count "${c}" !== "${n}"`)}if(!this.sourceUpdater_.canChangeType()){const t=h.video&&Xe(h.video)[0]||null;const e=h.audio&&Xe(h.audio)[0]||null;if(t&&r&&t.type.toLowerCase()!==r.type.toLowerCase()){a.push(`video codec "${t.type}" !== "${r.type}"`)}if(e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()){a.push(`audio codec "${e.type}" !== "${o.type}"`)}}if(a.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id}: ${a.join(" && ")}`)}}))}updateAdCues_(t){let e=0;const i=this.seekable();if(i.length){e=i.start(0)}dg(t,this.cueTagsTrack_,e)}goalBufferLength(){const t=this.tech_.currentTime();const e=fv.GOAL_BUFFER_LENGTH;const i=fv.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(e,fv.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,s)}bufferLowWaterLine(){const t=this.tech_.currentTime();const e=fv.BUFFER_LOW_WATER_LINE;const i=fv.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(e,fv.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(e,fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return fv.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Sm(this.inbandTextTracks_,"com.apple.streaming",this.tech_);km({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,e,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Sm(this.inbandTextTracks_,t,this.tech_);jm({inbandTextTracks:this.inbandTextTracks_,metadataArray:e,timestampOffset:s,videoDuration:i})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(!t.contentSteering){return}for(const e of t.playlists){this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(e))}this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering);if(this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(true);return}this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));const t=["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];t.forEach((t=>{this.contentSteeringController_.on(t,(t=>{this.trigger(it({},t))}))}));if(this.sourceType_==="dash"){this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const t=this.main();const e=this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering);const i=()=>{const e=this.contentSteeringController_.getAvailablePathways();const i=[];for(const s of t.playlists){const t=s.attributes.serviceLocation;if(t){i.push(t);if(!e.has(t)){return true}}}if(!i.length&&e.size){return true}return false};if(e||i()){this.resetContentSteeringController_()}}))}}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t){return}this.handlePathwayClones_();const e=this.main();const i=e.playlists;const s=new Set;let n=false;Object.keys(i).forEach((e=>{const r=i[e];const o=this.pathwayAttribute_(r);const a=o&&t!==o;const h=r.excludeUntil===Infinity&&r.lastExcludeReason_==="content-steering";if(h&&!a){delete r.excludeUntil;delete r.lastExcludeReason_;n=true}const c=!r.excludeUntil&&r.excludeUntil!==Infinity;const l=!s.has(r.id)&&a&&c;if(!l){return}s.add(r.id);r.excludeUntil=Infinity;r.lastExcludeReason_="content-steering";this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`)}));if(this.contentSteeringController_.manifestType_==="DASH"){Object.keys(this.mediaTypes_).forEach((e=>{const i=this.mediaTypes_[e];if(i.activePlaylistLoader){const e=i.activePlaylistLoader.media_;if(e&&e.attributes.serviceLocation!==t){n=true}}}))}if(n){this.changeSegmentPathway_()}}handlePathwayClones_(){const t=this.main();const e=t.playlists;const i=this.contentSteeringController_.currentPathwayClones;const s=this.contentSteeringController_.nextPathwayClones;const n=i&&i.size||s&&s.size;if(!n){return}for(const[t,e]of i.entries()){const i=s.get(t);if(!i){this.mainPlaylistLoader_.updateOrDeleteClone(e);this.contentSteeringController_.excludePathway(t)}}for(const[t,n]of s.entries()){const s=i.get(t);if(!s){const i=e.filter((t=>t.attributes["PATHWAY-ID"]===n["BASE-ID"]));i.forEach((t=>{this.mainPlaylistLoader_.addClonePathway(n,t)}));this.contentSteeringController_.addAvailablePathway(t);continue}if(this.equalPathwayClones_(s,n)){continue}this.mainPlaylistLoader_.updateOrDeleteClone(n,true);this.contentSteeringController_.addAvailablePathway(t)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}equalPathwayClones_(t,e){if(t["BASE-ID"]!==e["BASE-ID"]||t.ID!==e.ID||t["URI-REPLACEMENT"].HOST!==e["URI-REPLACEMENT"].HOST){return false}const i=t["URI-REPLACEMENT"].PARAMS;const s=e["URI-REPLACEMENT"].PARAMS;for(const t in i){if(i[t]!==s[t]){return false}}for(const t in s){if(i[t]!==s[t]){return false}}return true}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading();if(this.contentSteeringController_.manifestType_==="DASH"){this.switchMediaForDASHContentSteering_()}this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main){return}let t=0;const e="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);if(!s||!s.size){return}s.forEach((s=>{const n="usable";const r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n;const o=i.lastExcludeReason_===e&&i.excludeUntil===Infinity;if(!r){if(i.excludeUntil!==Infinity&&i.lastExcludeReason_!==e){i.excludeUntil=Infinity;i.lastExcludeReason_=e;this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${n}`)}t++}else if(r&&o){delete i.excludeUntil;delete i.lastExcludeReason_;this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)}}))}));if(t>=this.mainPlaylistLoader_.main.playlists.length){this.mainPlaylistLoader_.main.playlists.forEach((t=>{const i=t&&t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height<720;const s=t.excludeUntil===Infinity&&t.lastExcludeReason_===e;if(i&&s){delete t.excludeUntil;cd.log.warn(`enabling non-HD playlist ${t.id} because all playlists were excluded due to ${e} key IDs`)}}))}}addKeyStatus_(t,e){const i=typeof t==="string";const s=i?t:hg(t);const n=s.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${e}' with key ID ${n} added to the keyStatusMap`);this.keyStatusMap_.set(n,e)}updatePlaylistByKeyStatus(t,e){this.addKeyStatus_(t,e);if(!this.waitingForFastQualityPlaylistReceived_){this.excludeNonUsableThenChangePlaylist_()}this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this));this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_();this.fastQualityChange_()}}const Gg=(t,e,i)=>s=>{const n=t.main.playlists[e];const r=Yd(n);const o=Wd(n);if(typeof s==="undefined"){return o}if(s){delete n.disabled}else{n.disabled=true}const a={renditionInfo:{id:e,bandwidth:n.attributes.BANDWIDTH,resolution:n.attributes.RESOLUTION,codecs:n.attributes.CODECS},cause:"fast-quality"};if(s!==o&&!r){i(n);if(s){t.trigger({type:"renditionenabled",metadata:a})}else{t.trigger({type:"renditiondisabled",metadata:a})}}return s};class Yg{constructor(t,e,i){const{playlistController_:s}=t;const n=s.fastQualityChange_.bind(s);if(e.attributes){const t=e.attributes.RESOLUTION;this.width=t&&t.width;this.height=t&&t.height;this.bandwidth=e.attributes.BANDWIDTH;this.frameRate=e.attributes["FRAME-RATE"]}this.codecs=sm(s.main(),e);this.playlist=e;this.id=i;this.enabled=Gg(t.playlists,e.id,n)}}const Wg=function(t){t.representations=()=>{const e=t.playlistController_.main();const i=sp(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!i){return[]}return i.filter((t=>!Yd(t))).map(((e,i)=>new Yg(t,e,e.id)))}};const Jg=["seeking","seeked","pause","playing","error"];class Kg extends cd.EventTarget{constructor(t){super();this.playlistController_=t.playlistController;this.tech_=t.tech;this.seekable=t.seekable;this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta;this.media=t.media;this.playedRanges_=[];this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=gd("PlaybackWatcher");this.logger_("initialize");const e=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const o=["main","subtitle","audio"];const a={};o.forEach((t=>{a[t]={reset:()=>this.resetSegmentDownloads_(t),updateend:()=>this.checkSegmentDownloads_(t)};r[`${t}SegmentLoader_`].on("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].on("playlistupdate",a[t].reset);this.tech_.on(["seeked","seeking"],a[t].reset)}));const h=t=>{["main","audio"].forEach((e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();h("off")}};this.clearSeekingAppendCheck_=()=>h("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();h("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(Jg,n);this.tech_.on("canplay",i);this.tech_.one("play",e);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(Jg,n);this.tech_.off("canplay",i);this.tech_.off("play",e);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);o.forEach((t=>{r[`${t}SegmentLoader_`].off("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].off("playlistupdate",a[t].reset);this.tech_.off(["seeked","seeking"],a[t].reset)}));if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=z.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const e=this.playlistController_[`${t}SegmentLoader_`];if(this[`${t}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${t} loader`)}this[`${t}StalledDownloads_`]=0;this[`${t}Buffered_`]=e.buffered_()}checkSegmentDownloads_(t){const e=this.playlistController_;const i=e[`${t}SegmentLoader_`];const s=i.buffered_();const n=Nd(this[`${t}Buffered_`],s);this[`${t}Buffered_`]=s;if(n){const i={bufferedRanges:s};e.trigger({type:"bufferedrangeschanged",metadata:i});this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++;this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Cd(s)});if(this[`${t}StalledDownloads_`]<10){return}this.logger_(`${t} loader stalled download exclusion`);this.resetSegmentDownloads_(t);this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`});if(t==="subtitle"){return}e.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+Td>=e.end(e.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(t===this.lastRecordedTime){this.consecutiveUpdates++}else{this.playedRanges_.push(yd([this.lastRecordedTime,t]));const e={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:e});this.consecutiveUpdates=0;this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const t=this.tech_.seeking();if(!t){return false}const e=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const t=e.end(e.length-1);n=t}if(this.beforeSeekableWindow_(e,i)){const t=e.start(0);n=t+(t===e.end(0)?0:Td)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${Id(e)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const o=this.tech_.buffered();const a=r.audioBuffer?r.audioBuffered():null;const h=r.videoBuffer?r.videoBuffered():null;const c=this.media();const l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-wd)*2;const u=[a,h];for(let t=0;t<u.length;t++){if(!u[t]){continue}const e=Od(u[t],i);if(e<l){return false}}const f=xd(o,i);if(f.length===0){return false}n=f.start(0)+Td;this.logger_(`Buffered region starts (${f.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();const i=Sd(e,t);if(i.length&&t+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.logger_(`Stopped at ${t} while inside a buffered region `+`[${i.start(0)} -> ${i.end(0)}]. Attempting to resume `+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable();const e=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(t,e)){const i=t.end(t.length-1);this.logger_(`Fell out of live window at time ${e}. Seeking to `+`live point (seekable end) ${i}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(i);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:e});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=xd(s,e);if(r.length>0){this.logger_(`Stopped at ${e} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(e);return true}return false}afterSeekableWindow_(t,e,i,s=false){if(!t.length){return false}let n=t.end(t.length-1)+Td;const r=!i.endList;const o=typeof i.partTargetDuration==="number";if(r&&(o||s)){n=t.end(t.length-1)+i.targetDuration*3}if(e>n){return true}return false}beforeSeekableWindow_(t,e){if(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:t,audioBuffered:e,currentTime:i}){if(!t){return}let s;if(t.length&&e.length){const n=Sd(t,i-3);const r=Sd(t,i);const o=Sd(e,i);if(o.length&&!r.length&&n.length){s={start:n.end(0),end:o.end(0)}}}else{const e=xd(t,i);if(!e.length){s=this.gapFromVideoUnderflow_(t,i)}}if(s){this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. `+`Seeking to current time ${i}`);return true}return false}skipTheGap_(t){const e=this.tech_.buffered();const i=this.tech_.currentTime();const s=xd(e,i);this.resetTimeUpdate_();if(s.length===0||i!==t){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+wd);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n});this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,e){const i=Ad(t);for(let t=0;t<i.length;t++){const s=i.start(t);const n=i.end(t);if(e-s<4&&e-s>2){return{start:s,end:n}}}return null}}const Qg={errorInterval:30,getSource(t){const e=this.tech({IWillNotUseThisInPlugins:true});const i=e.currentSource_||this.currentSource();return t(i)}};const Zg=function(t,e){let i=0;let s=0;const n=bd(Qg,e);t.ready((()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){if(s){t.currentTime(s)}};const o=function(e){if(e===null||e===undefined){return}s=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const a=function(){if(Date.now()-i<n.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!=="function"){cd.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(t,o)};const h=function(){t.off("loadedmetadata",r);t.off("error",a);t.off("dispose",h)};const c=function(e){h();Zg(t,e)};t.on("error",a);t.on("dispose",h);t.reloadSourceOnError=c};const tb=function(t){Zg(this,t)};var eb="3.13.2";var ib="7.0.3";var sb="1.3.0";var nb="7.1.0";var rb="4.0.1";const ob={PlaylistLoader:Ip,Playlist:np,utils:zp,STANDARD_PLAYLIST_SELECTOR:um,INITIAL_PLAYLIST_SELECTOR:pm,lastBandwidthSelector:um,movingAverageBandwidthSelector:fm,comparePlaylistBandwidth:hm,comparePlaylistResolution:cm,xhr:_p()};Object.keys(fv).forEach((t=>{Object.defineProperty(ob,t,{get(){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return fv[t]},set(e){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){cd.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}fv[t]=e}})}));const ab="videojs-vhs";const hb=function(t,e){const i=e.media();let s=-1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){s=e;break}}t.selectedIndex_=s;t.trigger({selectedIndex:s,type:"change"})};const cb=function(t,e){e.representations().forEach((e=>{t.addQualityLevel(e)}));hb(t,e.playlists)};ob.canPlaySource=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const lb=(t,e,i)=>{if(!t){return t}let s={};if(e&&e.attributes&&e.attributes.CODECS){s=em(Xe(e.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=Je(s.video);const r=Je(s.audio);const o={};for(const i in t){o[i]={};if(r){o[i].audioContentType=r}if(n){o[i].videoContentType=n}if(e.contentProtection&&e.contentProtection[i]&&e.contentProtection[i].pssh){o[i].pssh=e.contentProtection[i].pssh}if(typeof t[i]==="string"){o[i].url=t[i]}}return bd(t,o)};const ub=(t,e)=>t.reduce(((t,i)=>{if(!i.contentProtection){return t}const s=e.reduce(((t,e)=>{const s=i.contentProtection[e];if(s&&s.pssh){t[e]={pssh:s.pssh}}return t}),{});if(Object.keys(s).length){t.push(s)}return t}),[]);const fb=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:s})=>{if(!t.eme.initializeMediaKeys){return Promise.resolve()}const n=i?s.concat([i]):s;const r=ub(n,Object.keys(e));const o=[];const a=[];r.forEach((e=>{a.push(new Promise(((e,i)=>{t.tech_.one("keysessioncreated",e)})));o.push(new Promise(((i,s)=>{t.eme.initializeMediaKeys({keySystems:e},(t=>{if(t){s(t);return}i()}))})))}));return Promise.race([Promise.all(o),Promise.race(a)])};const db=({player:t,sourceKeySystems:e,media:i,audioMedia:s})=>{const n=lb(e,i,s);if(!n){return false}t.currentSource().keySystems=n;if(n&&!t.eme){cd.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const pb=()=>{if(!z.localStorage){return null}const t=z.localStorage.getItem(ab);if(!t){return null}try{return JSON.parse(t)}catch(t){return null}};const vb=t=>{if(!z.localStorage){return false}let e=pb();e=e?bd(e,t):t;try{z.localStorage.setItem(ab,JSON.stringify(e))}catch(t){return false}return e};const mb=t=>{if(t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(t.substring(t.indexOf(",")+1))}return t};const gb=(t,e)=>{if(!t._requestCallbackSet){t._requestCallbackSet=new Set}t._requestCallbackSet.add(e)};const bb=(t,e)=>{if(!t._responseCallbackSet){t._responseCallbackSet=new Set}t._responseCallbackSet.add(e)};const yb=(t,e)=>{if(!t._requestCallbackSet){return}t._requestCallbackSet.delete(e);if(!t._requestCallbackSet.size){delete t._requestCallbackSet}};const jb=(t,e)=>{if(!t._responseCallbackSet){return}t._responseCallbackSet.delete(e);if(!t._responseCallbackSet.size){delete t._responseCallbackSet}};ob.supportsNativeHls=function(){if(!K||!K.createElement){return false}const t=K.createElement("video");if(!cd.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some((function(e){return/maybe|probably/i.test(t.canPlayType(e))}))}();ob.supportsNativeDash=function(){if(!K||!K.createElement||!cd.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(K.createElement("video").canPlayType("application/dash+xml"))}();ob.supportsTypeNatively=t=>{if(t==="hls"){return ob.supportsNativeHls}if(t==="dash"){return ob.supportsNativeDash}return false};ob.isSupported=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};ob.xhr.onRequest=function(t){gb(ob.xhr,t)};ob.xhr.onResponse=function(t){bb(ob.xhr,t)};ob.xhr.offRequest=function(t){yb(ob.xhr,t)};ob.xhr.offResponse=function(t){jb(ob.xhr,t)};const wb=cd.getComponent("Component");class Tb extends wb{constructor(t,e,i){super(e,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=gd("VhsHandler");if(e.options_&&e.options_.playerId){const t=cd.getPlayer(e.options_.playerId);this.player_=t}this.tech_=e;this.source_=t;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks){e.overrideNativeAudioTracks(true);e.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(K,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(t=>{const e=K.fullscreenElement||K.webkitFullscreenElement||K.mozFullScreenElement||K.msFullscreenElement;if(e&&e.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}}));this.on(this.tech_,"seeking",(function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())}));this.on(this.tech_,"error",(function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}}));this.on(this.tech_,"play",this.play)}setOptions_(t={}){this.options_=bd(this.options_,t);this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const t=pb();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=fv.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===fv.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((t=>{if(typeof this.source_[t]!=="undefined"){this.options_[t]=this.source_[t]}}));this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const e=this.options_.customPixelRatio;if(typeof e==="number"&&e>=0){this.customPixelRatio=e}}setOptions(t={}){this.setOptions_(t)}src(t,e){if(!t){return}this.setOptions_();this.options_.src=mb(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=ob;this.options_.sourceType=si(e);this.options_.seekTo=t=>{this.tech_.setCurrentTime(t)};this.options_.player_=this.player_;this.playlistController_=new Xg(this.options_);const i=bd({liveRangeSafeTimeDelta:Td},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Kg(i);this.attachStreamingEventListeners_();this.playlistController_.on("error",(()=>{const t=cd.players[this.tech_.options_.playerId];let e=this.playlistController_.error;if(typeof e==="object"&&!e.code){e.code=3}else if(typeof e==="string"){e={message:e,code:3}}t.error(e)}));const s=this.options_.bufferBasedABR?ob.movingAverageBandwidthSelector(.55):ob.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=ob.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.playlistController_.mainPlaylistLoader_;this.mediaSource=this.playlistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(t){this.playlistController_.selectPlaylist=t.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(t){this.playlistController_.mainSegmentLoader_.throughput.rate=t;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let t=this.playlistController_.mainSegmentLoader_.bandwidth;const e=z.navigator.connection||z.navigator.mozConnection||z.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&e){const s=e.downlink*1e3*1e3;if(s>=i&&t>=i){t=Math.max(t,s)}else{t=s}}return t},set(t){this.playlistController_.mainSegmentLoader_.bandwidth=t;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const t=1/(this.bandwidth||1);let e;if(this.throughput>0){e=1/this.throughput}else{e=0}const i=Math.floor(1/(t+e));return i},set(){cd.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>Cd(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>Cd(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",(()=>{if(this.options_.useBandwidthFromLocalStorage){vb({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}}));this.playlistController_.on("selectedinitialmedia",(()=>{Wg(this)}));this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()}));this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")}));this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=true}));this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=z.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");fb({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()})).catch((t=>{this.logger_("error while creating EME key session",t);this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const e=db({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(t=>{this.playlistController_.updatePlaylistByKeyStatus(t.keyId,t.status)}));this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!e){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=cd.players[this.tech_.options_.playerId];if(!t||!t.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=t.qualityLevels();this.playlistController_.on("selectedinitialmedia",(()=>{cb(this.qualityLevels_,this)}));this.playlists.on("mediachange",(()=>{hb(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":eb,"mux.js":ib,"mpd-parser":sb,"m3u8-parser":nb,"aes-decrypter":rb}}version(){return this.constructor.version()}canChangeType(){return og.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&z.URL.revokeObjectURL){z.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(t,e){return Qp({playlist:this.playlistController_.media(),time:t,callback:e})}seekToProgramTime(t,e,i=true,s=2){return Zp({programTime:t,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})}setupXhrHooks_(){this.xhr.onRequest=t=>{gb(this.xhr,t)};this.xhr.onResponse=t=>{bb(this.xhr,t)};this.xhr.offRequest=t=>{yb(this.xhr,t)};this.xhr.offResponse=t=>{jb(this.xhr,t)};this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];const e=["gapjumped","playedrangeschanged"];t.forEach((t=>{this.playlistController_.on(t,(t=>{this.player_.trigger(it({},t))}))}));e.forEach((t=>{this.playbackWatcher_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}}const kb={name:"videojs-http-streaming",VERSION:eb,canHandleSource(t,e={}){const i=bd(cd.options,e);return kb.canPlayType(t.type,i)},handleSource(t,e,i={}){const s=bd(cd.options,i);e.vhs=new Tb(t,e,s);e.vhs.xhr=_p();e.vhs.setupXhrHooks_();e.vhs.src(t.src,t.type);return e.vhs},canPlayType(t,e){const i=si(t);if(!i){return""}const s=kb.getOverrideNative(e);const n=ob.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t;const i=!(cd.browser.IS_ANY_SAFARI||cd.browser.IS_IOS);const{overrideNative:s=i}=e;return s}};const Sb=()=>Ke("avc1.4d400d,mp4a.40.2");if(Sb()){cd.getTech("Html5").registerSourceHandler(kb,0)}cd.VhsHandler=Tb;cd.VhsSourceHandler=kb;cd.Vhs=ob;if(!cd.use){cd.registerComponent("Vhs",ob)}cd.options.vhs=cd.options.vhs||{};if(!cd.getPlugin||!cd.getPlugin("reloadSourceOnError")){cd.registerPlugin("reloadSourceOnError",tb)}const xb=Object.freeze({__proto__:null,default:cd});var Ab={exports:{}};const Eb=q(xb);(function(t,e){(function(e,i){{var s=Eb;t.exports=i(s.default||s)}})(U,(function(t){var e=t.browser.IS_IOS||t.browser.IS_NATIVE_ANDROID;var i=t.getTech("Tech");class s extends i{constructor(t,i){super(t,i);this.setPoster(t.poster);this.setSrc(this.options_.source,true);this.setTimeout(function(){if(this.el_){this.el_.parentNode.className+=" vjs-youtube";if(e){this.el_.parentNode.className+=" vjs-youtube-mobile"}if(s.isApiReady){this.initYTPlayer()}else{s.apiReadyQueue.push(this)}}}.bind(this))}dispose(){if(this.ytPlayer){if(this.ytPlayer.stopVideo){this.ytPlayer.stopVideo()}if(this.ytPlayer.destroy){this.ytPlayer.destroy()}}else{var t=s.apiReadyQueue.indexOf(this);if(t!==-1){s.apiReadyQueue.splice(t,1)}}this.ytPlayer=null;this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile","");this.el_.parentNode.removeChild(this.el_);i.prototype.dispose.call(this)}createEl(){var t=document.createElement("div");t.setAttribute("id",this.options_.techId);t.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute");t.setAttribute("class","vjs-tech");var i=document.createElement("div");i.appendChild(t);if(!e&&!this.options_.ytControls){var s=document.createElement("div");s.setAttribute("class","vjs-iframe-blocker");s.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%");s.onclick=function(){this.pause()}.bind(this);i.appendChild(s)}return i}initYTPlayer(){var t={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(typeof this.options_.autohide!=="undefined"){t.autohide=this.options_.autohide}if(typeof this.options_["cc_load_policy"]!=="undefined"){t["cc_load_policy"]=this.options_["cc_load_policy"]}if(typeof this.options_.ytControls!=="undefined"){t.controls=this.options_.ytControls}if(typeof this.options_.disablekb!=="undefined"){t.disablekb=this.options_.disablekb}if(typeof this.options_.color!=="undefined"){t.color=this.options_.color}if(!t.controls){t.fs=0}else if(typeof this.options_.fs!=="undefined"){t.fs=this.options_.fs}if(this.options_.source.src.indexOf("end=")!==-1){var e=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(e[1])}if(typeof this.options_.end!=="undefined"){t.end=this.options_.end}if(typeof this.options_.hl!=="undefined"){t.hl=this.options_.hl}else if(typeof this.options_.language!=="undefined"){t.hl=this.options_.language.substr(0,2)}if(typeof this.options_["iv_load_policy"]!=="undefined"){t["iv_load_policy"]=this.options_["iv_load_policy"]}if(typeof this.options_.list!=="undefined"){t.list=this.options_.list}else if(this.url&&typeof this.url.listId!=="undefined"){t.list=this.url.listId}if(typeof this.options_.listType!=="undefined"){t.listType=this.options_.listType}if(typeof this.options_.modestbranding!=="undefined"){t.modestbranding=this.options_.modestbranding}if(typeof this.options_.playlist!=="undefined"){t.playlist=this.options_.playlist}if(typeof this.options_.playsinline!=="undefined"){t.playsinline=this.options_.playsinline}if(typeof this.options_.rel!=="undefined"){t.rel=this.options_.rel}if(typeof this.options_.showinfo!=="undefined"){t.showinfo=this.options_.showinfo}if(this.options_.source.src.indexOf("start=")!==-1){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(typeof this.options_.start!=="undefined"){t.start=this.options_.start}if(typeof this.options_.theme!=="undefined"){t.theme=this.options_.theme}if(typeof this.options_.customVars!=="undefined"){var s=this.options_.customVars;Object.keys(s).forEach((function(e){t[e]=s[e]}))}this.activeVideoId=this.url?this.url.videoId:null;this.activeList=t.list;var n={videoId:this.activeVideoId,playerVars:t,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};if(typeof this.options_.enablePrivacyEnhancedMode!=="undefined"&&this.options_.enablePrivacyEnhancedMode){n.host="https://www.youtube-nocookie.com"}this.ytPlayer=new YT.Player(this.options_.techId,n)}onPlayerReady(){if(this.options_.muted){this.ytPlayer.mute()}var t=this.ytPlayer.getAvailablePlaybackRates();if(t.length>1){this.featuresPlaybackRate=true}this.playerReady_=true;this.triggerReady();if(this.playOnReady){this.play()}else if(this.cueOnReady){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(t){var e=t.data;if(e===this.lastState||this.errorNumber){return}this.lastState=e;switch(e){case-1:this.trigger("loadstart");this.trigger("loadedmetadata");this.trigger("durationchange");this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate");this.trigger("durationchange");this.trigger("playing");this.trigger("play");if(this.isSeeking){this.onSeeked()}break;case YT.PlayerState.PAUSED:this.trigger("canplay");if(this.isSeeking){this.onSeeked()}else{this.trigger("pause")}break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate");this.player_.trigger("waiting");break}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(t){this.errorNumber=t.data;this.trigger("pause");this.trigger("error")}error(){var t=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:t,message:"Error while trying to play the video"};case 2:case 100:return{code:t,message:"Unable to find the video"};case 101:case 150:return{code:t,message:"Playback on other Websites has been disabled by the video owner."}}return{code:t,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.loadVideoById(e)}cueVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.cueVideoById(e)}src(t){if(t){this.setSrc({src:t})}return this.source}poster(){if(e){return null}return this.poster_}setPoster(t){this.poster_=t}setSrc(t){if(!t||!t.src){return}delete this.errorNumber;this.source=t;this.url=s.parseUrl(t.src);if(!this.options_.poster){if(this.url.videoId){this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg";this.trigger("posterchange");this.checkHighResPoster()}}if(this.options_.autoplay&&!e){if(this.isReady_){this.play()}else{this.playOnReady=true}}else if(this.activeVideoId!==this.url.videoId){if(this.isReady_){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}else{this.cueOnReady=true}}}autoplay(){return this.options_.autoplay}setAutoplay(t){this.options_.autoplay=t}loop(){return this.options_.loop}setLoop(t){this.options_.loop=t}play(){if(!this.url||!this.url.videoId){return}this.wasPausedBeforeSeek=false;if(this.isReady_){if(this.url.listId){if(this.activeList===this.url.listId){this.ytPlayer.playVideo()}else{this.ytPlayer.loadPlaylist(this.url.listId);this.activeList=this.url.listId}}if(this.activeVideoId===this.url.videoId){this.ytPlayer.playVideo()}else{this.loadVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}else{this.trigger("waiting");this.playOnReady=true}}pause(){if(this.ytPlayer){this.ytPlayer.pauseVideo()}}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:true}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(t){if(this.lastState===YT.PlayerState.PAUSED){this.timeBeforeSeek=this.currentTime()}if(!this.isSeeking){this.wasPausedBeforeSeek=this.paused()}this.ytPlayer.seekTo(t,true);this.trigger("timeupdate");this.trigger("seeking");this.isSeeking=true;if(this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==t){clearInterval(this.checkSeekedInPauseInterval);this.checkSeekedInPauseInterval=setInterval(function(){if(this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking){clearInterval(this.checkSeekedInPauseInterval)}else if(this.currentTime()!==this.timeBeforeSeek){this.trigger("timeupdate");this.onSeeked()}}.bind(this),250)}}seeking(){return this.isSeeking}seekable(){if(!this.ytPlayer){return t.createTimeRange()}return t.createTimeRange(0,this.ytPlayer.getDuration())}onSeeked(){clearInterval(this.checkSeekedInPauseInterval);this.isSeeking=false;if(this.wasPausedBeforeSeek){this.pause()}this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(t){if(!this.ytPlayer){return}this.ytPlayer.setPlaybackRate(t)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:false}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(t){if(!this.ytPlayer){return}this.ytPlayer.setVolume(t*100)}muted(){return this.ytPlayer?this.ytPlayer.isMuted():false}setMuted(t){if(!this.ytPlayer){return}else{this.muted(true)}if(t){this.ytPlayer.mute()}else{this.ytPlayer.unMute()}this.setTimeout((function(){this.trigger("volumechange")}),50)}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction){return t.createTimeRange()}var e=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return t.createTimeRange(0,e)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var t="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var e=new Image;e.onload=function(){if("naturalHeight"in e){if(e.naturalHeight<=90||e.naturalWidth<=120){return}}else if(e.height<=90||e.width<=120){return}this.poster_=t;this.trigger("posterchange")}.bind(this);e.onerror=function(){};e.src=t}catch(t){}}}s.isSupported=function(){return true};s.canPlaySource=function(t){return s.canPlayType(t.type)};s.canPlayType=function(t){return t==="video/youtube"};s.parseUrl=function(t){var e={videoId:null};var i=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;var s=t.match(i);if(s&&s[2].length===11){e.videoId=s[2]}var n=/[?&]list=([^#\&\?]+)/;s=t.match(n);if(s&&s[1]){e.listId=s[1]}return e};function n(){YT.ready((function(){s.isApiReady=true;for(var t=0;t<s.apiReadyQueue.length;++t){s.apiReadyQueue[t].initYTPlayer()}}))}function r(t,e){var i=false;var s=document.createElement("script");var n=document.getElementsByTagName("script")[0];if(!n){return}n.parentNode.insertBefore(s,n);s.onload=function(){if(!i){i=true;e()}};s.onreadystatechange=function(){if(!i&&(this.readyState==="complete"||this.readyState==="loaded")){i=true;e()}};s.src=t}function o(){var t=".vjs-youtube .vjs-iframe-blocker { display: none; }"+".vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }"+".vjs-youtube .vjs-poster { background-size: cover; }"+".vjs-youtube-mobile .vjs-big-play-button { display: none; }";var e=document.head||document.getElementsByTagName("head")[0];var i=document.createElement("style");i.type="text/css";if(i.styleSheet){i.styleSheet.cssText=t}else{i.appendChild(document.createTextNode(t))}e.appendChild(i)}s.apiReadyQueue=[];if(typeof document!=="undefined"){r("https://www.youtube.com/iframe_api",n);o()}if(typeof t.registerTech!=="undefined"){t.registerTech("Youtube",s)}else{t.registerComponent("Youtube",s)}}))})(Ab);const Ib='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid #fff;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:rgba(50,50,50,.5);cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:rgba(50,50,50,.9)}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}*{box-sizing:border-box}content-video{display:block;width:100%;position:relative}content-video.content-video--fit-container .video-js.vjs-fluid{height:100%;padding:0}content-video[fit-container=true]{height:100%}content-video .content-video__content{display:block;width:100%;height:100%}content-video .content-video__poster{position:relative}content-video .content-video__play{display:none}content-video .vjs-content-block-theme.video-js{width:100%;height:100%}content-video .vjs-content-block-theme.video-js video.vjs-tech{position:static}content-video .vjs-content-block-theme.vjs-ended .vjs-loading-spinner,content-video .vjs-content-block-theme.vjs-waiting .vjs-loading-spinner{display:none}content-video .vjs-content-block-theme:hover .vjs-big-play-button,content-video .vjs-content-block-theme:focus .vjs-big-play-button{background-color:transparent}content-video .vjs-content-block-theme .vjs-big-play-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);border:none;background:transparent}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder{display:block;width:100%;height:100%}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder:before{display:none}content-video .vjs-poster{display:none}';const Db=Ib;const Cb=class{constructor(e){t(this,e);this.method="youtube";this.autoplay=false;this.src="";this.width=16;this.height=9;this.type="video/mp4";this.playButtonAriaLabel="Play";this.classes=undefined;this.classString=undefined;this.controls=true;this.preload="metadata";this.fitContainer="false";this.isLoaded=false;this.hasPoster=false;this.isPlayed=false}computedVideoConfig(){let t={};t={fill:o(this.fitContainer)==="true",fluid:o(this.fitContainer)==="false",autoplay:this.autoplay===true?"muted":false,techOrder:["youtube"],src:this.src,sources:[{type:"video/youtube",src:this.src}],youtube:{showinfo:0,rel:0,modestbranding:1}};return t}initVideo(){this.isLoaded=true}componentWillLoad(){r.registerProp(this.classes).subscribe((t=>this.classString=t))}componentDidLoad(){let t={root:null,rootMargin:"0px",threshold:.1};let e=new IntersectionObserver((t=>{t.forEach((async t=>{if(t.isIntersecting){this.player=cd(this.videoElement,this.computedVideoConfig())}}))}),t);e.observe(this.hostElement)}onClickHandler(t){t.preventDefault();if(!this.isLoaded){return false}this.initVideo();this.isPlayed=true;this.player.play();if(this.method==="html5"){this.videoElement.play()}}render(){let t=!this.autoplay&&(this.hasPoster&&!this.isPlayed||!this.isPlayed);return e(i,{key:"4eb01a365b5cdada1754ef431c6b4d4d779d729a",class:this.classString},this.hasPoster&&!this.isLoaded&&e("div",{key:"13ece2dd90e34b04fc678bc0ac6b385016ac04d6",class:"content-video__poster"},e("slot",{key:"47896b0f5bf7b0f3ab33131e726cb20567c121e3",name:"poster"})),t&&e("button",{key:"ca90cce7e4ea02d2201cbaecf610fb87c11f86e1",class:"content-video__play","aria-label":this.playButtonAriaLabel,onClick:t=>this.onClickHandler(t)},e("slot",{key:"162cf783704d2bedcb03bb91612e7d86c6f0734b",name:"playButton"})),e("div",{key:"636a0de9100a7eafb18800bf1134fef64343053b",class:"content-video__content"},(!this.hasPoster||this.isLoaded)&&e("video",{key:"4a3abea2af63a8e93bfc1eebca323a05a3fbcbd3",ref:t=>this.videoElement=t,class:"video-js vjs-content-block-theme",controls:this.controls,preload:this.preload,width:this.width,height:this.height,crossorigin:"anonymous","data-setup":JSON.stringify(this.computedVideoConfig())},e("slot",{key:"6706262c92d34dbea5400699cc61f5614253300a",name:"no-js-message"}),e("slot",{key:"544c42a1feb5add98941e77a362df1e97cd3fac8",name:"content"}),e("slot",{key:"23c39f3b87587328097e8046f888e5e8469eeef3"}))))}get hostElement(){return s(this)}};Cb.style=Db;export{l as content_accordion,d as content_button,m as content_grid_formatter,y as content_hero_block,T as content_image,x as content_line,C as content_overlay,O as content_spacer,L as content_text_block,F as content_tout_block,Cb as content_video};
26
- //# sourceMappingURL=p-8deb755c.entry.js.map
25
+ /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const i=function(){const t=[[[],[],[],[],[]],[[],[],[],[],[]]];const e=t[0];const i=t[1];const s=e[4];const n=i[4];let r;let o;let a;const h=[];const c=[];let l;let u;let f;let d;let p;let v;for(r=0;r<256;r++){c[(h[r]=r<<1^(r>>7)*283)^r]=r}for(o=a=0;!s[o];o^=l||1,a=c[a]||1){d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99;s[o]=d;n[d]=o;f=h[u=h[l=h[o]]];v=f*16843009^u*65537^l*257^o*16843008;p=h[d]*257^d*16843008;for(r=0;r<4;r++){e[r][o]=p=p<<24^p>>>8;i[r][d]=v=v<<24^v>>>8}}for(r=0;r<5;r++){e[r]=e[r].slice(0);i[r]=i[r].slice(0)}return t};let s=null;class n{constructor(t){if(!s){s=i()}this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let e;let n;let r;const o=this._tables[0][4];const a=this._tables[1];const h=t.length;let c=1;if(h!==4&&h!==6&&h!==8){throw new Error("Invalid aes key size")}const l=t.slice(0);const u=[];this._key=[l,u];for(e=h;e<4*h+28;e++){r=l[e-1];if(e%h===0||h===8&&e%h===4){r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[r&255];if(e%h===0){r=r<<8^r>>>24^c<<24;c=c<<1^(c>>7)*283}}l[e]=l[e-h]^r}for(n=0;e;n++,e--){r=l[n&3?e:e-4];if(e<=4||n<4){u[n]=r}else{u[n]=a[0][o[r>>>24]]^a[1][o[r>>16&255]]^a[2][o[r>>8&255]]^a[3][o[r&255]]}}}decrypt(t,e,i,s,n,r){const o=this._key[1];let a=t^o[0];let h=s^o[1];let c=i^o[2];let l=e^o[3];let u;let f;let d;const p=o.length/4-2;let v;let m=4;const g=this._tables[1];const b=g[0];const y=g[1];const j=g[2];const w=g[3];const T=g[4];for(v=0;v<p;v++){u=b[a>>>24]^y[h>>16&255]^j[c>>8&255]^w[l&255]^o[m];f=b[h>>>24]^y[c>>16&255]^j[l>>8&255]^w[a&255]^o[m+1];d=b[c>>>24]^y[l>>16&255]^j[a>>8&255]^w[h&255]^o[m+2];l=b[l>>>24]^y[a>>16&255]^j[h>>8&255]^w[c&255]^o[m+3];m+=4;a=u;h=f;c=d}for(v=0;v<4;v++){n[(3&-v)+r]=T[a>>>24]<<24^T[h>>16&255]<<16^T[c>>8&255]<<8^T[l&255]^o[m++];u=a;a=h;h=c;c=l;l=u}}}class r extends t{constructor(){super(t);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const o=function(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};const a=function(t,e,i){const s=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);const r=new n(Array.prototype.slice.call(e));const a=new Uint8Array(t.byteLength);const h=new Int32Array(a.buffer);let c;let l;let u;let f;let d;let p;let v;let m;let g;c=i[0];l=i[1];u=i[2];f=i[3];for(g=0;g<s.length;g+=4){d=o(s[g]);p=o(s[g+1]);v=o(s[g+2]);m=o(s[g+3]);r.decrypt(d,p,v,m,h,g);h[g]=o(h[g]^c);h[g+1]=o(h[g+1]^l);h[g+2]=o(h[g+2]^u);h[g+3]=o(h[g+3]^f);c=d;l=p;u=v;f=m}return a};class h{constructor(t,i,s,n){const a=h.STEP;const c=new Int32Array(t.buffer);const l=new Uint8Array(t.byteLength);let u=0;this.asyncStream_=new r;this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l));for(u=a;u<c.length;u+=a){s=new Uint32Array([o(c[u-4]),o(c[u-3]),o(c[u-2]),o(c[u-1])]);this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l))}this.asyncStream_.push((function(){n(null,e(l))}))}static get STEP(){return 32e3}decryptChunk_(t,e,i,s){return function(){const n=a(t,e,i);s.set(n,t.byteOffset)}}}var c=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var l;if(typeof window!=="undefined"){l=window}else if(typeof c!=="undefined"){l=c}else if(typeof self!=="undefined"){l=self}else{l={}}var u=l;var f=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var d=u.BigInt||Number;[d("0x1"),d("0x100"),d("0x10000"),d("0x1000000"),d("0x100000000"),d("0x10000000000"),d("0x1000000000000"),d("0x100000000000000"),d("0x10000000000000000")];const p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(f(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};self.onmessage=function(t){const e=t.data;const i=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength);const s=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4);const n=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new h(i,s,n,(function(t,i){self.postMessage(p({source:e.source,decrypted:i}),[i.buffer])}))}})));var kg=mv(Tg);const Sg=t=>{let e=t.default?"main":"alternative";if(t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0){e="main-desc"}return e};const xg=(t,e)=>{t.abort();t.pause();if(e&&e.activePlaylistLoader){e.activePlaylistLoader.pause();e.activePlaylistLoader=null}};const Ag=(t,e)=>{e.activePlaylistLoader=t;t.load()};const Eg=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:s},mediaTypes:{[t]:n}}=e;const r=n.activeTrack();const o=n.getActiveGroup();const a=n.activePlaylistLoader;const h=n.lastGroup_;if(o&&h&&o.id===h.id){return}n.lastGroup_=o;n.lastTrack_=r;xg(i,n);if(!o||o.isMainPlaylist){return}if(!o.playlistLoader){if(a){s.resetEverything()}return}i.resyncLoader();Ag(o.playlistLoader,n)};const Ig=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;s.lastGroup_=null;i.abort();i.pause()};const Dg=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:s,main:n},mediaTypes:{[t]:r}}=e;const o=r.activeTrack();const a=r.getActiveGroup();const h=r.activePlaylistLoader;const c=r.lastTrack_;if(c&&o&&c.id===o.id){return}r.lastGroup_=a;r.lastTrack_=o;xg(s,r);if(!a){return}if(a.isMainPlaylist){if(!o||!c||o.id===c.id){return}const t=e.vhs.playlistController_;const s=t.selectPlaylist();if(t.media()===s){return}r.logger_(`track change. Switching main audio from ${c.id} to ${o.id}`);i.pause();n.resetEverything();t.fastQualityChange_(s);return}if(t==="AUDIO"){if(!a.playlistLoader){n.setAudio(true);n.resetEverything();return}s.setAudio(true);n.setAudio(false)}if(h===a.playlistLoader){Ag(a.playlistLoader,r);return}if(s.track){s.track(o)}s.resetEverything();Ag(a.playlistLoader,r)};const Cg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:s}=e;const n=i.activeTrack();const r=i.activeGroup();const o=(r.filter((t=>t.default))[0]||r[0]).id;const a=i.tracks[o];if(n===a){s({error:{message:"Problem encountered loading the default audio track."}});return}cd.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const t in i.tracks){i.tracks[t].enabled=i.tracks[t]===a}i.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;cd.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");const s=i.activeTrack();if(s){s.mode="disabled"}i.onTrackChanged()}};const Ng={AUDIO:(t,e,i)=>{if(!e){return}const{tech:s,requestOptions:n,segmentLoaders:{[t]:r}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[t]:r},mediaTypes:{[t]:o}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);r.track(o.activeTrack());if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))}};const _g={AUDIO:(t,e)=>{const{vhs:i,sourceType:s,segmentLoaders:{[t]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[t]:{groups:a,tracks:h,logger_:c}},mainPlaylistLoader:l}=e;const u=sp(l.main);if(!o[t]||Object.keys(o[t]).length===0){o[t]={main:{default:{default:true}}};if(u){o[t].main.default.playlists=l.main.playlists}}for(const n in o[t]){if(!a[n]){a[n]=[]}for(const f in o[t][n]){let d=o[t][n][f];let p;if(u){c(`AUDIO group '${n}' label '${f}' is a main playlist`);d.isMainPlaylist=true;p=null}else if(s==="vhs-json"&&d.playlists){p=new Ip(d.playlists[0],i,r)}else if(d.resolvedUri){p=new Ip(d.resolvedUri,i,r)}else if(d.playlists&&s==="dash"){p=new uv(d.playlists[0],i,r,l)}else{p=null}d=bd({id:f,playlistLoader:p},d);Ng[t](t,d.playlistLoader,e);a[n].push(d);if(typeof h[f]==="undefined"){const t=new cd.AudioTrack({id:f,kind:Sg(d),enabled:false,language:d.language,default:d.default,label:f});h[f]=t}}}n.on("error",Cg[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[t]:r},requestOptions:o,main:{mediaGroups:a},mediaTypes:{[t]:{groups:h,tracks:c}},mainPlaylistLoader:l}=e;for(const r in a[t]){if(!h[r]){h[r]=[]}for(const u in a[t][r]){if(!s.options_.useForcedSubtitles&&a[t][r][u].forced){continue}let f=a[t][r][u];let d;if(n==="hls"){d=new Ip(f.resolvedUri,s,o)}else if(n==="dash"){const t=f.playlists.filter((t=>t.excludeUntil!==Infinity));if(!t.length){return}d=new uv(f.playlists[0],s,o,l)}else if(n==="vhs-json"){d=new Ip(f.playlists?f.playlists[0]:f.resolvedUri,s,o)}f=bd({id:u,playlistLoader:d},f);Ng[t](t,f.playlistLoader,e);h[r].push(f);if(typeof c[u]==="undefined"){const t=i.addRemoteTextTrack({id:u,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:u},false).track;c[u]=t}}}r.on("error",Cg[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const e in s[t]){if(!n[e]){n[e]=[]}for(const o in s[t][e]){const a=s[t][e][o];if(!/^(?:CC|SERVICE)/.test(a.instreamId)){continue}const h=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:o,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};if(h[c.instreamId]){c=bd(c,h[c.instreamId])}if(c.default===undefined){delete c.default}n[e].push(bd({id:o},a));if(typeof r[o]==="undefined"){const t=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},false).track;r[o]=t}}}}};const Og=(t,e)=>{for(let i=0;i<t.length;i++){if(ep(e,t[i])){return true}if(t[i].playlists&&Og(t[i].playlists,e)){return true}}return false};const Mg=(t,e)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[t]:{groups:n}}}=e;const r=s.media();if(!r){return null}let o=null;if(r.attributes[t]){o=n[r.attributes[t]]}const a=Object.keys(n);if(!o){if(t==="AUDIO"&&a.length>1&&sp(e.main)){for(let t=0;t<a.length;t++){const e=n[a[t]];if(Og(e,r)){o=e;break}}}else if(n.main){o=n.main}else if(a.length===1){o=n[a[0]]}}if(typeof i==="undefined"){return o}if(i===null||!o){return null}return o.filter((t=>t.id===i.id))[0]||null};const Rg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].enabled){return i[t]}}return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].mode==="showing"||i[t].mode==="hidden"){return i[t]}}return null}};const Lg=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();if(!i){return null}return e[t].activeGroup(i)};const Pg=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{_g[e](e,t)}));const{mediaTypes:e,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:o}}=t;["AUDIO","SUBTITLES"].forEach((i=>{e[i].activeGroup=Mg(i,t);e[i].activeTrack=Rg[i](i,t);e[i].onGroupChanged=Eg(i,t);e[i].onGroupChanging=Ig(i,t);e[i].onTrackChanged=Dg(i,t);e[i].getActiveGroup=Lg(i,t)}));const a=e.AUDIO.activeGroup();if(a){const t=(a.filter((t=>t.default))[0]||a[0]).id;e.AUDIO.tracks[t].enabled=true;e.AUDIO.onGroupChanged();e.AUDIO.onTrackChanged();const i=e.AUDIO.getActiveGroup();if(!i.playlistLoader){o.setAudio(true)}else{o.setAudio(false);r.setAudio(true)}}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanged()))}));i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanging()))}));const h=()=>{e.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",h);s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged);n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",h);s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}));s.clearTracks("audio");for(const t in e.AUDIO.tracks){s.audioTracks().addTrack(e.AUDIO.tracks[t])}};const $g=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Wm,activeTrack:Wm,getActiveGroup:Wm,onGroupChanged:Wm,onTrackChanged:Wm,lastTrack_:null,logger_:gd(`MediaGroups[${e}]`)}}));return t};class Fg{constructor(){this.priority_=[];this.pathwayClones_=new Map}set version(t){if(t===1){this.version_=t}}set ttl(t){this.ttl_=t||300}set reloadUri(t){if(t){this.reloadUri_=vd(this.reloadUri_,t)}}set priority(t){if(t&&t.length){this.priority_=t}}set pathwayClones(t){if(t&&t.length){this.pathwayClones_=new Map(t.map((t=>[t.ID,t])))}}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Ug extends cd.EventTarget{constructor(t,e){super();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=false;this.availablePathways_=new Set;this.steeringManifest=new Fg;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.currentPathwayClones=new Map;this.nextPathwayClones=new Map;this.excludedSteeringManifestURLs=new Set;this.logger_=gd("Content Steering");this.xhr_=t;this.getBandwidth_=e}assignTagProperties(t,e){this.manifestType_=e.serverUri?"HLS":"DASH";const i=e.serverUri||e.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`);this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=vd(t,i);this.defaultPathway=e.pathwayId||e.defaultServiceLocation;this.queryBeforeStart=e.queryBeforeStart;this.proxyServerUrl_=e.proxyServerURL;if(this.defaultPathway&&!this.queryBeforeStart){this.trigger("content-steering")}}requestSteeringManifest(t){const e=this.steeringManifest.reloadUri;if(!e){return}const i=t?e:this.getRequestURI(e);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering.");this.trigger("error");this.dispose();return}const s={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:s});this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((t,e)=>{if(t){if(e.status===410){this.logger_(`manifest request 410 ${t}.`);this.logger_(`There will be no more content steering requests to ${i} this session.`);this.excludedSteeringManifestURLs.add(i);return}if(e.status===429){const i=e.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${t}.`);this.logger_(`content steering will retry in ${i} seconds.`);this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${t}.`);this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let n;try{n=JSON.parse(this.request_.responseText)}catch(t){const e={errorType:cd.Error.StreamingContentSteeringParserError,error:t};this.trigger({type:"error",metadata:e})}this.assignSteeringProperties_(n);const r={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:r});this.startTTLTimeout_()}))}setProxyServerUrl_(t){const e=new z.URL(t);const i=new z.URL(this.proxyServerUrl_);i.searchParams.set("url",encodeURI(e.toString()));return this.setSteeringParams_(i.toString())}decodeDataUriManifest_(t){const e=JSON.parse(z.atob(t));this.assignSteeringProperties_(e)}setSteeringParams_(t){const e=new z.URL(t);const i=this.getPathway();const s=this.getBandwidth_();if(i){const t=`_${this.manifestType_}_pathway`;e.searchParams.set(t,i)}if(s){const t=`_${this.manifestType_}_throughput`;e.searchParams.set(t,s)}return e.toString()}assignSteeringProperties_(t){this.steeringManifest.version=t.VERSION;if(!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`);this.trigger("error");return}this.steeringManifest.ttl=t.TTL;this.steeringManifest.reloadUri=t["RELOAD-URI"];this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"];this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"];this.nextPathwayClones=this.steeringManifest.pathwayClones;if(!this.availablePathways_.size){this.logger_("There are no available pathways for content steering. Ending content steering.");this.trigger("error");this.dispose()}const e=t=>{for(const e of t){if(this.availablePathways_.has(e)){return e}}return[...this.availablePathways_][0]};const i=e(this.steeringManifest.priority);if(this.currentPathway!==i){this.currentPathway=i;this.trigger("content-steering")}}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t){return null}const e=t=>this.excludedSteeringManifestURLs.has(t);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!e(i)){return i}}const i=this.setSteeringParams_(t);if(!e(i)){return i}return null}startTTLTimeout_(t=this.steeringManifest.ttl){const e=t*1e3;this.ttlTimeout_=z.setTimeout((()=>{this.requestSteeringManifest()}),e)}clearTTLTimeout_(){z.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){if(this.request_){this.request_.abort()}this.request_=null}dispose(){this.off("content-steering");this.off("error");this.abort();this.clearTTLTimeout_();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=null;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.excludedSteeringManifestURLs=new Set;this.availablePathways_=new Set;this.steeringManifest=new Fg}addAvailablePathway(t){if(t){this.availablePathways_.add(t)}}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,e){return!e&&this.steeringManifest.reloadUri||e&&(vd(t,e.serverURL)!==this.steeringManifest.reloadUri||e.defaultServiceLocation!==this.defaultPathway||e.queryBeforeStart!==this.queryBeforeStart||e.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Bg=10;let qg;const Vg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const zg=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};const Hg=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:a,log:h}){if(!s){cd.log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t){h(`${c} as current playlist is not set`);return true}if(s.id===t.id){return false}const l=Boolean(Sd(e,i).length);if(!t.endList){if(!l&&typeof t.partTargetDuration==="number"){h(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}h(`${c} as current playlist is live`);return true}const u=Od(e,i);const f=a?fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:fv.MAX_BUFFER_LOW_WATER_LINE;if(o<f){h(`${c} as duration < max low water line (${o} < ${f})`);return true}const d=s.attributes.BANDWIDTH;const p=t.attributes.BANDWIDTH;if(d<p&&(!a||u<r)){let t=`${c} as next bandwidth < current bandwidth (${d} < ${p})`;if(a){t+=` and forwardBuffer < bufferHighWaterLine (${u} < ${r})`}h(t);return true}if((!a||d>p)&&u>=n){let t=`${c} as forwardBuffer >= bufferLowWaterLine (${u} >= ${n})`;if(a){t+=` and next bandwidth > current bandwidth (${d} > ${p})`}h(t);return true}h(`not ${c} as no switching criteria met`);return false};class Xg extends cd.EventTarget{constructor(t){super();const{src:e,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:o,playlistExclusionDuration:a,enableLowInitialPlaylist:h,sourceType:c,cacheEncryptionKeys:l,bufferBasedABR:u,leastPixelDiffSelector:f,captionServices:d}=t;if(!e){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=t;if(p===null||typeof p==="undefined"){p=Infinity}qg=r;this.bufferBasedABR=Boolean(u);this.leastPixelDiffSelector=Boolean(f);this.withCredentials=i;this.tech_=s;this.vhs_=s.vhs;this.player_=t.player_;this.sourceType_=c;this.useCueTags_=o;this.playlistExclusionDuration=a;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=h;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=$g();this.mediaSource=new z.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=yd();this.hasPlayed_=false;this.syncController_=new jg(t);this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new kg;this.sourceUpdater_=new og(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new wg;this.keyStatusMap_=new Map;const v={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:d,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:l,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uv(e,this.vhs_,bd(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ip(e,this.vhs_,bd(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new Ym(bd(v,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t);this.audioSegmentLoader_=new Ym(bd(v,{loaderType:"audio"}),t);this.subtitleSegmentLoader_=new ug(bd(v,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((t,e)=>{function i(){s.off("vttjserror",n);t()}function n(){s.off("vttjsloaded",i);e()}s.one("vttjsloaded",i);s.one("vttjserror",n);s.addWebVttScript_()}))}),t);const m=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new Ug(this.vhs_.xhr,m);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_()));this.tech_.on("pause",(()=>this.stopABRTimer_()));this.tech_.on("play",(()=>this.startABRTimer_()))}Vg.forEach((t=>{this[t+"_"]=zg.bind(this,t)}));this.logger_=gd("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const g=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(g,(()=>{const t=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-t;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_();const e=this.audioAppendsToLoadedData_();if(t===-1||e===-1){return-1}return t+e}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const e=this.selectPlaylist();if(e&&this.shouldSwitchToMedia_(e)){this.switchMedia_(e,t)}}switchMedia_(t,e,i){const s=this.media();const n=s&&(s.id||s.uri);const r=t&&(t.id||t.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${e}`);const i={renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:e};this.trigger({type:"renditionselected",metadata:i});this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${e}`})}this.mainPlaylistLoader_.media(t,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{const e=this.mediaTypes_[t];const i=e?e.activeGroup():null;const s=this.contentSteeringController_.getPathway();if(i&&s){const e=i.length?i[0].playlists:i.playlists;const n=e.filter((t=>t.attributes.serviceLocation===s));if(n.length){this.mediaTypes_[t].activePlaylistLoader.media(n[0])}}}))}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=z.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}z.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const t=i.main||s.length&&i[s[0]];for(const e in t){if(t[e].default){n={label:e};break}}}if(!n){return e}const r=[];for(const e in i){if(i[e][n.label]){const s=i[e][n.label];if(s.playlists&&s.playlists.length){r.push.apply(r,s.playlists)}else if(s.uri){r.push(s)}else if(t.playlists.length){for(let i=0;i<t.playlists.length;i++){const s=t.playlists[i];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===e){r.push(s)}}}}}if(!r.length){return e}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(t.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.mainSegmentLoader_.load()}Pg({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),t);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))}}));this.mainPlaylistLoader_.on("loadedplaylist",(()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}));this.mainPlaylistLoader_.on("error",(()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()}));this.mainPlaylistLoader_.on("mediachange",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(this.sourceType_==="dash"){this.mainPlaylistLoader_.load()}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}else{this.mainSegmentLoader_.load()}this.tech_.trigger({type:"mediachange",bubbles:true})}));this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged"){return}const e=this.stuckAtPlaylistEnd_(t);if(e){this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}});this.tech_.trigger("playliststuck")}}));this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}));this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}));const t=["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"];t.forEach((t=>{this.mainPlaylistLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}handleUpdatedMediaPlaylist(t){if(this.useCueTags_){this.updateAdCues_(t)}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}this.updateDuration(!t.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(t,e){const i=t.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const t in i.AUDIO){for(const e in i.AUDIO[t]){const n=i.AUDIO[t][e];if(!n.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(qg.Playlist.isAes(e)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(t){const e=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return Hg({buffered:r,currentTime:i,currentPlaylist:e,nextPlaylist:t,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")}));this.mainSegmentLoader_.on("timeout",(()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}}));if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")}))}this.mainSegmentLoader_.on("error",(()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")}));this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()}));this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}));this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()}));this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")}));this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended");this.onEndOfStream()}));this.mainSegmentLoader_.on("earlyabort",(t=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:Bg})}));const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t);this.audioSegmentLoader_.on("trackinfo",t);this.mainSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()}));const e=["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"];e.forEach((t=>{this.mainSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.audioSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.subtitleSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality");this.waitingForFastQualityPlaylistReceived_=true}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=false;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything((()=>{this.mainSegmentLoader_.load()}))}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const t=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<t.start(0)){return this.tech_.setCurrentTime(t.end(t.length-1))}}}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_){return false}if(!t.endList||t.start){const e=this.seekable();if(!e.length){return false}const i=e.end(0);let s=i;if(t.start){const n=t.start.timeOffset;if(n<0){s=Math.max(i+n,e.start(0))}else{s=Math.min(i,n)}}this.trigger("firstplay");this.tech_.setCurrentTime(s)}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const t=this.tech_.play();if(typeof t!=="undefined"&&typeof t.then==="function"){t.then(null,(t=>{}))}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length){return}const e=this.duration();t[t.length-1].endTime=isNaN(e)||Math.abs(e)===Infinity?Number.MAX_VALUE:e}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const e=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!e||e.hasVideo){t=t&&this.audioSegmentLoader_.ended_}else{t=this.audioSegmentLoader_.ended_}}if(!t){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(t){const e=this.seekable();if(!e.length){return false}const i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return false}const s=qg.Playlist.playlistEnd(t,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=Td}const o=r.end(r.length-1);return o-n<=Td&&s-o<=Td}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:i}){t=t||this.mainPlaylistLoader_.media();i=i||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!t){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}t.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const n=s.filter(Wd);const r=n.length===1&&n[0]===t;if(s.length===1&&i!==Infinity){cd.log.warn(`Problem encountered with playlist ${t.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){if(this.main().contentSteering){const e=this.pathwayAttribute_(t);const i=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(e);this.excludeThenChangePathway_();setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(e)}),i);return}let e=false;s.forEach((i=>{if(i===t){return}const s=i.excludeUntil;if(typeof s!=="undefined"&&s!==Infinity){e=true;delete i.excludeUntil}}));if(e){cd.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let o;if(t.playlistErrors_>this.maxPlaylistRetries){o=Infinity}else{o=Date.now()+i*1e3}t.excludeUntil=o;if(e.reason){t.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const a=this.selectPlaylist();if(!a){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const h=e.internal?this.logger_:cd.log.warn;const c=e.message?" "+e.message:"";h(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.`+`${c} Switching to playlist ${a.id}.`);if(a.attributes.AUDIO!==t.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(a.attributes.SUBTITLES!==t.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const l=a.targetDuration/2*1e3||5*1e3;const u=typeof a.lastRequest==="number"&&Date.now()-a.lastRequest<=l;return this.switchMedia_(a,"exclude",r||u)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(t,e){const i=[];const s=t==="all";if(s||t==="main"){i.push(this.mainPlaylistLoader_)}const n=[];if(s||t==="audio"){n.push("AUDIO")}if(s||t==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach((t=>{const e=this.mediaTypes_[t]&&this.mediaTypes_[t].activePlaylistLoader;if(e){i.push(e)}}));["main","audio","subtitle"].forEach((e=>{const s=this[`${e}SegmentLoader_`];if(s&&(t===e||t==="all")){i.push(s)}}));i.forEach((t=>e.forEach((e=>{if(typeof t[e]==="function"){t[e]()}}))))}setCurrentTime(t){const e=Sd(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(e&&e.length){return t}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const t=this.mainPlaylistLoader_.media();if(!t){return 0}if(!t.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return qg.Playlist.duration(t)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let t;if(!this.mainPlaylistLoader_){return}let e=this.mainPlaylistLoader_.media();if(!e){return}let i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){e=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}t=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(t.length===0){return}}let r;let o;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);o=this.seekable_.start(0)}if(!t){this.seekable_=n}else if(t.start(0)>n.end(0)||n.start(0)>t.end(0)){this.seekable_=n}else{this.seekable_=yd([[t.start(0)>n.start(0)?t.start(0):n.start(0),t.end(0)<n.end(0)?t.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===o){return}}this.logger_(`seekable updated [${Id(this.seekable_)}]`);const a={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:a});this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const t=this.seekable();if(!t.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1)){this.sourceUpdater_.setDuration(t.end(t.length-1))}return}const e=this.tech_.buffered();let i=qg.Playlist.duration(this.mainPlaylistLoader_.media());if(e.length>0){i=Math.max(i,e.end(e.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();this.contentSteeringController_.dispose();this.keyStatusMap_.clear();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach((t=>{const e=this.mediaTypes_[t].groups;for(const t in e){e[t].forEach((t=>{if(t.playlistLoader){t.playlistLoader.dispose()}}))}}));this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_)}this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const e=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!t?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!e||!i){return false}return true}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const e=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const i=sm(this.main(),e);const s={};const n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo){s.video=i.video||t.main.videoCodec||ti}if(t.main.isMuxed){s.video+=`,${i.audio||t.main.audioCodec||Ze}`}if(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n){s.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||Ze;t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:e,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(t,e)=>t?Ke(e):Qe(e);const o={};let a;["video","audio"].forEach((function(e){if(s.hasOwnProperty(e)&&!r(t[e].isFmp4,s[e])){const i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[];o[i].push(s[e]);if(e==="audio"){a=i}}}));if(n&&a&&e.attributes.AUDIO){const t=e.attributes.AUDIO;this.main().playlists.forEach((i=>{const s=i.attributes&&i.attributes.AUDIO;if(s===t&&i!==e){i.excludeUntil=Infinity}}));this.logger_(`excluding audio group ${t} as ${a} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const t=Object.keys(o).reduce(((t,e)=>{if(t){t+=", "}t+=`${e} does not support codec(s): "${o[e].join(",")}"`;return t}),"")+".";this.excludePlaylist({playlistToExclude:e,error:{internal:true,message:t},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];["video","audio"].forEach((e=>{const i=(Xe(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const n=(Xe(s[e]||"")[0]||{}).type;if(i&&n&&i.toLowerCase()!==n.toLowerCase()){t.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)}}));if(t.length){this.excludePlaylist({playlistToExclude:e,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.createSourceBuffers(t);const e=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(e)}excludeUnsupportedVariants_(){const t=this.main().playlists;const e=[];Object.keys(t).forEach((i=>{const s=t[i];if(e.indexOf(s.id)!==-1){return}e.push(s.id);const n=sm(this.main,s);const r=[];if(n.audio&&!Qe(n.audio)&&!Ke(n.audio)){r.push(`audio codec ${n.audio}`)}if(n.video&&!Qe(n.video)&&!Ke(n.video)){r.push(`video codec ${n.video}`)}if(n.text&&n.text==="stpp.ttml.im1t"){r.push(`text codec ${n.text}`)}if(r.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`)}}))}excludeIncompatibleVariants_(t){const e=[];const i=this.main().playlists;const s=em(Xe(t));const n=im(s);const r=s.video&&Xe(s.video)[0]||null;const o=s.audio&&Xe(s.audio)[0]||null;Object.keys(i).forEach((t=>{const s=i[t];if(e.indexOf(s.id)!==-1||s.excludeUntil===Infinity){return}e.push(s.id);const a=[];const h=sm(this.mainPlaylistLoader_.main,s);const c=im(h);if(!h.audio&&!h.video){return}if(c!==n){a.push(`codec count "${c}" !== "${n}"`)}if(!this.sourceUpdater_.canChangeType()){const t=h.video&&Xe(h.video)[0]||null;const e=h.audio&&Xe(h.audio)[0]||null;if(t&&r&&t.type.toLowerCase()!==r.type.toLowerCase()){a.push(`video codec "${t.type}" !== "${r.type}"`)}if(e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()){a.push(`audio codec "${e.type}" !== "${o.type}"`)}}if(a.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id}: ${a.join(" && ")}`)}}))}updateAdCues_(t){let e=0;const i=this.seekable();if(i.length){e=i.start(0)}dg(t,this.cueTagsTrack_,e)}goalBufferLength(){const t=this.tech_.currentTime();const e=fv.GOAL_BUFFER_LENGTH;const i=fv.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(e,fv.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,s)}bufferLowWaterLine(){const t=this.tech_.currentTime();const e=fv.BUFFER_LOW_WATER_LINE;const i=fv.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(e,fv.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(e,fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return fv.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Sm(this.inbandTextTracks_,"com.apple.streaming",this.tech_);km({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,e,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Sm(this.inbandTextTracks_,t,this.tech_);jm({inbandTextTracks:this.inbandTextTracks_,metadataArray:e,timestampOffset:s,videoDuration:i})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(!t.contentSteering){return}for(const e of t.playlists){this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(e))}this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering);if(this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(true);return}this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));const t=["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];t.forEach((t=>{this.contentSteeringController_.on(t,(t=>{this.trigger(it({},t))}))}));if(this.sourceType_==="dash"){this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const t=this.main();const e=this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering);const i=()=>{const e=this.contentSteeringController_.getAvailablePathways();const i=[];for(const s of t.playlists){const t=s.attributes.serviceLocation;if(t){i.push(t);if(!e.has(t)){return true}}}if(!i.length&&e.size){return true}return false};if(e||i()){this.resetContentSteeringController_()}}))}}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t){return}this.handlePathwayClones_();const e=this.main();const i=e.playlists;const s=new Set;let n=false;Object.keys(i).forEach((e=>{const r=i[e];const o=this.pathwayAttribute_(r);const a=o&&t!==o;const h=r.excludeUntil===Infinity&&r.lastExcludeReason_==="content-steering";if(h&&!a){delete r.excludeUntil;delete r.lastExcludeReason_;n=true}const c=!r.excludeUntil&&r.excludeUntil!==Infinity;const l=!s.has(r.id)&&a&&c;if(!l){return}s.add(r.id);r.excludeUntil=Infinity;r.lastExcludeReason_="content-steering";this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`)}));if(this.contentSteeringController_.manifestType_==="DASH"){Object.keys(this.mediaTypes_).forEach((e=>{const i=this.mediaTypes_[e];if(i.activePlaylistLoader){const e=i.activePlaylistLoader.media_;if(e&&e.attributes.serviceLocation!==t){n=true}}}))}if(n){this.changeSegmentPathway_()}}handlePathwayClones_(){const t=this.main();const e=t.playlists;const i=this.contentSteeringController_.currentPathwayClones;const s=this.contentSteeringController_.nextPathwayClones;const n=i&&i.size||s&&s.size;if(!n){return}for(const[t,e]of i.entries()){const i=s.get(t);if(!i){this.mainPlaylistLoader_.updateOrDeleteClone(e);this.contentSteeringController_.excludePathway(t)}}for(const[t,n]of s.entries()){const s=i.get(t);if(!s){const i=e.filter((t=>t.attributes["PATHWAY-ID"]===n["BASE-ID"]));i.forEach((t=>{this.mainPlaylistLoader_.addClonePathway(n,t)}));this.contentSteeringController_.addAvailablePathway(t);continue}if(this.equalPathwayClones_(s,n)){continue}this.mainPlaylistLoader_.updateOrDeleteClone(n,true);this.contentSteeringController_.addAvailablePathway(t)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}equalPathwayClones_(t,e){if(t["BASE-ID"]!==e["BASE-ID"]||t.ID!==e.ID||t["URI-REPLACEMENT"].HOST!==e["URI-REPLACEMENT"].HOST){return false}const i=t["URI-REPLACEMENT"].PARAMS;const s=e["URI-REPLACEMENT"].PARAMS;for(const t in i){if(i[t]!==s[t]){return false}}for(const t in s){if(i[t]!==s[t]){return false}}return true}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading();if(this.contentSteeringController_.manifestType_==="DASH"){this.switchMediaForDASHContentSteering_()}this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main){return}let t=0;const e="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);if(!s||!s.size){return}s.forEach((s=>{const n="usable";const r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n;const o=i.lastExcludeReason_===e&&i.excludeUntil===Infinity;if(!r){if(i.excludeUntil!==Infinity&&i.lastExcludeReason_!==e){i.excludeUntil=Infinity;i.lastExcludeReason_=e;this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${n}`)}t++}else if(r&&o){delete i.excludeUntil;delete i.lastExcludeReason_;this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)}}))}));if(t>=this.mainPlaylistLoader_.main.playlists.length){this.mainPlaylistLoader_.main.playlists.forEach((t=>{const i=t&&t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height<720;const s=t.excludeUntil===Infinity&&t.lastExcludeReason_===e;if(i&&s){delete t.excludeUntil;cd.log.warn(`enabling non-HD playlist ${t.id} because all playlists were excluded due to ${e} key IDs`)}}))}}addKeyStatus_(t,e){const i=typeof t==="string";const s=i?t:hg(t);const n=s.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${e}' with key ID ${n} added to the keyStatusMap`);this.keyStatusMap_.set(n,e)}updatePlaylistByKeyStatus(t,e){this.addKeyStatus_(t,e);if(!this.waitingForFastQualityPlaylistReceived_){this.excludeNonUsableThenChangePlaylist_()}this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this));this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_();this.fastQualityChange_()}}const Gg=(t,e,i)=>s=>{const n=t.main.playlists[e];const r=Yd(n);const o=Wd(n);if(typeof s==="undefined"){return o}if(s){delete n.disabled}else{n.disabled=true}const a={renditionInfo:{id:e,bandwidth:n.attributes.BANDWIDTH,resolution:n.attributes.RESOLUTION,codecs:n.attributes.CODECS},cause:"fast-quality"};if(s!==o&&!r){i(n);if(s){t.trigger({type:"renditionenabled",metadata:a})}else{t.trigger({type:"renditiondisabled",metadata:a})}}return s};class Yg{constructor(t,e,i){const{playlistController_:s}=t;const n=s.fastQualityChange_.bind(s);if(e.attributes){const t=e.attributes.RESOLUTION;this.width=t&&t.width;this.height=t&&t.height;this.bandwidth=e.attributes.BANDWIDTH;this.frameRate=e.attributes["FRAME-RATE"]}this.codecs=sm(s.main(),e);this.playlist=e;this.id=i;this.enabled=Gg(t.playlists,e.id,n)}}const Wg=function(t){t.representations=()=>{const e=t.playlistController_.main();const i=sp(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!i){return[]}return i.filter((t=>!Yd(t))).map(((e,i)=>new Yg(t,e,e.id)))}};const Jg=["seeking","seeked","pause","playing","error"];class Kg extends cd.EventTarget{constructor(t){super();this.playlistController_=t.playlistController;this.tech_=t.tech;this.seekable=t.seekable;this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta;this.media=t.media;this.playedRanges_=[];this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=gd("PlaybackWatcher");this.logger_("initialize");const e=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const o=["main","subtitle","audio"];const a={};o.forEach((t=>{a[t]={reset:()=>this.resetSegmentDownloads_(t),updateend:()=>this.checkSegmentDownloads_(t)};r[`${t}SegmentLoader_`].on("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].on("playlistupdate",a[t].reset);this.tech_.on(["seeked","seeking"],a[t].reset)}));const h=t=>{["main","audio"].forEach((e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();h("off")}};this.clearSeekingAppendCheck_=()=>h("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();h("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(Jg,n);this.tech_.on("canplay",i);this.tech_.one("play",e);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(Jg,n);this.tech_.off("canplay",i);this.tech_.off("play",e);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);o.forEach((t=>{r[`${t}SegmentLoader_`].off("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].off("playlistupdate",a[t].reset);this.tech_.off(["seeked","seeking"],a[t].reset)}));if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=z.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const e=this.playlistController_[`${t}SegmentLoader_`];if(this[`${t}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${t} loader`)}this[`${t}StalledDownloads_`]=0;this[`${t}Buffered_`]=e.buffered_()}checkSegmentDownloads_(t){const e=this.playlistController_;const i=e[`${t}SegmentLoader_`];const s=i.buffered_();const n=Nd(this[`${t}Buffered_`],s);this[`${t}Buffered_`]=s;if(n){const i={bufferedRanges:s};e.trigger({type:"bufferedrangeschanged",metadata:i});this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++;this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Cd(s)});if(this[`${t}StalledDownloads_`]<10){return}this.logger_(`${t} loader stalled download exclusion`);this.resetSegmentDownloads_(t);this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`});if(t==="subtitle"){return}e.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+Td>=e.end(e.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(t===this.lastRecordedTime){this.consecutiveUpdates++}else{this.playedRanges_.push(yd([this.lastRecordedTime,t]));const e={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:e});this.consecutiveUpdates=0;this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const t=this.tech_.seeking();if(!t){return false}const e=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const t=e.end(e.length-1);n=t}if(this.beforeSeekableWindow_(e,i)){const t=e.start(0);n=t+(t===e.end(0)?0:Td)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${Id(e)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const o=this.tech_.buffered();const a=r.audioBuffer?r.audioBuffered():null;const h=r.videoBuffer?r.videoBuffered():null;const c=this.media();const l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-wd)*2;const u=[a,h];for(let t=0;t<u.length;t++){if(!u[t]){continue}const e=Od(u[t],i);if(e<l){return false}}const f=xd(o,i);if(f.length===0){return false}n=f.start(0)+Td;this.logger_(`Buffered region starts (${f.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();const i=Sd(e,t);if(i.length&&t+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.logger_(`Stopped at ${t} while inside a buffered region `+`[${i.start(0)} -> ${i.end(0)}]. Attempting to resume `+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable();const e=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(t,e)){const i=t.end(t.length-1);this.logger_(`Fell out of live window at time ${e}. Seeking to `+`live point (seekable end) ${i}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(i);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:e});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=xd(s,e);if(r.length>0){this.logger_(`Stopped at ${e} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(e);return true}return false}afterSeekableWindow_(t,e,i,s=false){if(!t.length){return false}let n=t.end(t.length-1)+Td;const r=!i.endList;const o=typeof i.partTargetDuration==="number";if(r&&(o||s)){n=t.end(t.length-1)+i.targetDuration*3}if(e>n){return true}return false}beforeSeekableWindow_(t,e){if(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:t,audioBuffered:e,currentTime:i}){if(!t){return}let s;if(t.length&&e.length){const n=Sd(t,i-3);const r=Sd(t,i);const o=Sd(e,i);if(o.length&&!r.length&&n.length){s={start:n.end(0),end:o.end(0)}}}else{const e=xd(t,i);if(!e.length){s=this.gapFromVideoUnderflow_(t,i)}}if(s){this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. `+`Seeking to current time ${i}`);return true}return false}skipTheGap_(t){const e=this.tech_.buffered();const i=this.tech_.currentTime();const s=xd(e,i);this.resetTimeUpdate_();if(s.length===0||i!==t){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+wd);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n});this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,e){const i=Ad(t);for(let t=0;t<i.length;t++){const s=i.start(t);const n=i.end(t);if(e-s<4&&e-s>2){return{start:s,end:n}}}return null}}const Qg={errorInterval:30,getSource(t){const e=this.tech({IWillNotUseThisInPlugins:true});const i=e.currentSource_||this.currentSource();return t(i)}};const Zg=function(t,e){let i=0;let s=0;const n=bd(Qg,e);t.ready((()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){if(s){t.currentTime(s)}};const o=function(e){if(e===null||e===undefined){return}s=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const a=function(){if(Date.now()-i<n.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!=="function"){cd.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(t,o)};const h=function(){t.off("loadedmetadata",r);t.off("error",a);t.off("dispose",h)};const c=function(e){h();Zg(t,e)};t.on("error",a);t.on("dispose",h);t.reloadSourceOnError=c};const tb=function(t){Zg(this,t)};var eb="3.13.2";var ib="7.0.3";var sb="1.3.0";var nb="7.1.0";var rb="4.0.1";const ob={PlaylistLoader:Ip,Playlist:np,utils:zp,STANDARD_PLAYLIST_SELECTOR:um,INITIAL_PLAYLIST_SELECTOR:pm,lastBandwidthSelector:um,movingAverageBandwidthSelector:fm,comparePlaylistBandwidth:hm,comparePlaylistResolution:cm,xhr:_p()};Object.keys(fv).forEach((t=>{Object.defineProperty(ob,t,{get(){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return fv[t]},set(e){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){cd.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}fv[t]=e}})}));const ab="videojs-vhs";const hb=function(t,e){const i=e.media();let s=-1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){s=e;break}}t.selectedIndex_=s;t.trigger({selectedIndex:s,type:"change"})};const cb=function(t,e){e.representations().forEach((e=>{t.addQualityLevel(e)}));hb(t,e.playlists)};ob.canPlaySource=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const lb=(t,e,i)=>{if(!t){return t}let s={};if(e&&e.attributes&&e.attributes.CODECS){s=em(Xe(e.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=Je(s.video);const r=Je(s.audio);const o={};for(const i in t){o[i]={};if(r){o[i].audioContentType=r}if(n){o[i].videoContentType=n}if(e.contentProtection&&e.contentProtection[i]&&e.contentProtection[i].pssh){o[i].pssh=e.contentProtection[i].pssh}if(typeof t[i]==="string"){o[i].url=t[i]}}return bd(t,o)};const ub=(t,e)=>t.reduce(((t,i)=>{if(!i.contentProtection){return t}const s=e.reduce(((t,e)=>{const s=i.contentProtection[e];if(s&&s.pssh){t[e]={pssh:s.pssh}}return t}),{});if(Object.keys(s).length){t.push(s)}return t}),[]);const fb=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:s})=>{if(!t.eme.initializeMediaKeys){return Promise.resolve()}const n=i?s.concat([i]):s;const r=ub(n,Object.keys(e));const o=[];const a=[];r.forEach((e=>{a.push(new Promise(((e,i)=>{t.tech_.one("keysessioncreated",e)})));o.push(new Promise(((i,s)=>{t.eme.initializeMediaKeys({keySystems:e},(t=>{if(t){s(t);return}i()}))})))}));return Promise.race([Promise.all(o),Promise.race(a)])};const db=({player:t,sourceKeySystems:e,media:i,audioMedia:s})=>{const n=lb(e,i,s);if(!n){return false}t.currentSource().keySystems=n;if(n&&!t.eme){cd.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const pb=()=>{if(!z.localStorage){return null}const t=z.localStorage.getItem(ab);if(!t){return null}try{return JSON.parse(t)}catch(t){return null}};const vb=t=>{if(!z.localStorage){return false}let e=pb();e=e?bd(e,t):t;try{z.localStorage.setItem(ab,JSON.stringify(e))}catch(t){return false}return e};const mb=t=>{if(t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(t.substring(t.indexOf(",")+1))}return t};const gb=(t,e)=>{if(!t._requestCallbackSet){t._requestCallbackSet=new Set}t._requestCallbackSet.add(e)};const bb=(t,e)=>{if(!t._responseCallbackSet){t._responseCallbackSet=new Set}t._responseCallbackSet.add(e)};const yb=(t,e)=>{if(!t._requestCallbackSet){return}t._requestCallbackSet.delete(e);if(!t._requestCallbackSet.size){delete t._requestCallbackSet}};const jb=(t,e)=>{if(!t._responseCallbackSet){return}t._responseCallbackSet.delete(e);if(!t._responseCallbackSet.size){delete t._responseCallbackSet}};ob.supportsNativeHls=function(){if(!K||!K.createElement){return false}const t=K.createElement("video");if(!cd.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some((function(e){return/maybe|probably/i.test(t.canPlayType(e))}))}();ob.supportsNativeDash=function(){if(!K||!K.createElement||!cd.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(K.createElement("video").canPlayType("application/dash+xml"))}();ob.supportsTypeNatively=t=>{if(t==="hls"){return ob.supportsNativeHls}if(t==="dash"){return ob.supportsNativeDash}return false};ob.isSupported=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};ob.xhr.onRequest=function(t){gb(ob.xhr,t)};ob.xhr.onResponse=function(t){bb(ob.xhr,t)};ob.xhr.offRequest=function(t){yb(ob.xhr,t)};ob.xhr.offResponse=function(t){jb(ob.xhr,t)};const wb=cd.getComponent("Component");class Tb extends wb{constructor(t,e,i){super(e,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=gd("VhsHandler");if(e.options_&&e.options_.playerId){const t=cd.getPlayer(e.options_.playerId);this.player_=t}this.tech_=e;this.source_=t;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks){e.overrideNativeAudioTracks(true);e.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(K,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(t=>{const e=K.fullscreenElement||K.webkitFullscreenElement||K.mozFullScreenElement||K.msFullscreenElement;if(e&&e.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}}));this.on(this.tech_,"seeking",(function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())}));this.on(this.tech_,"error",(function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}}));this.on(this.tech_,"play",this.play)}setOptions_(t={}){this.options_=bd(this.options_,t);this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const t=pb();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=fv.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===fv.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((t=>{if(typeof this.source_[t]!=="undefined"){this.options_[t]=this.source_[t]}}));this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const e=this.options_.customPixelRatio;if(typeof e==="number"&&e>=0){this.customPixelRatio=e}}setOptions(t={}){this.setOptions_(t)}src(t,e){if(!t){return}this.setOptions_();this.options_.src=mb(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=ob;this.options_.sourceType=si(e);this.options_.seekTo=t=>{this.tech_.setCurrentTime(t)};this.options_.player_=this.player_;this.playlistController_=new Xg(this.options_);const i=bd({liveRangeSafeTimeDelta:Td},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Kg(i);this.attachStreamingEventListeners_();this.playlistController_.on("error",(()=>{const t=cd.players[this.tech_.options_.playerId];let e=this.playlistController_.error;if(typeof e==="object"&&!e.code){e.code=3}else if(typeof e==="string"){e={message:e,code:3}}t.error(e)}));const s=this.options_.bufferBasedABR?ob.movingAverageBandwidthSelector(.55):ob.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=ob.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.playlistController_.mainPlaylistLoader_;this.mediaSource=this.playlistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(t){this.playlistController_.selectPlaylist=t.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(t){this.playlistController_.mainSegmentLoader_.throughput.rate=t;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let t=this.playlistController_.mainSegmentLoader_.bandwidth;const e=z.navigator.connection||z.navigator.mozConnection||z.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&e){const s=e.downlink*1e3*1e3;if(s>=i&&t>=i){t=Math.max(t,s)}else{t=s}}return t},set(t){this.playlistController_.mainSegmentLoader_.bandwidth=t;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const t=1/(this.bandwidth||1);let e;if(this.throughput>0){e=1/this.throughput}else{e=0}const i=Math.floor(1/(t+e));return i},set(){cd.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>Cd(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>Cd(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",(()=>{if(this.options_.useBandwidthFromLocalStorage){vb({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}}));this.playlistController_.on("selectedinitialmedia",(()=>{Wg(this)}));this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()}));this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")}));this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=true}));this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=z.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");fb({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()})).catch((t=>{this.logger_("error while creating EME key session",t);this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const e=db({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(t=>{this.playlistController_.updatePlaylistByKeyStatus(t.keyId,t.status)}));this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!e){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=cd.players[this.tech_.options_.playerId];if(!t||!t.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=t.qualityLevels();this.playlistController_.on("selectedinitialmedia",(()=>{cb(this.qualityLevels_,this)}));this.playlists.on("mediachange",(()=>{hb(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":eb,"mux.js":ib,"mpd-parser":sb,"m3u8-parser":nb,"aes-decrypter":rb}}version(){return this.constructor.version()}canChangeType(){return og.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&z.URL.revokeObjectURL){z.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(t,e){return Qp({playlist:this.playlistController_.media(),time:t,callback:e})}seekToProgramTime(t,e,i=true,s=2){return Zp({programTime:t,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})}setupXhrHooks_(){this.xhr.onRequest=t=>{gb(this.xhr,t)};this.xhr.onResponse=t=>{bb(this.xhr,t)};this.xhr.offRequest=t=>{yb(this.xhr,t)};this.xhr.offResponse=t=>{jb(this.xhr,t)};this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];const e=["gapjumped","playedrangeschanged"];t.forEach((t=>{this.playlistController_.on(t,(t=>{this.player_.trigger(it({},t))}))}));e.forEach((t=>{this.playbackWatcher_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}}const kb={name:"videojs-http-streaming",VERSION:eb,canHandleSource(t,e={}){const i=bd(cd.options,e);return kb.canPlayType(t.type,i)},handleSource(t,e,i={}){const s=bd(cd.options,i);e.vhs=new Tb(t,e,s);e.vhs.xhr=_p();e.vhs.setupXhrHooks_();e.vhs.src(t.src,t.type);return e.vhs},canPlayType(t,e){const i=si(t);if(!i){return""}const s=kb.getOverrideNative(e);const n=ob.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t;const i=!(cd.browser.IS_ANY_SAFARI||cd.browser.IS_IOS);const{overrideNative:s=i}=e;return s}};const Sb=()=>Ke("avc1.4d400d,mp4a.40.2");if(Sb()){cd.getTech("Html5").registerSourceHandler(kb,0)}cd.VhsHandler=Tb;cd.VhsSourceHandler=kb;cd.Vhs=ob;if(!cd.use){cd.registerComponent("Vhs",ob)}cd.options.vhs=cd.options.vhs||{};if(!cd.getPlugin||!cd.getPlugin("reloadSourceOnError")){cd.registerPlugin("reloadSourceOnError",tb)}const xb=Object.freeze({__proto__:null,default:cd});var Ab={exports:{}};const Eb=q(xb);(function(t,e){(function(e,i){{var s=Eb;t.exports=i(s.default||s)}})(U,(function(t){var e=t.browser.IS_IOS||t.browser.IS_NATIVE_ANDROID;var i=t.getTech("Tech");class s extends i{constructor(t,i){super(t,i);this.setPoster(t.poster);this.setSrc(this.options_.source,true);this.setTimeout(function(){if(this.el_){this.el_.parentNode.className+=" vjs-youtube";if(e){this.el_.parentNode.className+=" vjs-youtube-mobile"}if(s.isApiReady){this.initYTPlayer()}else{s.apiReadyQueue.push(this)}}}.bind(this))}dispose(){if(this.ytPlayer){if(this.ytPlayer.stopVideo){this.ytPlayer.stopVideo()}if(this.ytPlayer.destroy){this.ytPlayer.destroy()}}else{var t=s.apiReadyQueue.indexOf(this);if(t!==-1){s.apiReadyQueue.splice(t,1)}}this.ytPlayer=null;this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile","");this.el_.parentNode.removeChild(this.el_);i.prototype.dispose.call(this)}createEl(){var t=document.createElement("div");t.setAttribute("id",this.options_.techId);t.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute");t.setAttribute("class","vjs-tech");var i=document.createElement("div");i.appendChild(t);if(!e&&!this.options_.ytControls){var s=document.createElement("div");s.setAttribute("class","vjs-iframe-blocker");s.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%");s.onclick=function(){this.pause()}.bind(this);i.appendChild(s)}return i}initYTPlayer(){var t={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(typeof this.options_.autohide!=="undefined"){t.autohide=this.options_.autohide}if(typeof this.options_["cc_load_policy"]!=="undefined"){t["cc_load_policy"]=this.options_["cc_load_policy"]}if(typeof this.options_.ytControls!=="undefined"){t.controls=this.options_.ytControls}if(typeof this.options_.disablekb!=="undefined"){t.disablekb=this.options_.disablekb}if(typeof this.options_.color!=="undefined"){t.color=this.options_.color}if(!t.controls){t.fs=0}else if(typeof this.options_.fs!=="undefined"){t.fs=this.options_.fs}if(this.options_.source.src.indexOf("end=")!==-1){var e=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(e[1])}if(typeof this.options_.end!=="undefined"){t.end=this.options_.end}if(typeof this.options_.hl!=="undefined"){t.hl=this.options_.hl}else if(typeof this.options_.language!=="undefined"){t.hl=this.options_.language.substr(0,2)}if(typeof this.options_["iv_load_policy"]!=="undefined"){t["iv_load_policy"]=this.options_["iv_load_policy"]}if(typeof this.options_.list!=="undefined"){t.list=this.options_.list}else if(this.url&&typeof this.url.listId!=="undefined"){t.list=this.url.listId}if(typeof this.options_.listType!=="undefined"){t.listType=this.options_.listType}if(typeof this.options_.modestbranding!=="undefined"){t.modestbranding=this.options_.modestbranding}if(typeof this.options_.playlist!=="undefined"){t.playlist=this.options_.playlist}if(typeof this.options_.playsinline!=="undefined"){t.playsinline=this.options_.playsinline}if(typeof this.options_.rel!=="undefined"){t.rel=this.options_.rel}if(typeof this.options_.showinfo!=="undefined"){t.showinfo=this.options_.showinfo}if(this.options_.source.src.indexOf("start=")!==-1){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(typeof this.options_.start!=="undefined"){t.start=this.options_.start}if(typeof this.options_.theme!=="undefined"){t.theme=this.options_.theme}if(typeof this.options_.customVars!=="undefined"){var s=this.options_.customVars;Object.keys(s).forEach((function(e){t[e]=s[e]}))}this.activeVideoId=this.url?this.url.videoId:null;this.activeList=t.list;var n={videoId:this.activeVideoId,playerVars:t,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};if(typeof this.options_.enablePrivacyEnhancedMode!=="undefined"&&this.options_.enablePrivacyEnhancedMode){n.host="https://www.youtube-nocookie.com"}this.ytPlayer=new YT.Player(this.options_.techId,n)}onPlayerReady(){if(this.options_.muted){this.ytPlayer.mute()}var t=this.ytPlayer.getAvailablePlaybackRates();if(t.length>1){this.featuresPlaybackRate=true}this.playerReady_=true;this.triggerReady();if(this.playOnReady){this.play()}else if(this.cueOnReady){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(t){var e=t.data;if(e===this.lastState||this.errorNumber){return}this.lastState=e;switch(e){case-1:this.trigger("loadstart");this.trigger("loadedmetadata");this.trigger("durationchange");this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate");this.trigger("durationchange");this.trigger("playing");this.trigger("play");if(this.isSeeking){this.onSeeked()}break;case YT.PlayerState.PAUSED:this.trigger("canplay");if(this.isSeeking){this.onSeeked()}else{this.trigger("pause")}break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate");this.player_.trigger("waiting");break}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(t){this.errorNumber=t.data;this.trigger("pause");this.trigger("error")}error(){var t=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:t,message:"Error while trying to play the video"};case 2:case 100:return{code:t,message:"Unable to find the video"};case 101:case 150:return{code:t,message:"Playback on other Websites has been disabled by the video owner."}}return{code:t,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.loadVideoById(e)}cueVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.cueVideoById(e)}src(t){if(t){this.setSrc({src:t})}return this.source}poster(){if(e){return null}return this.poster_}setPoster(t){this.poster_=t}setSrc(t){if(!t||!t.src){return}delete this.errorNumber;this.source=t;this.url=s.parseUrl(t.src);if(!this.options_.poster){if(this.url.videoId){this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg";this.trigger("posterchange");this.checkHighResPoster()}}if(this.options_.autoplay&&!e){if(this.isReady_){this.play()}else{this.playOnReady=true}}else if(this.activeVideoId!==this.url.videoId){if(this.isReady_){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}else{this.cueOnReady=true}}}autoplay(){return this.options_.autoplay}setAutoplay(t){this.options_.autoplay=t}loop(){return this.options_.loop}setLoop(t){this.options_.loop=t}play(){if(!this.url||!this.url.videoId){return}this.wasPausedBeforeSeek=false;if(this.isReady_){if(this.url.listId){if(this.activeList===this.url.listId){this.ytPlayer.playVideo()}else{this.ytPlayer.loadPlaylist(this.url.listId);this.activeList=this.url.listId}}if(this.activeVideoId===this.url.videoId){this.ytPlayer.playVideo()}else{this.loadVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}else{this.trigger("waiting");this.playOnReady=true}}pause(){if(this.ytPlayer){this.ytPlayer.pauseVideo()}}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:true}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(t){if(this.lastState===YT.PlayerState.PAUSED){this.timeBeforeSeek=this.currentTime()}if(!this.isSeeking){this.wasPausedBeforeSeek=this.paused()}this.ytPlayer.seekTo(t,true);this.trigger("timeupdate");this.trigger("seeking");this.isSeeking=true;if(this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==t){clearInterval(this.checkSeekedInPauseInterval);this.checkSeekedInPauseInterval=setInterval(function(){if(this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking){clearInterval(this.checkSeekedInPauseInterval)}else if(this.currentTime()!==this.timeBeforeSeek){this.trigger("timeupdate");this.onSeeked()}}.bind(this),250)}}seeking(){return this.isSeeking}seekable(){if(!this.ytPlayer){return t.createTimeRange()}return t.createTimeRange(0,this.ytPlayer.getDuration())}onSeeked(){clearInterval(this.checkSeekedInPauseInterval);this.isSeeking=false;if(this.wasPausedBeforeSeek){this.pause()}this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(t){if(!this.ytPlayer){return}this.ytPlayer.setPlaybackRate(t)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:false}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(t){if(!this.ytPlayer){return}this.ytPlayer.setVolume(t*100)}muted(){return this.ytPlayer?this.ytPlayer.isMuted():false}setMuted(t){if(!this.ytPlayer){return}else{this.muted(true)}if(t){this.ytPlayer.mute()}else{this.ytPlayer.unMute()}this.setTimeout((function(){this.trigger("volumechange")}),50)}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction){return t.createTimeRange()}var e=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return t.createTimeRange(0,e)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var t="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var e=new Image;e.onload=function(){if("naturalHeight"in e){if(e.naturalHeight<=90||e.naturalWidth<=120){return}}else if(e.height<=90||e.width<=120){return}this.poster_=t;this.trigger("posterchange")}.bind(this);e.onerror=function(){};e.src=t}catch(t){}}}s.isSupported=function(){return true};s.canPlaySource=function(t){return s.canPlayType(t.type)};s.canPlayType=function(t){return t==="video/youtube"};s.parseUrl=function(t){var e={videoId:null};var i=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;var s=t.match(i);if(s&&s[2].length===11){e.videoId=s[2]}var n=/[?&]list=([^#\&\?]+)/;s=t.match(n);if(s&&s[1]){e.listId=s[1]}return e};function n(){YT.ready((function(){s.isApiReady=true;for(var t=0;t<s.apiReadyQueue.length;++t){s.apiReadyQueue[t].initYTPlayer()}}))}function r(t,e){var i=false;var s=document.createElement("script");var n=document.getElementsByTagName("script")[0];if(!n){return}n.parentNode.insertBefore(s,n);s.onload=function(){if(!i){i=true;e()}};s.onreadystatechange=function(){if(!i&&(this.readyState==="complete"||this.readyState==="loaded")){i=true;e()}};s.src=t}function o(){var t=".vjs-youtube .vjs-iframe-blocker { display: none; }"+".vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }"+".vjs-youtube .vjs-poster { background-size: cover; }"+".vjs-youtube-mobile .vjs-big-play-button { display: none; }";var e=document.head||document.getElementsByTagName("head")[0];var i=document.createElement("style");i.type="text/css";if(i.styleSheet){i.styleSheet.cssText=t}else{i.appendChild(document.createTextNode(t))}e.appendChild(i)}s.apiReadyQueue=[];if(typeof document!=="undefined"){r("https://www.youtube.com/iframe_api",n);o()}if(typeof t.registerTech!=="undefined"){t.registerTech("Youtube",s)}else{t.registerComponent("Youtube",s)}}))})(Ab);const Ib='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid #fff;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:rgba(50,50,50,.5);cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:rgba(50,50,50,.9)}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}*{box-sizing:border-box}content-video{display:block;width:100%;position:relative}content-video.content-video--fit-container .video-js.vjs-fluid{height:100%;padding:0}content-video[fit-container=true]{height:100%}content-video .content-video__content{display:block;width:100%;height:100%}content-video .content-video__poster{position:relative}content-video .content-video__play{display:none}content-video .vjs-content-block-theme.video-js{width:100%;height:100%}content-video .vjs-content-block-theme.video-js video.vjs-tech{position:static}content-video .vjs-content-block-theme.vjs-ended .vjs-loading-spinner,content-video .vjs-content-block-theme.vjs-waiting .vjs-loading-spinner{display:none}content-video .vjs-content-block-theme:hover .vjs-big-play-button,content-video .vjs-content-block-theme:focus .vjs-big-play-button{background-color:transparent}content-video .vjs-content-block-theme .vjs-big-play-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);border:none;background:transparent}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder{display:block;width:100%;height:100%}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder:before{display:none}content-video .vjs-poster{display:none}';const Db=Ib;const Cb=class{constructor(e){t(this,e);this.method="youtube";this.autoplay=false;this.autoplayMute=true;this.src="";this.width=16;this.height=9;this.type="video/mp4";this.playButtonAriaLabel="Play";this.classes=undefined;this.classString=undefined;this.controls=true;this.preload="metadata";this.fitContainer="false";this.isLoaded=false;this.hasPoster=false;this.isPlayed=false}computedVideoConfig(){let t={};t={fill:o(this.fitContainer)==="true",fluid:o(this.fitContainer)==="false",autoplay:this.autoplay===true?this.autoplayMute?"muted":"any":false,techOrder:["youtube"],src:this.src,sources:[{type:"video/youtube",src:this.src}],youtube:{showinfo:0,rel:0,modestbranding:1}};console.log(t);return t}initVideo(){this.isLoaded=true}componentWillLoad(){r.registerProp(this.classes).subscribe((t=>this.classString=t))}componentDidLoad(){this.player=cd(this.videoElement)}onClickHandler(t){t.preventDefault();if(!this.isLoaded){return false}this.initVideo();this.isPlayed=true;this.player.play();if(this.method==="html5"){this.videoElement.play()}}render(){let t=!this.autoplay&&(this.hasPoster&&!this.isPlayed||!this.isPlayed);return e(i,{key:"22cffbd35601f37a8bbc0bd5eda02cda1688c9cc",class:this.classString},this.hasPoster&&!this.isLoaded&&e("div",{key:"a49d09ea914a8fc90c3dc10bab99e74347fad000",class:"content-video__poster"},e("slot",{key:"b1e57d86ac11a2b03950bb9ffb40f73253ac838b",name:"poster"})),t&&e("button",{key:"14dbd5508a52b66ab112d2dbfd1d5de3b96310eb",class:"content-video__play","aria-label":this.playButtonAriaLabel,onClick:t=>this.onClickHandler(t)},e("slot",{key:"6ae7662d21f79e8c05c5d17652cbb7e37533cb5d",name:"playButton"})),e("div",{key:"3b942a282fd0df1e22569fd02ff248065f67374e",class:"content-video__content"},(!this.hasPoster||this.isLoaded)&&e("video",{key:"d93067f22489d1afcfefcd7413e81c41e37d0c37",ref:t=>this.videoElement=t,class:"video-js vjs-content-block-theme",controls:this.controls,preload:this.preload,width:this.width,height:this.height,crossorigin:"anonymous","data-setup":JSON.stringify(this.computedVideoConfig())},e("slot",{key:"8c784e20d7938cfb890d2877d208bbf514735ad4",name:"no-js-message"}),e("slot",{key:"351930777416a2bbc6a89a37e2e69f241a3dbf9c",name:"content"}),e("slot",{key:"f06a2361d6397fca3d15a9a5533e94667a73bf15"}))))}get hostElement(){return s(this)}};Cb.style=Db;export{l as content_accordion,d as content_button,m as content_grid_formatter,y as content_hero_block,T as content_image,x as content_line,C as content_overlay,O as content_spacer,L as content_text_block,F as content_tout_block,Cb as content_video};
26
+ //# sourceMappingURL=p-398760b3.entry.js.map