PageSourceSearch

https://gopractice.io/course/aicases/_app_gp_aicases_en/4b491c2.js

js gopractice.io collected 2026-09-25 19:04:22 UTC 712,152 bytes, 2 lines download raw bytes

vendor: 8,232 bytes, lines 1-2
1/*! For license information please see LICENSES */
2(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{1008:function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return Zn});var r=n(1009),o=n.n(r),l=n(1716),h=n.n(l),d=n(1954),c=n.n(d),m=n(1958),f=n.n(m),y=n(1350),_=n.n(y),v=n(1717),T=n(2117),S=n(1962),E=n(1963),w=n(1036),C=n(2118),k=n(1968),x=n.n(k),I=n(1720),A=n(2116),D=n(1970),O="8.23.6";const P={},L=function(e,t){return P[e]=P[e]||[],t&&(P[e]=P[e].concat(t)),P[e]},R=function(e,t){const n=L(e).indexOf(t);return!(n<=-1)&&(P[e]=P[e].slice(),P[e].splice(n,1),!0)},N={prefixed:!0},M=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],U=M[0];let B;for(let i=0;i<M.length;i++)if(M[i][1]in h.a){B=M[i];break}if(B){for(let i=0;i<B.length;i++)N[U[i]]=B[i];N.prefixed=B[0]!==U[0]}let F=[];const j=function e(t,n=":",r=""){let l,h="info";function d(...e){l("log",h,e)}return l=((e,t,n)=>(r,l,h)=>{const d=t.levels[l],c=new RegExp(`^(${d})$`);let m=e;if("log"!==r&&h.unshift(r.toUpperCase()+":"),n&&(m=`%c${e}`,h.unshift(n)),h.unshift(m+":"),F){F.push([].concat(h));const e=F.length-1e3;F.splice(0,e>0?e:0)}if(!o.a.console)return;let f=o.a.console[r];f||"debug"!==r||(f=o.a.console.info||o.a.console.log),f&&d&&c.test(r)&&f[Array.isArray(h)?"apply":"call"](o.a.console,h)})(t,d,r),d.createLogger=(o,l,h)=>{const d=void 0!==l?l:n;return e(`${t} ${d} ${o}`,d,void 0!==h?h:r)},d.createNewLogger=(t,n,r)=>e(t,n,r),d.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:h},d.level=e=>{if("string"==typeof e){if(!d.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);h=e}return h},d.history=()=>F?[].concat(F):[],d.history.filter=e=>(F||[]).filter(t=>new RegExp(`.*${e}.*`).test(t[0])),d.history.clear=()=>{F&&(F.length=0)},d.history.disable=()=>{null!==F&&(F.length=0,F=null)},d.history.enable=()=>{null===F&&(F=[])},d.error=(...e)=>l("error",h,e),d.warn=(...e)=>l("warn",h,e),d.debug=(...e)=>l("debug",h,e),d}("VIDEOJS"),$=j.createLogger,V=Object.prototype.toString,H=function(object){return G(object)?Object.keys(object):[]};function z(object,e){H(object).forEach(t=>e(object[t],t))}function W(object,e,t=0){return H(object).reduce((t,n)=>e(t,object[n],n),t)}function G(e){return!!e&&"object"==typeof e}function X(e){return G(e)&&"[object Object]"===V.call(e)&&e.constructor===Object}function K(...e){const t={};return e.forEach(source=>{source&&z(source,(e,n)=>{X(e)?(X(t[n])||(t[n]={}),t[n]=K(t[n],e)):t[n]=e})}),t}function Y(source={}){const e=[];for(const t in source)if(source.hasOwnProperty(t)){const n=source[t];e.push(n)}return e}function Q(e,t,n,r=!0){const o=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),l={configurable:!0,enumerable:!0,get(){const e=n();return o(e),e}};return r&&(l.set=o),Object.defineProperty(e,t,l)}var J=Object.freeze({__proto__:null,each:z,reduce:W,isObject:G,isPlain:X,merge:K,values:Y,defineLazyProperty:Q});let Z,ee=!1,te=null,ie=!1,se=!1,ne=!1,re=!1,ae=!1,oe=null,le=null;const ue=Boolean(o.a.cast&&o.a.cast.framework&&o.a.cast.framework.CastReceiverContext);let he=null,de=!1,ce=!1,pe=!1,me=!1,ge=!1,fe=!1,ye=!1;const _e=Boolean(we()&&("ontouchstart"in o.a||o.a.navigator.maxTouchPoints||o.a.DocumentTouch&&o.a.document instanceof o.a.DocumentTouch)),be=o.a.navigator&&o.a.navigator.userAgentData;if(be&&be.platform&&be.brands&&(ie="Android"===be.platform,ne=Boolean(be.brands.find(b=>"Microsoft Edge"===b.brand)),re=Boolean(be.brands.find(b=>"Chromium"===b.brand)),ae=!ne&&re,oe=le=(be.brands.find(b=>"Chromium"===b.brand)||{}).version||null,ce="Windows"===be.platform),!re){const e=o.a.navigator&&o.a.navigator.userAgent||"";ee=/iPod/i.test(e),te=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),ie=/Android/i.test(e),Z=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+"."+t[2]):n||null}(),se=/Firefox/i.test(e),ne=/Edg/i.test(e),re=/Chrome/i.test(e)||/CriOS/i.test(e),ae=!ne&&re,oe=le=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),he=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),ge=/Tizen/i.test(e),fe=/Web0S/i.test(e),ye=ge||fe,de=/Safari/i.test(e)&&!ae&&!ie&&!ne&&!ye,ce=/Windows/i.test(e),pe=/iPad/i.test(e)||de&&_e&&!/iPhone/i.test(e),me=/iPhone/i.test(e)&&!pe}const ve=me||pe||ee,Te=(de||ve)&&!ae;var Se=Object.freeze({__proto__:null,get IS_IPOD(){return ee},get IOS_VERSION(){return te},get IS_ANDROID(){return ie},get ANDROID_VERSION(){return Z},get IS_FIREFOX(){return se},get IS_EDGE(){return ne},get IS_CHROMIUM(){return re},get IS_CHROME(){return ae},get CHROMIUM_VERSION(){return oe},get CHROME_VERSION(){return le},IS_CHROMECAST_RECEIVER:ue,get IE_VERSION(){return he},get IS_SAFARI(){return de},get IS_WINDOWS(){return ce},get IS_IPAD(){return pe},get IS_IPHONE(){return me},get IS_TIZEN(){return ge},get IS_WEBOS(){return fe},get IS_SMART_TV(){return ye},TOUCH_ENABLED:_e,IS_IOS:ve,IS_ANY_SAFARI:Te});function Ee(e){return"string"==typeof e&&Boolean(e.trim())}function we(){return h.a===o.a.document}function Ce(e){return G(e)&&1===e.nodeType}function ke(){try{return o.a.parent!==o.a.self}catch(e){return!0}}function xe(e){return function(t,n){if(!Ee(t))return h.a[e](null);Ee(n)&&(n=h.a.querySelector(n));const r=Ce(n)?n:h.a;return r[e]&&r[e](t)}}function Ie(e="div",t={},n={},content){const r=h.a.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){const n=t[e];"textContent"===e?Ae(r,n):r[e]===n&&"tabIndex"!==e||(r[e]=n)}),Object.getOwnPropertyNames(n).forEach(function(e){r.setAttribute(e,n[e])}),content&&Xe(r,content),r}function Ae(e,text){return void 0===e.textContent?e.innerText=text:e.textContent=text,e}function De(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Oe(element,e){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(e),element.classList.contains(e)}function Pe(element,...e){return element.classList.add(...e.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),element}function Le(element,...e){return element?(element.classList.remove(...e.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),element):(j.warn("removeClass was called with an element that doesn't exist"),null)}function Re(element,e,t){return"function"==typeof t&&(t=t(element,e)),"boolean"!=typeof t&&(t=void 0),e.split(/\s+/).forEach(e=>element.classList.toggle(e,t)),element}function Ne(e,t){Object.getOwnPropertyNames(t).forEach(function(n){const r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)})}function Me(e){const t={},n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const r=e.attributes;for(let i=r.length-1;i>=0;i--){const e=r[i].name;let o=r[i].value;n.includes(e)&&(o=null!==o),t[e]=o}}return t}function Ue(e,t){return e.getAttribute(t)}function Be(e,t,n){e.setAttribute(t,n)}function Fe(e,t){e.removeAttribute(t)}function je(){h.a.body.focus(),h.a.onselectstart=function(){return!1}}function qe(){h.a.onselectstart=function(){return!0}}function $e(e){if(e&&e.getBoundingClientRect&&e.parentNode){const rect=e.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==rect[e]&&(t[e]=rect[e])}),t.height||(t.height=parseFloat(Ze(e,"height"))),t.width||(t.width=parseFloat(Ze(e,"width"))),t}}function Ve(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,n=e.offsetHeight;let r=0,o=0;for(;e.offsetParent&&e!==h.a[N.fullscreenElement];)r+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{left:r,top:o,width:t,height:n}}function He(e,t){const n={x:0,y:0};if(ve){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Ze(t,"transform");
vendor: 8,196 bytes, line 2
2if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&o.a.WebKitCSSMatrix){const e=o.a.getComputedStyle(t.assignedSlot.parentElement).transform,r=new o.a.WebKitCSSMatrix(e);n.x+=r.m41,n.y+=r.m42}t=t.parentNode||t.host}}const r={},l=Ve(t.target),h=Ve(e),d=h.width,c=h.height;let m=t.offsetY-(h.top-l.top),f=t.offsetX-(h.left-l.left);return t.changedTouches&&(f=t.changedTouches[0].pageX-h.left,m=t.changedTouches[0].pageY+h.top,ve&&(f-=n.x,m-=n.y)),r.y=1-Math.max(0,Math.min(1,m/c)),r.x=Math.max(0,Math.min(1,f/d)),r}function ze(e){return G(e)&&3===e.nodeType}function We(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ge(content){return"function"==typeof content&&(content=content()),(Array.isArray(content)?content:[content]).map(e=>("function"==typeof e&&(e=e()),Ce(e)||ze(e)?e:"string"==typeof e&&/\S/.test(e)?h.a.createTextNode(e):void 0)).filter(e=>e)}function Xe(e,content){return Ge(content).forEach(t=>e.appendChild(t)),e}function Ke(e,content){return Xe(We(e),content)}function Ye(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||("mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons)))}const Qe=xe("querySelector"),Je=xe("querySelectorAll");function Ze(e,t){if(!e||!t)return"";if("function"==typeof o.a.getComputedStyle){let n;try{n=o.a.getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}function et(e){[...h.a.styleSheets].forEach(t=>{try{const n=[...t.cssRules].map(e=>e.cssText).join(""),style=h.a.createElement("style");style.textContent=n,e.document.head.appendChild(style)}catch(n){const link=h.a.createElement("link");link.rel="stylesheet",link.type=t.type,link.media=t.media.mediaText,link.href=t.href,e.document.head.appendChild(link)}})}var tt=Object.freeze({__proto__:null,isReal:we,isEl:Ce,isInFrame:ke,createEl:Ie,textContent:Ae,prependTo:De,hasClass:Oe,addClass:Pe,removeClass:Le,toggleClass:Re,setAttributes:Ne,getAttributes:Me,getAttribute:Ue,setAttribute:Be,removeAttribute:Fe,blockTextSelection:je,unblockTextSelection:qe,getBoundingClientRect:$e,findPosition:Ve,getPointerPosition:He,isTextNode:ze,emptyEl:We,normalizeContent:Ge,appendContent:Xe,insertContent:Ke,isSingleLeftClick:Ye,$:Qe,$$:Je,computedStyle:Ze,copyStyleSheetsToWindow:et});let it,st=!1;const nt=function(){if(!1===it.options.autoSetup)return;const e=Array.prototype.slice.call(h.a.getElementsByTagName("video")),t=Array.prototype.slice.call(h.a.getElementsByTagName("audio")),n=Array.prototype.slice.call(h.a.getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(let i=0,e=r.length;i<e;i++){const e=r[i];if(!e||!e.getAttribute){at(1);break}if(void 0===e.player){null!==e.getAttribute("data-setup")&&it(e)}}else st||at(1)};function at(e,t){we()&&(t&&(it=t),o.a.setTimeout(nt,e))}function ot(){st=!0,o.a.removeEventListener("load",ot)}we()&&("complete"===h.a.readyState?ot():o.a.addEventListener("load",ot));const lt=function(e){const style=h.a.createElement("style");return style.className=e,style},ut=function(e,content){e.styleSheet?e.styleSheet.cssText=content:e.textContent=content};var ht=new WeakMap;let ct,pt=3;function mt(){return pt++}function gt(e,t){if(!ht.has(e))return;const data=ht.get(e);0===data.handlers[t].length&&(delete data.handlers[t],e.removeEventListener?e.removeEventListener(t,data.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,data.dispatcher)),Object.getOwnPropertyNames(data.handlers).length<=0&&(delete data.handlers,delete data.dispatcher,delete data.disabled),0===Object.getOwnPropertyNames(data).length&&ht.delete(e)}function ft(e,t,n,r){n.forEach(function(n){e(t,n,r)})}function yt(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const r=e||o.a.event;e={};const l=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const t in r)l.includes(t)||"returnValue"===t&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||h.a),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){const t=h.a.documentElement,body=h.a.body;e.pageX=e.clientX+(t&&t.scrollLeft||body&&body.scrollLeft||0)-(t&&t.clientLeft||body&&body.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||body&&body.scrollTop||0)-(t&&t.clientTop||body&&body.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const _t=["touchstart","touchmove"];function bt(e,t,n){if(Array.isArray(t))return ft(bt,e,t,n);ht.has(e)||ht.set(e,{});const data=ht.get(e);if(data.handlers||(data.handlers={}),data.handlers[t]||(data.handlers[t]=[]),n.guid||(n.guid=mt()),data.handlers[t].push(n),data.dispatcher||(data.disabled=!1,data.dispatcher=function(t,n){if(data.disabled)return;t=yt(t);const r=data.handlers[t.type];if(r){const o=r.slice(0);for(let r=0,l=o.length;r<l&&!t.isImmediatePropagationStopped();r++)try{o[r].call(e,t,n)}catch(e){j.error(e)}}}),1===data.handlers[t].length)if(e.addEventListener){let n=!1;(function(){if("boolean"!=typeof ct){ct=!1;try{const e=Object.defineProperty({},"passive",{get(){ct=!0}});o.a.addEventListener("test",null,e),o.a.removeEventListener("test",null,e)}catch(e){}}return ct})()&&_t.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,data.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,data.dispatcher)}function vt(e,t,n){if(!ht.has(e))return;const data=ht.get(e);if(!data.handlers)return;if(Array.isArray(t))return ft(vt,e,t,n);const r=function(e,t){data.handlers[t]=[],gt(e,t)};if(void 0===t){for(const t in data.handlers)Object.prototype.hasOwnProperty.call(data.handlers||{},t)&&r(e,t);return}const o=data.handlers[t];if(o)if(n){if(n.guid)for(let e=0;e<o.length;e++)o[e].guid===n.guid&&o.splice(e--,1);gt(e,t)}else r(e,t)}function Tt(e,t,n){const r=ht.has(e)?ht.get(e):{},o=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=yt(t),r.dispatcher&&r.dispatcher.call(e,t,n),o&&!t.isPropagationStopped()&&!0===t.bubbles)Tt.call(null,o,t,n);else if(!o&&!t.defaultPrevented&&t.target&&t.target[t.type]){ht.has(t.target)||ht.set(t.target,{});const e=ht.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function St(e,t,n){if(Array.isArray(t))return ft(St,e,t,n);const r=function(){vt(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||mt(),bt(e,t,r)}function Et(e,t,n){const r=function(){vt(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||mt(),bt(e,t,r)}var wt=Object.freeze({__proto__:null,fixEvent:yt,on:bt,off:vt,trigger:Tt,one:St,any:Et});const Ct=30,kt=function(e,t,n){t.guid||(t.guid=mt());const r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},xt=function(e,t){let n=o.a.performance.now();return function(...r){const l=o.a.performance.now();l-n>=t&&(e(...r),n=l)}},It=function(e,t,n,r=o.a){let l;const h=function(){const o=this,h=arguments;let d=function(){l=null,d=null,n||e.apply(o,h)};!l&&n&&e.apply(o,h),r.clearTimeout(l),l=r.setTimeout(d,t)};return h.cancel=()=>{r.clearTimeout(l),l=null},h};var At=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ct,bind_:kt,throttle:xt,debounce:It});let Dt;class Ot{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},bt(this,e,t),this.addEventListener=n}off(e,t){vt(this,e,t)}
vendor: 1,395 bytes, line 2
2one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},St(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Et(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=yt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Tt(this,e)}queueTrigger(e){Dt||(Dt=new Map);const t=e.type||e;let map=Dt.get(this);map||(map=new Map,Dt.set(this,map));const n=map.get(t);map.delete(t),o.a.clearTimeout(n);const r=o.a.setTimeout(()=>{map.delete(t),0===map.size&&(map=null,Dt.delete(this)),this.trigger(e)},0);map.set(t,r)}}Ot.prototype.allowedEvents_={},Ot.prototype.addEventListener=Ot.prototype.on,Ot.prototype.removeEventListener=Ot.prototype.off,Ot.prototype.dispatchEvent=Ot.prototype.trigger;const Pt=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,Lt=object=>object instanceof Ot||!!object.eventBusEl_&&["on","one","off","trigger"].every(e=>"function"==typeof object[e]),Rt=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Nt=(e,t,n)=>{if(!e||!e.nodeName&&!Lt(e))throw new Error(`Invalid target for ${Pt(t)}#${n}; must be a DOM node or evented object.`)},Mt=(e,t,n)=>{if(!Rt(e))throw new Error(`Invalid event type for ${Pt(t)}#${n}; must be a non-empty string or array.`)}
vendor: 5,054 bytes, line 2
2,Ut=(e,t,n)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${Pt(t)}#${n}; must be a function.`)},Bt=(e,t,n)=>{const r=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let o,l,h;return r?(o=e.eventBusEl_,t.length>=3&&t.shift(),[l,h]=t):(o=t[0],l=t[1],h=t[2]),Nt(o,e,n),Mt(l,e,n),Ut(h,e,n),h=kt(e,h),{isTargetingSelf:r,target:o,type:l,listener:h}},Ft=(e,t,n,r)=>{Nt(e,e,t),e.nodeName?wt[t](e,n,r):e[t](n,r)},jt={on(...e){const{isTargetingSelf:t,target:n,type:r,listener:o}=Bt(this,e,"on");if(Ft(n,"on",r,o),!t){const e=()=>this.off(n,r,o);e.guid=o.guid;const t=()=>this.off("dispose",e);t.guid=o.guid,Ft(this,"on","dispose",e),Ft(n,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:n,type:r,listener:o}=Bt(this,e,"one");if(t)Ft(n,"one",r,o);else{const e=(...t)=>{this.off(n,r,e),o.apply(null,t)};e.guid=o.guid,Ft(n,"one",r,e)}},any(...e){const{isTargetingSelf:t,target:n,type:r,listener:o}=Bt(this,e,"any");if(t)Ft(n,"any",r,o);else{const e=(...t)=>{this.off(n,r,e),o.apply(null,t)};e.guid=o.guid,Ft(n,"any",r,e)}},off(e,t,n){if(!e||Rt(e))vt(this.eventBusEl_,e,t);else{const r=e,o=t;Nt(r,this,"off"),Mt(o,this,"off"),Ut(n,this,"off"),n=kt(this,n),this.off("dispose",n),r.nodeName?(vt(r,o,n),vt(r,"dispose",n)):Lt(r)&&(r.off(o,n),r.off("dispose",n))}},trigger(e,t){Nt(this.eventBusEl_,this,"trigger");const n=e&&"string"!=typeof e?e.type:e;if(!Rt(n))throw new Error(`Invalid event type for ${Pt(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Tt(this.eventBusEl_,e,t)}};function qt(e,t={}){const{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw new Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=Ie("span",{className:"vjs-event-bus"});return Object.assign(e,jt),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&ht.has(e)&&ht.delete(e)}),o.a.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const $t={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),z(e,(e,n)=>{this.state[n]!==e&&(t=t||{},t[n]={from:this.state[n],to:e}),this.state[n]=e}),t&&Lt(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Vt(e,t){return Object.assign(e,$t),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&Lt(e)&&e.on("statechanged",e.handleStateChanged),e}const Ht=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},zt=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},Wt=function(e,t){return zt(e)===zt(t)};var Gt=Object.freeze({__proto__:null,toLowerCase:Ht,toTitleCase:zt,titleCaseEquals:Wt});class Xt{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=K({},this.options_),t=this.options_=K(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${mt()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(qt(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Vt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=K(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return Ie(e,t,n)}localize(e,t,n=e){const code=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),o=r&&r[code],l=code&&code.split("-")[0],h=r&&r[l];let d=n;return o&&o[e]?d=o[e]:h&&h[e]&&(d=h[e]),t&&(d=d.replace(/\{(\d+)\}/g,function(e,n){const r=t[n-1];let o=r;return void 0===r&&(o=e),o})),d}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}
vendor: 46,100 bytes, line 2
2getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const n="http://www.w3.org/2000/svg",r=Ie("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),o=h.a.createElementNS(n,"svg");o.setAttributeNS(null,"viewBox","0 0 512 512");const l=h.a.createElementNS(n,"use");return o.appendChild(l),l.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(o),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let component,r;if("string"==typeof e){r=zt(e);const n=t.componentClass||r;t.name=r;const o=Xt.getComponent(n);if(!o)throw new Error(`Component ${n} does not exist`);if("function"!=typeof o)return null;component=new o(this.player_||this,t)}else component=e;if(component.parentComponent_&&component.parentComponent_.removeChild(component),this.children_.splice(n,0,component),component.parentComponent_=this,"function"==typeof component.id&&(this.childIndex_[component.id()]=component),r=r||component.name&&zt(component.name()),r&&(this.childNameIndex_[r]=component,this.childNameIndex_[Ht(r)]=component),"function"==typeof component.el&&component.el()){let e=null;this.children_[n+1]&&(this.children_[n+1].el_?e=this.children_[n+1].el_:Ce(this.children_[n+1])&&(e=this.children_[n+1])),this.contentEl().insertBefore(component.el(),e)}return component}removeChild(component){if("string"==typeof component&&(component=this.getChild(component)),!component||!this.children_)return;let e=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===component){e=!0,this.children_.splice(i,1);break}if(!e)return;component.parentComponent_=null,this.childIndex_[component.id()]=null,this.childNameIndex_[zt(component.name())]=null,this.childNameIndex_[Ht(component.name())]=null;const t=component.el();t&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(component.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=e=>{const n=e.name;let r=e.opts;if(void 0!==t[n]&&(r=t[n]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;const o=this.addChild(n,r);o&&(this[n]=o)};let r;const o=Xt.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(e){return!r.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let n,r;return"string"==typeof t?(n=t,r=e[n]||this.options_[n]||{}):(n=t.name,r=t),{name:n,opts:r}}).filter(e=>{const t=Xt.getComponent(e.opts.componentClass||zt(e.name));return t&&!o.isTech(t)}).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return Qe(e,t||this.contentEl())}$$(e,t){return Je(e,t||this.contentEl())}hasClass(e){return Oe(this.el_,e)}addClass(...e){Pe(this.el_,...e)}removeClass(...e){Le(this.el_,...e)}toggleClass(e,t){Re(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Ue(this.el_,e)}setAttribute(e,t){Be(this.el_,e,t)}removeAttribute(e){Fe(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],o=r.indexOf("px");return-1!==o?parseInt(r.slice(0,o),10):parseInt(this.el_["offset"+zt(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ze(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const n=`offset${zt(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const rect=this.el_.getBoundingClientRect();return{boundingClientRect:{x:rect.x,y:rect.y,width:rect.width,height:rect.height,top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left},center:{x:rect.left+rect.width/2,y:rect.top+rect.height/2,width:0,height:0,top:rect.top+rect.height/2,right:rect.left+rect.width/2,bottom:rect.top+rect.height/2,left:rect.left+rect.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;let n;this.on("touchstart",function(r){1===r.touches.length&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=o.a.performance.now(),n=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)n=!1;else if(t){const r=e.touches[0].pageX-t.pageX,o=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+o*o)>10&&(n=!1)}});const r=function(){n=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){if(t=null,!0===n){o.a.performance.now()-e<200&&(r.preventDefault(),this.trigger("tap"))}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=kt(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=kt(this,e),this.clearTimersOnDispose_(),n=o.a.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),o.a.clearTimeout(e)),e}setInterval(e,t){e=kt(this,e),this.clearTimersOnDispose_();const n=o.a.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),o.a.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=kt(this,e),t=o.a.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=kt(this,t);const n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),o.a.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,n)=>this[t](n))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(element){const e=o.a.getComputedStyle(element,null),t=e.getPropertyValue("visibility");return"none"!==e.getPropertyValue("display")&&!["hidden","collapse"].includes(t)}return e||(e=this.el()),!!(function(element){if(element.offsetWidth+element.offsetHeight+element.getBoundingClientRect().height+element.getBoundingClientRect().width===0)return!1;const e={x:element.getBoundingClientRect().left+element.offsetWidth/2,y:element.getBoundingClientRect().top+element.offsetHeight/2};if(e.x<0)return!1;if(e.x>(h.a.documentElement.clientWidth||o.a.innerWidth))return!1;if(e.y<0)return!1;if(e.y>(h.a.documentElement.clientHeight||o.a.innerHeight))return!1;let t=h.a.elementFromPoint(e.x,e.y);for(;t;){if(t===element)return!0;if(!t.parentNode)return!1;t=t.parentNode}}(e)&&(element=e,t(element.parentElement)&&t(element)&&"0"!==element.style.opacity&&"0px"!==o.a.getComputedStyle(element).height&&"0px"!==o.a.getComputedStyle(element).width)&&(!e.parentElement||e.tabIndex>=0));var element}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Xt.getComponent("Tech"),r=n&&n.isTech(t),o=Xt===t||Xt.prototype.isPrototypeOf(t.prototype);if(r||!o){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=zt(e),Xt.components_||(Xt.components_={});const l=Xt.getComponent("Player");if("Player"===e&&l&&l.players){const e=l.players,t=Object.keys(e);if(e&&t.length>0)for(let i=0;i<t.length;i++)if(null!==e[t[i]])throw new Error("Can not register Player component after player has been created.")}return Xt.components_[e]=t,Xt.components_[Ht(e)]=t,t}static getComponent(e){if(e&&Xt.components_)return Xt.components_[e]}}function Kt(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}(e,r,n.length-1),n[r][t]}function Yt(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Kt.bind(null,"start",0,e),end:Kt.bind(null,"end",1,e)},o.a.Symbol&&o.a.Symbol.iterator&&(t[o.a.Symbol.iterator]=()=>(e||[]).values()),t}function Qt(e,t){return Array.isArray(e)?Yt(e):void 0===e||void 0===t?Yt():Yt([[e,t]])}Xt.registerComponent("Component",Xt);const Jt=function(e,t){e=e<0?0:e;let s=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);const o=Math.floor(t/60%60),l=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=s="-"),r=r>0||l>0?r+":":"",n=((r||o>=10)&&n<10?"0"+n:n)+":",s=s<10?"0"+s:s,r+n+s};let Zt=Jt;function ei(e){Zt=e}function ti(){Zt=Jt}function ii(e,t=e){return Zt(e,t)}var si=Object.freeze({__proto__:null,createTimeRanges:Qt,createTimeRange:Qt,setFormatTime:ei,resetFormatTime:ti,formatTime:ii});function ni(e,t){let n,r,o=0;if(!t)return 0;e&&e.length||(e=Qt(0,0));for(let i=0;i<e.length;i++)n=e.start(i),r=e.end(i),r>t&&(r=t),o+=r-n;return o/t}function ri(e){if(e instanceof ri)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:G(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=ri.defaultMessages[this.code]||"")}function ai(e){return null!=e&&"function"==typeof e.then}function oi(e){ai(e)&&e.then(null,e=>{})}ri.prototype.code=0,ri.prototype.message="",ri.prototype.status=null,ri.prototype.metadata=null,ri.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ri.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},ri.MEDIA_ERR_CUSTOM=0,ri.prototype.MEDIA_ERR_CUSTOM=0,ri.MEDIA_ERR_ABORTED=1,ri.prototype.MEDIA_ERR_ABORTED=1,ri.MEDIA_ERR_NETWORK=2,ri.prototype.MEDIA_ERR_NETWORK=2,ri.MEDIA_ERR_DECODE=3,ri.prototype.MEDIA_ERR_DECODE=3,ri.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ri.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,ri.MEDIA_ERR_ENCRYPTED=5,ri.prototype.MEDIA_ERR_ENCRYPTED=5;const ui=function(track){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(track[t]&&(e[t]=track[t]),e),{cues:track.cues&&Array.prototype.map.call(track.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var hi=function(e){const t=e.$$("track"),n=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){const t=ui(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(track){return-1===n.indexOf(track)}).map(ui))},di=function(e,t){return e.forEach(function(track){const e=t.addRemoteTextTrack(track).track;!track.src&&track.cues&&track.cues.forEach(t=>e.addCue(t))}),t.textTracks()},ci=ui;const pi="vjs-modal-dialog";class mi extends Xt{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Ie("div",{className:`${pi}-content`},{role:"document"}),this.descEl_=Ie("p",{className:`${pi}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Ae(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${pi} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let desc=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(desc+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),desc}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(content){const e=this.contentEl(),t=e.parentNode,n=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,t.removeChild(e),this.empty(),Ke(e,content),this.trigger("modalfill"),n?t.insertBefore(e,n):t.appendChild(e);const r=this.getChild("closeButton");r&&t.appendChild(r.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),We(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=h.a.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let i=0;i<t.length;i++)if(n===t[i]){r=i;break}h.a.activeElement===this.el_&&(r=0),e.shiftKey&&0===r?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||r!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof o.a.HTMLAnchorElement||e instanceof o.a.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof o.a.HTMLInputElement||e instanceof o.a.HTMLSelectElement||e instanceof o.a.HTMLTextAreaElement||e instanceof o.a.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof o.a.HTMLIFrameElement||e instanceof o.a.HTMLObjectElement||e instanceof o.a.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}mi.prototype.options_={pauseOnOpen:!0,temporary:!0},Xt.registerComponent("ModalDialog",mi);class gi extends Ot{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let i=0;i<e.length;i++)this.addTrack(e[i])}addTrack(track){const e=this.tracks_.length;""+e in this||Object.defineProperty(this,e,{get(){return this.tracks_[e]}}),-1===this.tracks_.indexOf(track)&&(this.tracks_.push(track),this.trigger({track:track,type:"addtrack",target:this})),track.labelchange_=()=>{this.trigger({track:track,type:"labelchange",target:this})},Lt(track)&&track.addEventListener("labelchange",track.labelchange_)}removeTrack(e){let track;for(let i=0,t=this.length;i<t;i++)if(this[i]===e){track=this[i],track.off&&track.off(),this.tracks_.splice(i,1);break}track&&this.trigger({track:track,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const track=this[i];if(track.id===e){t=track;break}}return t}}gi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in gi.prototype.allowedEvents_)gi.prototype["on"+e]=null;const fi=function(e,track){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&track.id!==e[i].id&&(e[i].enabled=!1)};class yi extends gi{constructor(e=[]){for(let i=e.length-1;i>=0;i--)if(e[i].enabled){fi(e,e[i]);break}super(e),this.changing_=!1}addTrack(track){track.enabled&&fi(this,track),super.addTrack(track),track.addEventListener&&(track.enabledChange_=()=>{this.changing_||(this.changing_=!0,fi(this,track),this.changing_=!1,this.trigger("change"))},track.addEventListener("enabledchange",track.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const _i=function(e,track){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&track.id!==e[i].id&&(e[i].selected=!1)};class bi extends gi{constructor(e=[]){for(let i=e.length-1;i>=0;i--)if(e[i].selected){_i(e,e[i]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let i=0;i<this.length;i++)if(this[i].selected)return i;return-1},set(){}})}addTrack(track){track.selected&&_i(this,track),super.addTrack(track),track.addEventListener&&(track.selectedChange_=()=>{this.changing_||(this.changing_=!0,_i(this,track),this.changing_=!1,this.trigger("change"))},track.addEventListener("selectedchange",track.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class vi extends gi{addTrack(track){super.addTrack(track),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),track.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(track.kind)&&track.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(track=>track.toJSON())}}class Ti{constructor(e){Ti.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const r=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Si={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Ei={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},wi={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ci={disabled:"disabled",hidden:"hidden",showing:"showing"};class ki extends Ot{constructor(e={}){super();const t={id:e.id||"vjs_track_"+mt(),kind:e.kind||"",language:e.language||""};let label=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>label,set(e){e!==label&&(label=e,this.trigger("labelchange"))}})}}const xi=function(e){return new URL(e,h.a.baseURI)},Ii=function(e){return new URL(e,h.a.baseURI).href},Ai=function(path){if("string"==typeof path){const e=path.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return e?e[1].toLowerCase():""}return""},Di=function(e,t=o.a.location){return xi(e).origin!==t.origin};var Oi=Object.freeze({__proto__:null,parseUrl:xi,getAbsoluteURL:Ii,getFileExtension:Ai,isCrossOrigin:Di});const Pi=function(e,track){const t=new o.a.WebVTT.Parser(o.a,o.a.vttjs,o.a.WebVTT.StringDecoder()),n=[];t.oncue=function(e){track.addCue(e)},t.onparsingerror=function(e){n.push(e)},t.onflush=function(){track.trigger({type:"loadeddata",target:track})},t.parse(e),n.length>0&&(o.a.console&&o.a.console.groupCollapsed&&o.a.console.groupCollapsed(`Text Track parsing errors for ${track.src}`),n.forEach(e=>j.error(e)),o.a.console&&o.a.console.groupEnd&&o.a.console.groupEnd()),t.flush()},Li=function(e,track){const t={uri:e},n=Di(e);n&&(t.cors=n);const r="use-credentials"===track.tech_.crossOrigin();r&&(t.withCredentials=r),c()(t,kt(this,function(e,t,n){if(e)return j.error(e,t);track.loaded_=!0,"function"!=typeof o.a.WebVTT?track.tech_&&track.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return Pi(n,track);j.error(`vttjs failed to load, stopping trying to process ${track.src}`)}):Pi(n,track)}))};class Ri extends ki{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=K(e,{kind:wi[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=Ci[t.mode]||"disabled";const r=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const o=new Ti(this.cues_),l=new Ti(this.activeCues_);let h=!1;this.timeupdateHandler=kt(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==n&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>n,set(e){Ci[e]&&n!==e&&(n=e,this.preload_||"disabled"===n||0!==this.cues.length||Li(this.src,this),this.stopTracking(),"disabled"!==n&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?o:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return l;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(h=!1,t.length!==this.activeCues_.length)h=!0;else for(let i=0;i<t.length;i++)-1===this.activeCues_.indexOf(t[i])&&(h=!0);return this.activeCues_=t,l.setCues_(this.activeCues_),l},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&Li(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new o.a.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}const n=this.tech_.textTracks();for(let i=0;i<n.length;i++)n[i]!==this&&n[i].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return ci(this)}removeCue(e){let i=this.cues_.length;for(;i--;){const t=this.cues_[i];if(t===e||t.originalCue_&&t.originalCue_===e){this.cues_.splice(i,1),this.cues.setCues_(this.cues_);break}}}}Ri.prototype.allowedEvents_={cuechange:"cuechange"};class Ni extends ki{constructor(e={}){const t=K(e,{kind:Ei[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"enabled",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Mi extends ki{constructor(e={}){const t=K(e,{kind:Si[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Ui extends Ot{constructor(e={}){let t;super();const track=new Ri(e);this.kind=track.kind,this.src=track.src,this.srclang=track.language,this.label=track.label,this.default=track.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>track}}),t=Ui.NONE,track.addEventListener("loadeddata",()=>{t=Ui.LOADED,this.trigger({type:"load",target:this})})}}Ui.prototype.allowedEvents_={load:"load"},Ui.NONE=0,Ui.LOADING=1,Ui.LOADED=2,Ui.ERROR=3;const Bi={audio:{ListClass:yi,TrackClass:Ni,capitalName:"Audio"},video:{ListClass:bi,TrackClass:Mi,capitalName:"Video"},text:{ListClass:vi,TrackClass:Ri,capitalName:"Text"}};Object.keys(Bi).forEach(function(e){Bi[e].getterName=`${e}Tracks`,Bi[e].privateName=`${e}Tracks_`});const Fi={remoteText:{ListClass:vi,TrackClass:Ri,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let i=0,t=e.length;i<t;i++)this.addTrackElement_(e[i])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(track){let e;for(let i=0,t=this.trackElements_.length;i<t;i++)if(track===this.trackElements_[i].track){e=this.trackElements_[i];break}return e}removeTrackElement_(e){for(let i=0,t=this.trackElements_.length;i<t;i++)if(e===this.trackElements_[i]){this.trackElements_[i].track&&"function"==typeof this.trackElements_[i].track.off&&this.trackElements_[i].track.off(),"function"==typeof this.trackElements_[i].off&&this.trackElements_[i].off(),this.trackElements_.splice(i,1);break}}},TrackClass:Ui,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ji=Object.assign({},Bi,Fi);Fi.names=Object.keys(Fi),Bi.names=Object.keys(Bi),ji.names=[].concat(Fi.names).concat(Bi.names);class qi extends Xt{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ji.names.forEach(t=>{const n=ji[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(track=>{!1===e[`native${track}Tracks`]&&(this[`featuresNative${track}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new ji.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(kt(this,function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Qt(0,0)}bufferedPercent(){return ni(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Bi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const track=t[i];"text"===e&&this.removeRemoteTextTrack(track),t.removeTrack(track)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let i=e.length;for(;i--;){const track=e[i];this.removeRemoteTextTrack(track)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new ri(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Qt(0,0):Qt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Bi.names.forEach(e=>{const t=Bi[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!o.a.WebVTT)if(h.a.body.contains(this.el())){if(!this.options_["vtt.js"]&&X(f.a)&&Object.keys(f.a).length>0)return void this.trigger("vttjsloaded");const script=h.a.createElement("script");script.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",script.onload=()=>{this.trigger("vttjsloaded")},script.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{script.onload=null,script.onerror=null}),o.a.WebVTT=!0,this.el().parentNode.appendChild(script)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const o=()=>this.trigger("texttrackchange"),l=()=>{o();for(let i=0;i<e.length;i++){const track=e[i];track.removeEventListener("cuechange",o),"showing"===track.mode&&track.addEventListener("cuechange",o)}};l(),e.addEventListener("change",l),e.addEventListener("addtrack",l),e.addEventListener("removetrack",l),this.on("dispose",function(){t.off("addtrack",n),t.off("removetrack",r),e.removeEventListener("change",l),e.removeEventListener("addtrack",l),e.removeEventListener("removetrack",l);for(let i=0;i<e.length;i++){e[i].removeEventListener("cuechange",o)}})}addTextTrack(e,label,t){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,label,n,r={}){const o=e.textTracks();r.kind=t,label&&(r.label=label),n&&(r.language=n),r.tech=e;const track=new ji.text.TrackClass(r);return o.addTrack(track),track}(this,e,label,t)}createRemoteTextTrack(e){const track=K(e,{tech:this});return new Fi.remoteTextEl.TrackClass(track)}addRemoteTextTrack(e={},t){const n=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(track){const e=this.remoteTextTrackEls().getTrackElementByTrack_(track);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(track),this.autoRemoteTextTracks_.removeTrack(track)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=mt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return qi.canPlayType(e.type)}static isTech(component){return component.prototype instanceof qi||component instanceof qi||component===qi}static registerTech(e,t){if(qi.techs_||(qi.techs_={}),!qi.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!qi.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!qi.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=zt(e),qi.techs_[e]=t,qi.techs_[Ht(e)]=t,"Tech"!==e&&qi.defaultTechOrder_.push(e),t}static getTech(e){if(e)return qi.techs_&&qi.techs_[e]?qi.techs_[e]:(e=zt(e),o.a&&o.a.videojs&&o.a.videojs[e]?(j.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),o.a.videojs[e]):void 0)}}ji.names.forEach(function(e){const t=ji[e];qi.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),qi.prototype.featuresVolumeControl=!0,qi.prototype.featuresMuteControl=!0,qi.prototype.featuresFullscreenResize=!1,qi.prototype.featuresPlaybackRate=!1,qi.prototype.featuresProgressEvents=!1,qi.prototype.featuresSourceset=!1,qi.prototype.featuresTimeupdateEvents=!1,qi.prototype.featuresNativeTextTracks=!1,qi.prototype.featuresVideoFrameCallback=!1,qi.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){const n=e.sourceHandlers||[];let r;for(let i=0;i<n.length;i++)if(r=n[i].canPlayType(t),r)return r;return""},e.selectSourceHandler=function(source,t){const n=e.sourceHandlers||[];let r;for(let i=0;i<n.length;i++)if(r=n[i].canHandleSource(source,t),r)return n[i];return null},e.canPlaySource=function(t,n){const r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""};["seekable","seeking","duration"].forEach(function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(source){let t=e.selectSourceHandler(source,this.options_);t||(e.nativeSourceHandler?t=e.nativeSourceHandler:j.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),t!==e.nativeSourceHandler&&(this.currentSource_=source),this.sourceHandler_=t.handleSource(source,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Xt.registerComponent("Tech",qi),qi.registerTech("Tech",qi),qi.defaultTechOrder_=[];const $i={},Vi={},Hi={};function zi(e,t,n){e.setTimeout(()=>Qi(t,$i[t.type],n,e),1)}function Wi(e,t,n,r=null){const o="call"+zt(n),l=e.reduce(Yi(o),r),h=l===Hi,d=h?null:t[n](l);return function(e,t,n,r){for(let i=e.length-1;i>=0;i--){const o=e[i];o[t]&&o[t](r,n)}}(e,n,d,h),d}const Gi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Xi={setCurrentTime:1,setMuted:1,setVolume:1},Ki={play:1,pause:1};function Yi(e){return(t,n)=>t===Hi?Hi:n[e]?n[e](t):t}function Qi(e={},t=[],n,r,o=[],l=!1){const[h,...d]=t;if("string"==typeof h)Qi(e,$i[h],n,r,o,l);else if(h){const t=function(e,t){const n=Vi[e.id()];let r=null;if(null==n)return r=t(e),Vi[e.id()]=[[t,r]],r;for(let i=0;i<n.length;i++){const[e,o]=n[i];e===t&&(r=o)}return null===r&&(r=t(e),n.push([t,r])),r}(r,h);if(!t.setSource)return o.push(t),Qi(e,d,n,r,o,l);t.setSource(Object.assign({},e),function(h,c){if(h)return Qi(e,d,n,r,o,l);o.push(t),Qi(c,e.type===c.type?d:$i[c.type],n,r,o,l)})}else d.length?Qi(e,d,n,r,o,l):l?n(e,o):Qi(e,$i["*"],n,r,o,!0)}const Ji={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Zi=function(e=""){const t=Ai(e);return Ji[t.toLowerCase()]||""},es=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=es(e),Array.isArray(e)?t=t.concat(e):G(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[ts({src:e})]:G(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[ts(e)]:[];return e};function ts(e){if(!e.type){const t=Zi(e.src);t&&(e.type=t)}return e}const is=ge?10009:fe?461:8,ss={codes:{play:415,pause:19,ff:417,rw:412,back:is},names:{415:"play",19:"pause",417:"ff",412:"rw",[is]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){const code=this.codes[e.code];return this.names[code]}return null}};class ns extends Ot{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const e=t.key.substring(5).toLowerCase();this.move(e)}else if(ss.isEventKey(t,"play")||ss.isEventKey(t,"pause")||ss.isEventKey(t,"ff")||ss.isEventKey(t,"rw")){t.preventDefault();const e=ss.getEventName(t);this.performMediaAction_(e)}else ss.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let n=null;const r=this.getCurrentComponent(e.target);t&&(n=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||n)&&t||(r&&"CloseButton"===r.name()?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function n(e){for(const i of e)i.hasOwnProperty("el_")&&i.getIsFocusable()&&i.getIsAvailableToBeFocused(i.el())&&t.push(i),i.hasOwnProperty("children_")&&i.children_.length>0&&n(i.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?n(e.children_):e.hasOwnProperty("items")&&e.items.length>0?n(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){const n=e.el_.querySelector(".vjs-errors-ok-button-container");if(n){n.querySelectorAll("button").forEach((element,e)=>{t.push({name:()=>"ModalButton"+(e+1),el:()=>element,getPositions:()=>{const rect=element.getBoundingClientRect();return{boundingClientRect:{x:rect.x,y:rect.y,width:rect.width,height:rect.height,top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left},center:{x:rect.left+rect.width/2,y:rect.top+rect.height/2,width:0,height:0,top:rect.top+rect.height/2,right:rect.left+rect.width/2,bottom:rect.top+rect.height/2,left:rect.left+rect.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>element.focus()})})}}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(component){return component.el()?function e(t){if(component.getIsFocusable(t)&&component.getIsAvailableToBeFocused(t))return t;for(let i=0;i<t.children.length;i++){const n=e(t.children[i]);if(n)return n}return null}(component.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length)for(const i of this.focusableComponents)if(i.el()===t)return i}add(component){const e=[...this.focusableComponents];component.hasOwnProperty("el_")&&component.getIsFocusable()&&component.getIsAvailableToBeFocused(component.el())&&e.push(component),this.focusableComponents=e,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(component){for(let i=0;i<this.focusableComponents.length;i++)if(this.focusableComponents[i].name()===component.name())return this.focusableComponents.splice(i,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const n=t.getPositions(),r=this.focusableComponents.filter(component=>component!==t&&this.isInDirection_(n.boundingClientRect,component.getPositions().boundingClientRect,e)),o=this.findBestCandidate_(n.center,r,e);o?this.focus(o):this.trigger({type:"endOfFocusableComponents",direction:e,focu
vendor: 5,496 bytes, line 2
2sedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,o=null;for(const l of t){const t=l.getPositions().center,h=this.calculateDistance_(e,t,n);h<r&&(r=h,o=l)}return o}isInDirection_(e,t,n){switch(n){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let i=0;i<this.focusableComponents.length;i++)if(this.focusableComponents[i].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[i])}else this.focus(this.updateFocusableComponents()[0])}focus(component){"object"==typeof component&&(component.getIsAvailableToBeFocused(component.el())?component.focus():this.findSuitableDOMChild(component)&&this.findSuitableDOMChild(component).focus())}calculateDistance_(e,t,n){const r=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);let l;switch(n){case"right":case"left":l=r+100*o;break;case"up":l=2*o+.5*r;break;case"down":l=5*o+r;break;default:l=r+o}return l}searchForTrackSelect_(){const e=this;for(const component of e.updateFocusableComponents())if("TextTrackSelect"===component.constructor.name){e.focus(component);break}}}Xt.registerComponent("MediaLoader",class extends Xt{constructor(e,t,n){if(super(e,K({createEl:!1},t),n),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,n=t.playerOptions.techOrder;i<n.length;i++){const t=zt(n[i]);let r=qi.getTech(t);if(t||(r=Xt.getComponent(t)),r&&r.isSupported()){e.loadTech_(t);break}}}});class rs extends Xt{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&j.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=Ie(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(Ie("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Ie("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(text,e=this.el()){if(void 0===text)return this.controlText_||"Need Text";const t=this.localize(text);this.controlText_=text,Ae(this.controlTextEl_,t),this.nonIconControl||this.player_.options_.noUITitleAttributes||e.setAttribute("title",t)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Xt.registerComponent("ClickableComponent",rs);class as extends rs{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Ie("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(Ie("picture",{className:"vjs-poster",tabIndex:-1},{},Ie("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?oi(this.player_.play()):this.player_.pause())}}as.prototype.crossorigin=as.prototype.crossOrigin,Xt.registerComponent("PosterImage",as);const os="#222",ls="#ccc",us={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',
vendor: 4,809 bytes, line 2
2script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function hs(e,t){let n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function ds(e,style,t){try{e.style[style]=t}catch(e){return}}function cs(e){return e?`${e}px`:""}Xt.registerComponent("TextTrackDisplay",class extends Xt{constructor(e,t,n){super(e,t,n);const r=e=>this.updateDisplay(e),l=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(kt(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",l),e.on("playerresize",l);const t=o.a.screen.orientation||o.a,n=o.a.screen.orientation?"change":"orientationchange";t.addEventListener(n,l),e.on("dispose",()=>t.removeEventListener(n,l));const r=this.options_.playerOptions.tracks||[];for(let i=0;i<r.length;i++)this.player_.addRemoteTextTrack(r[i],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;let r,o,l;for(let i=0;i<t.length;i++){const track=t[i];n&&n.enabled&&n.language&&n.language===track.language&&track.kind in e?track.kind===n.kind?l=track:l||(l=track):n&&!n.enabled?(l=null,r=null,o=null):track.default&&("descriptions"!==track.kind||r?track.kind in e&&!o&&(o=track):r=track)}l?l.mode="showing":o?o.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof o.a.WebVTT&&o.a.WebVTT.processCues(o.a,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const track=e[i];"showing"===track.mode&&t.push(track)}return void this.updateForTrack(t)}let n=null,r=null,i=e.length;for(;i--;){const track=e[i];"showing"===track.mode&&("descriptions"===track.kind?n=track:r=track)}if(r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):n&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n)),!o.a.CSS.supports("inset","10px")){const e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),n=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style="",ds(e,"position","relative"),ds(e,"height",r-n+"px"),ds(e,"top","unset"),ds(e,"bottom",ye?r+"px":"0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){const t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!o.a.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let l=0,h=0;Math.abs(n-r)>.1&&(n>r?l=Math.round((e-t*r)/2):h=Math.round((t-e/r)/2)),ds(this.el_,"insetInline",cs(l)),ds(this.el_,"insetBlock",cs(h))}updateDisplayState(track){const e=this.player_.textTrackSettings.getValues(),t=track.activeCues;let i=t.length;for(;i--;){const n=t[i];if(!n)continue;const r=n.displayState;if(e.color&&(r.firstChild.style.color=e.color),e.textOpacity&&ds(r.firstChild,"color",hs(e.color||"#fff",e.textOpacity)),e.backgroundColor&&(r.firstChild.style.backgroundColor=e.backgroundColor),e.backgroundOpacity&&ds(r.firstChild,"backgroundColor",hs(e.backgroundColor||"#000",e.backgroundOpacity)),e.windowColor&&(e.windowOpacity?ds(r,"backgroundColor",hs(e.windowColor,e.windowOpacity)):r.style.backgroundColor=e.windowColor),e.edgeStyle&&("dropshadow"===e.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${os}, 2px 2px 4px ${os}, 2px 2px 5px ${os}`:"raised"===e.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${os}, 2px 2px ${os}, 3px 3px ${os}`:"depressed"===e.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${ls}, 0 1px ${ls}, -1px -1px ${os}, 0 -1px ${os}`:"uniform"===e.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${os}, 0 0 4px ${os}, 0 0 4px ${os}, 0 0 4px ${os}`)),e.fontPercent&&1!==e.fontPercent){const t=o.a.parseFloat(r.style.fontSize);r.style.fontSize=t*e.fontPercent+"px",r.style.height="auto",r.style.top="auto"}
vendor: 16,280 bytes, line 2
2e.fontFamily&&"default"!==e.fontFamily&&("small-caps"===e.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=us[e.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof o.a.WebVTT||e.every(track=>!track.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const track=e[i];for(let e=0;e<track.activeCues.length;++e)t.push(track.activeCues[e])}o.a.WebVTT.processCues(o.a,t,this.el_);for(let i=0;i<e.length;++i){const track=e[i];for(let e=0;e<track.activeCues.length;++e){const t=track.activeCues[e].displayState;Pe(t,"vjs-text-track-cue","vjs-text-track-cue-"+(track.language?track.language:i)),track.language&&Be(t,"lang",track.language)}this.player_.textTrackSettings&&this.updateDisplayState(track)}}});Xt.registerComponent("LoadingSpinner",class extends Xt{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=Ie("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class ps extends rs{createEl(e,t={},n={}){const r=Ie("button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n));return this.player_.options_.experimentalSvgIcons||r.appendChild(Ie("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const n=this.constructor.name;return j.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),Xt.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "!==e.key&&"Enter"!==e.key?super.handleKeyDown(e):e.stopPropagation()}}Xt.registerComponent("Button",ps);class ms extends ps{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e)return oi(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const o=()=>r.focus();ai(t)?t.then(o,()=>{}):this.setTimeout(o,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}ms.prototype.controlText_="Play Video",Xt.registerComponent("BigPlayButton",ms);Xt.registerComponent("CloseButton",class extends ps{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class gs extends ps{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?oi(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}gs.prototype.controlText_="Play",Xt.registerComponent("PlayToggle",gs);class fs extends Xt{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),span=Ie("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(span),this.contentEl_=Ie("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(time=0){time=ii(time),this.formattedTime_!==time&&(this.formattedTime_=time,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,j.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=h.a.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}fs.prototype.labelText_="Time",fs.prototype.controlText_="Time",Xt.registerComponent("TimeDisplay",fs);class ys extends fs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let time;time=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(time)}}ys.prototype.labelText_="Current Time",ys.prototype.controlText_="Current Time",Xt.registerComponent("CurrentTimeDisplay",ys);class _s extends fs{constructor(e,t){super(e,t);const n=e=>this.updateContent(e);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}_s.prototype.labelText_="Duration",_s.prototype.controlText_="Duration",Xt.registerComponent("DurationDisplay",_s);Xt.registerComponent("TimeDivider",class extends Xt{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),div=super.createEl("div"),span=super.createEl("span",{textContent:"/"});return div.appendChild(span),e.appendChild(div),e}});class bs extends fs{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(Ie("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let time;time=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(time)}}bs.prototype.labelText_="Remaining Time",bs.prototype.controlText_="Remaining Time",Xt.registerComponent("RemainingTimeDisplay",bs);Xt.registerComponent("LiveDisplay",class extends Xt{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ie("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ie("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(h.a.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class vs extends ps{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=Ie("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Ts(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}vs.prototype.controlText_="Seek to live, currently playing live",Xt.registerComponent("SeekToLive",vs);var Ss=Object.freeze({__proto__:null,clamp:Ts});class Es extends Xt{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||ae||e.preventDefault(),je(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;qe(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const progress=this.getProgress();return progress===this.progress_||(this.progress_=progress,this.requestNamedAnimationFrame("Slider#update",()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(100*progress).toFixed(2)+"%"})),progress}getProgress(){return Number(Ts(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=He(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?r&&"ArrowLeft"===e.key||!r&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&"ArrowRight"===e.key||!r&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Xt.registerComponent("Slider",Es);const ws=(time,e)=>Ts(time/e*100,0,100).toFixed(2)+"%";Xt.registerComponent("LoadProgressBar",class extends Xt{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=Ie("span",{className:"vjs-control-text"}),n=Ie("span",{textContent:this.localize("Loaded")}),r=h.a.createTextNode(": ");return this.percentageEl_=Ie("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),o=this.partEls_,l=ws(r,n);this.percent_!==l&&(this.el_.style.width=l,Ae(this.percentageEl_,l),this.percent_=l);for(let i=0;i<t.length;i++){const e=t.start(i),n=t.end(i);let l=o[i];l||(l=this.el_.appendChild(Ie()),o[i]=l),l.dataset.start===e&&l.dataset.end===n||(l.dataset.start=e,l.dataset.end=n,l.style.left=ws(e,r),l.style.width=ws(n-e,r))}for(let i=o.length;i>t.length;i--)this.el_.removeChild(o[i-1]);o.length=t.length})}});Xt.registerComponent("TimeTooltip",class extends Xt{constructor(e,t){super(e,t),this.update=xt(kt(this,this.update),Ct)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,content){const n=Ve(this.el_),r=$e(this.player_.el()),o=e.width*t;if(!r||!n)return;let l=e.left-r.left+o,h=e.width-o+(r.right-e.right);h||(h=e.width-o,l=o);let d=n.width/2;l<d?d+=d-l:h<d&&(d=h),d<0?d=0:d>n.width&&(d=n.width),d=Math.round(d),this.el_.style.right=`-${d}px`,this.write(content)}write(content){Ae(this.el_,content)}updateTime(e,t,time,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let content;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),n=e-t*e;content=(n<1?"":"-")+ii(n,e)}else content=ii(time,r);this.update(e,t,content),n&&n()})}});class Cs extends Xt{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=xt(kt(this,this.update),Ct)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,n){const r=this.getChild("timeTooltip");if(!r)return;const time=n&&n.target&&"function"==typeof n.target.pendingSeekTime?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,time)}}Cs.prototype.options_={children:[]},ve||ie||Cs.prototype.options_.children.push("timeTooltip"),Xt.registerComponent("PlayProgressBar",Cs);class ks extends Xt{constructor(e,t){super(e,t),this.update=xt(kt(this,this.update),Ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const time=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,time,()=>{this.el_.style.left=e.width*t+"px"})}}ks.prototype.options_={children:["timeTooltip"]},Xt.registerComponent("MouseTimeDisplay",ks);
vendor: 7,475 bytes, line 2
2class xs extends Es{constructor(e,t){(t=K(xs.prototype.options_,t)).children=[...t.children];const n=e.options_.disableSeekWhileScrubbingOnMobile&&(ve||ie)||e.options_.disableSeekWhileScrubbingOnSTV;(!ve&&!ie||n)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=kt(this,this.update),this.update=xt(this.update_,Ct),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in h.a&&"visibilityState"in h.a&&this.on(h.a,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===h.a.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ct))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===h.a.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let o=this.player_.duration();r&&r.isLive()&&(o=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===n&&this.duration_===o||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ii(n,o),ii(o,o)],"{1} of {2}")),this.currentTime_=n,this.duration_=o),this.bar&&this.bar.update($e(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(time){if(void 0!==time)if(null!==time){const e=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(time,e))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Ye(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Ye(e)||isNaN(this.player_.duration()))return;let n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),o=this.player_.liveTracker;if(o&&o.isLive()){if(r>=.99)return void o.seekToLiveEdge();const e=o.seekableStart(),t=o.liveCurrentTime();if(n=e+r*o.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}else n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?oi(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const n=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in h.a&&"visibilityState"in h.a&&this.off(h.a,"visibilitychange",this.toggleVisibility_),super.dispose()}}xs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Xt.registerComponent("SeekBar",xs);class Is extends Xt{constructor(e,t){super(e,t),this.handleMouseMove=xt(kt(this,this.handleMouseMove),Ct),this.throttledHandleMouseSeek=xt(kt(this,this.handleMouseSeek),Ct),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const o=t.el(),l=Ve(o);let h=He(o,e).x;h=Ts(h,0,1),r&&r.update(l,h),n&&n.update(l,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
vendor: 10,435 bytes, line 2
2disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&oi(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Is.prototype.options_={children:["seekBar"]},Xt.registerComponent("ProgressControl",Is);class As extends ps{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){h.a.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in o.a?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof h.a.exitPictureInPicture&&super.show()}}As.prototype.controlText_="Picture-in-Picture",Xt.registerComponent("PictureInPictureToggle",As);class Ds extends ps{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===h.a[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Ds.prototype.controlText_="Fullscreen",Xt.registerComponent("FullscreenToggle",Ds);Xt.registerComponent("VolumeLevel",class extends Xt{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}});Xt.registerComponent("VolumeLevelTooltip",class extends Xt{constructor(e,t){super(e,t),this.update=xt(kt(this,this.update),Ct)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,content){if(!n){const n=$e(this.el_),r=$e(this.player_.el()),o=e.width*t;if(!r||!n)return;const l=e.left-r.left+o,h=e.width-o+(r.right-e.right);let d=n.width/2;l<d?d+=d-l:h<d&&(d=h),d<0?d=0:d>n.width&&(d=n.width),this.el_.style.right=`-${d}px`}this.write(`${content}%`)}write(content){Ae(this.el_,content)}updateVolume(e,t,n,r,o){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,n,r.toFixed(0)),o&&o()})}});class Os extends Xt{constructor(e,t){super(e,t),this.update=xt(kt(this,this.update),Ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Os.prototype.options_={children:["volumeLevelTooltip"]},Xt.registerComponent("MouseVolumeLevelDisplay",Os);class Ps extends Es{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Ye(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=$e(n),o=this.vertical();let l=He(n,e);l=o?l.y:l.x,l=Ts(l,0,1),t.update(r,l,o)}Ye(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}Ps.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ve||ie||Ps.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Ps.prototype.playerEvent="volumechange",Xt.registerComponent("VolumeBar",Ps);class Ls extends Xt{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||X(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.throttledHandleMouseMove=xt(kt(this,this.handleMouseMove),Ct),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Ls.prototype.options_={children:["volumeBar"]},Xt.registerComponent("VolumeControl",Ls);class Rs extends ps{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){const e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ve&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Le(this.el_,[0,1,2,3].reduce((e,i)=>e+`${i?" ":""}vjs-vol-${i}`,"")),Pe(this.el_,`vjs-vol-${t}`)}updateControlText_(){const text=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==text&&this.controlText(text)}}Rs.prototype.controlText_="Mute",Xt.registerComponent("MuteToggle",Rs);class Ns extends Xt{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||X(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}
vendor: 10,206 bytes, line 2
2sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),bt(h.a,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),vt(h.a,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}Ns.prototype.options_={children:["muteToggle","volumeControl"]},Xt.registerComponent("VolumePanel",Ns);class Ms extends ps{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let o;o=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(o)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Ms.prototype.controlText_="Skip Forward",Xt.registerComponent("SkipForward",Ms);class Us extends ps{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let o;o=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(o)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Us.prototype.controlText_="Skip Backward",Xt.registerComponent("SkipBackward",Us);class Bs extends Xt{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(component){component instanceof Xt&&(this.on(component,"blur",this.boundHandleBlur_),this.on(component,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(component){component instanceof Xt&&(this.off(component,"blur",this.boundHandleBlur_),this.off(component,["tap","click"],this.boundHandleTapClick_))}removeChild(component){"string"==typeof component&&(component=this.getChild(component)),this.removeEventListenerForItem(component),super.removeChild(component)}addItem(component){const e=this.addChild(component);e&&this.addEventListenerForItem(e)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=Ie(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),bt(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||h.a.activeElement;if(!this.children().some(element=>element.el()===t)){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter(component=>component.el()===e.target)[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Xt.registerComponent("Menu",Bs);class Fs extends Xt{constructor(e,t={}){super(e,t),this.menuButton_=new ps(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=ps.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),bt(h.a,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const menu=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=menu,this.addChild(menu),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const menu=new Bs(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const e=Ie("li",{className:"vjs-menu-title",textContent:zt(this.options_.title),tabIndex:-1}),t=new Xt(this.player_,{el:e});menu.addItem(t)}if(this.items=this.createItems(),this.items)for(let i=0;i<this.items.length;i++)menu.addItem(this.items[i]);return menu}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";return`vjs-menu-button ${e} ${ps.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(text,e=this.menuButton_.el()){return this.menuButton_.controlText(text,e)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),vt(h.a,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){"Escape"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){"Escape"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ve&&ke())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Xt.registerComponent("MenuButton",Fs);class js extends Fs{constructor(e,t){const n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;const r=kt(this,this.update);n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)})}}Xt.registerComponent("TrackButton",js);class qs extends rs{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,n){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),n),o=Ie("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(o):r.replaceChild(o,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.ke
vendor: 12,749 bytes, line 2
2y)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Xt.registerComponent("MenuItem",qs);class $s extends qs{constructor(e,t){const track=t.track,n=e.textTracks();t.label=track.label||track.language||"Unknown",t.selected="showing"===track.mode,super(e,t),this.track=track,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},l=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),n.addEventListener("change",r),n.addEventListener("selectedlanguagechange",l),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],r),n.removeEventListener("change",r),n.removeEventListener("selectedlanguagechange",l)}),void 0===n.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof o.a.Event)try{e=new o.a.Event("change")}catch(e){}e||(e=h.a.createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let i=0;i<n.length;i++){const track=n[i];-1!==this.kinds.indexOf(track.kind)&&(track===t?"showing"!==track.mode&&(track.mode="showing"):"disabled"!==track.mode&&(track.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Xt.registerComponent("TextTrackMenuItem",$s);class Vs extends $s{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let n=!0;for(let i=0,e=t.length;i<e;i++){const track=t[i];if(this.options_.kinds.indexOf(track.kind)>-1&&"showing"===track.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let i=0,e=t.length;i<e;i++){const track=t[i];if(["captions","descriptions","subtitles"].indexOf(track.kind)>-1&&"showing"===track.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Xt.registerComponent("OffTextTrackMenuItem",Vs);class Hs extends js{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=$s){let label;this.label_&&(label=`${this.label_} off`),e.push(new Vs(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){const track=n[i];if(this.kinds_.indexOf(track.kind)>-1){const n=new t(this.player_,{track:track,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${track.kind}-menu-item`),e.push(n)}}return e}}Xt.registerComponent("TextTrackButton",Hs);class zs extends qs{constructor(e,t){const track=t.track,n=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,super(e,t),this.track=track,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Xt.registerComponent("ChaptersTrackMenuItem",zs);class Ws extends Hs{constructor(e,t,n){super(e,t,n),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const track=this.findChaptersTrack();track!==this.track_?(this.setTrack(track),super.update()):(!this.items||track&&track.cues&&track.cues.length!==this.items.length)&&super.update()}setTrack(track){if(this.track_!==track){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=track,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let i=e.length-1;i>=0;i--){const track=e[i];if(track.kind===this.kind_)return track}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(zt(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new zs(this.player_,{track:this.track_,cue:n});e.push(r)}return e}}Ws.prototype.kind_="chapters",Ws.prototype.controlText_="Chapters",Xt.registerComponent("ChaptersButton",Ws);class Gs extends Hs{constructor(e,t,n){super(e,t,n),this.setIcon("audio-description");const r=e.textTracks(),o=kt(this,this.handleTracksChange);r.addEventListener("change",o),this.on("dispose",function(){r.removeEventListener("change",o)})}handleTracksChange(e){const t=this.player().textTracks();let n=!1;for(let i=0,e=t.length;i<e;i++){const track=t[i];if(track.kind!==this.kind_&&"showing"===track.mode){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Gs.prototype.kind_="descriptions",Gs.prototype.controlText_="Descriptions",Xt.registerComponent("DescriptionsButton",Gs);class Xs extends Hs{constructor(e,t,n){super(e,t,n),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Xs.prototype.kind_="subtitles",Xs.prototype.controlText_="Subtitles",Xt.registerComponent("SubtitlesButton",Xs);class Ks extends $s{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Xt.registerComponent("CaptionSettingsMenuItem",Ks);class Ys extends Hs{constructor(e,t,n){super(e,t,n),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Ks(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Ys.prototype.kind_="captions",Ys.prototype.controlText_="Captions",Xt.registerComponent("CaptionsButton",Ys);class Qs extends $s{createEl(e,t,n){const r=super.createEl(e,t,n),o=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):o.appendChild(Ie("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),o.appendChild(Ie("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}Xt.registerComponent("SubsCapsMenuItem",Qs);class Js extends Hs{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(zt(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Ks(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Qs),e}}Js.prototype.kinds_=["captions","subtitles"],Js.prototype.controlText_="Subtitles",Xt.registerComponent("SubsCapsButton",Js);class Zs extends qs{constructor(e,t){const track=t.track,n=e.audioTracks();t.label=track.label||track.language||"Unknown",t.selected=track.enabled,super(e,t),this.track=track,this.addClass(`vjs-${track.kind}-menu-item`);const r=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",r),this.on("dispose",()=>{n.removeEventListener("change",r)})}createEl(e,t,n){const r=super.createEl(e,t,n),o=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(o.appendChild(Ie("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),o.appendChild(Ie("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let i=0;i<e.length;i++){const track=e[i];track!==this.track&&(track.enabled=track===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Xt.registerComponent("AudioTrackMenuItem",Zs);class en extends js{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const track=t[i];e.push(new Zs(this.player_,{track:track,selectable:!0,multiSelectable:!1}))}return e}}en.prototype.controlText_="Audio Track",Xt.registerComponent("AudioTrackButton",en);class tn extends qs{constructor(e,t){const label=t.rate,n=parseFloat(label,10);t.label=label,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=label,this.rate=n,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}tn.prototype.contentElType="button",Xt.registerComponent("PlaybackRateMenuItem",tn);class sn extends Fs{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Ie("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new tn(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}sn.prototype.controlText_="Playback Rate",Xt.registerComponent("PlaybackRateMenuButton",sn);
vendor: 21,490 bytes, line 2
2class nn extends Xt{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}Xt.registerComponent("Spacer",nn);Xt.registerComponent("CustomControlSpacer",class extends nn{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class rn extends Xt{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}rn.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Xt.registerComponent("ControlBar",rn);class an extends mi{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}an.prototype.options_=Object.assign({},mi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Xt.registerComponent("ErrorDisplay",an);class on extends Xt{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();return Ie("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${mt()}`)+"-"+e[1].replace(/\W+/g,""),option=Ie("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return option.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),option}))}}Xt.registerComponent("TextTrackSelect",on);class ln extends Xt{constructor(e,t={}){super(e,t);const n=Ie("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);const r=this.options_.selects;for(const i of r){const t=this.options_.selectConfigs[i],n=t.className,r=t.id.replace("%s",this.options_.id_);let span=null;const o=`vjs_select_${mt()}`;if("colors"===this.options_.type){span=Ie("span",{className:n});const label=Ie("label",{id:r,className:"vjs-label",textContent:this.localize(t.label)});label.setAttribute("for",o),span.appendChild(label)}const l=new on(e,{SelectOptions:t.options,legendId:this.options_.legendId,id:o,labelId:r});this.addChild(l),"colors"===this.options_.type&&(span.appendChild(l.el()),this.el().appendChild(span))}}createEl(){return Ie("fieldset",{className:this.options_.className})}}Xt.registerComponent("TextTrackFieldset",ln);class un extends Xt{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new ln(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const o=new ln(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(o);const l=new ln(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(l)}createEl(){return Ie("div",{className:"vjs-track-settings-colors"})}}Xt.registerComponent("TextTrackSettingsColors",un);class hn extends Xt{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new ln(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const o=new ln(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(o);const l=new ln(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(l)}createEl(){return Ie("div",{className:"vjs-track-settings-font"})}}Xt.registerComponent("TextTrackSettingsFont",hn);class dn extends Xt{constructor(e,t={}){super(e,t);const n=new ps(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Reset"),this.addChild(n);const r=this.localize("Done"),o=new ps(e,{controlText:r,className:"vjs-done-button"});o.el().classList.remove("vjs-control","vjs-button"),o.el().textContent=r,this.addChild(o)}createEl(){return Ie("div",{className:"vjs-track-settings-controls"})}}Xt.registerComponent("TrackSettingsControls",dn);const cn="vjs-text-track-settings",pn=["#000","Black"],mn=["#00F","Blue"],gn=["#0FF","Cyan"],fn=["#0F0","Green"],yn=["#F0F","Magenta"],_n=["#F00","Red"],bn=["#FFF","White"],vn=["#FF0","Yellow"],Tn=["1","Opaque"],Sn=["0.5","Semi-Transparent"],En=["0","Transparent"],wn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[pn,bn,_n,fn,mn,vn,yn,gn],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Tn,Sn,En],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[bn,pn,_n,fn,mn,vn,yn,gn],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Tn,Sn],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[En,Sn,Tn],className:"vjs-window-opacity vjs-opacity"}};function Cn(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}wn.windowColor.options=wn.backgroundColor.options;Xt.registerComponent("TextTrackSettings",class extends mi{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=Ie("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new un(e,{textTrackComponentid:this.id_,selectConfigs:wn,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const n=new hn(e,{textTrackComponentid:this.id_,selectConfigs:wn,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(n);const r=new dn(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),z(wn,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return W(wn,(e,t,n)=>{const r=(o=this.$(t.selector),l=t.parser,Cn(o.options[o.options.selectedIndex].value,l));var o,l;return void 0!==r&&(e[n]=r),e},{})}setValues(e){z(wn,(t,n)=>{!function(e,t,n){if(t)for(let i=0;i<e.options.length;i++)if(Cn(e.options[i].value,n)===t){e.selectedIndex=i;break}}(this.$(t.selector),e[n],t.parser)})}setDefaults(){z(wn,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(o.a.localStorage.getItem(cn))}catch(e){j.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?o.a.localStorage.setItem(cn,JSON.stringify(e)):o.a.localStorage.removeItem(cn)}catch(e){j.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}});Xt.registerComponent("ResizeManager",class extends Xt{constructor(e,t){let n=t.ResizeObserver||o.a.ResizeObserver;null===t.ResizeObserver&&(n=!1);super(e,K({createEl:!n,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||o.a.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=It(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){vt(this,"resize",e),vt(this,"unload",t),t=null};bt(this.el_.contentWindow,"unload",t),bt(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const kn={trackingThreshold:20,liveTolerance:15};Xt.registerComponent("LiveTracker",class extends Xt{constructor(e,t){super(e,K(kn,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(o.a.performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),l=this.player_.currentTime();let h=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-l)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(h=!1),h!==this.behindLiveEdge_&&(this.behindLiveEdge_=h,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ct),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}});Xt.registerComponent("TitleBar",class extends Xt{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Ie("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${mt()}`}),description:Ie("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${mt()}`})},Ie("div",{className:"vjs-title-bar"},{},Y(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const r=this.state[e],o=this.els[e],l=n[e];We(o),r&&Ae(o,r),t&&(t.removeAttribute(l),r&&t.setAttribute(l,o.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const xn={initialDisplay:4e3,position:[],takeFocus:!1};Xt.registerComponent("TransientButton",class extends ps{constructor(e,t){super(e,t=K(xn,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=Ie("button",{},{type:"button",class:this.buildCSSClass()},Ie("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const In=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const n=e.$$("source"),r=[];let o="";if(!n.length)return!1;for(let i=0;i<n.length;i++){const e=n[i].src;e&&-1===r.indexOf(e)&&r.push(e)}return!!r.length&&(1===r.length&&(o=r[0]),e.triggerSourceset(o),!0)},An=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=h.a.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const n=h.a.createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",o.a.Element.prototype.appendChild.call(this,n),this.innerHTML}}),Dn=(e,t)=>{let n={};for(let i=0;i<e.length&&(n=Object.getOwnPropertyDescriptor(e[i],t),!(n&&n.set&&n.get));i++);return n.enumerable=!0,n.configurable=!0,n},On=function(e){const t=e.el();if(t.resetSourceWatch_)return;const n={},r=(e=>Dn([e.el(),o.a.HTMLMediaElement.prototype,o.a.Element.prototype,An],"innerHTML"))(e),l=n=>(...r)=>{const o=n.apply(t,r);return In(e),o};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(n[e]=t[e],t[e]=l(n[e]))}),Object.defineProperty(t,"innerHTML",K(r,{set:l(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach(e=>{t[e]=n[e]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},Pn=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Ii(o.a.Element.prototype.getAttribute.call(this,"src")):""},set(e){return o.a.Element.prototype.setAttribute.call(this,"src",e),e}}),Ln=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const n=(e=>Dn([e.el(),o.a.HTMLMediaElement.prototype,Pn],"src"))(e),r=t.setAttribute,l=t.load;Object.defineProperty(t,"src",K(n,{set:r=>{const o=n.set.call(t,r);return e.triggerSourceset(t.src),o}})),t.setAttribute=(n,o)=>{const l=r.call(t,n,o);return/src/i.test(n)&&e.triggerSourceset(t.src),l},t.load=()=>{const n=l.call(t);return In(e)||(e.triggerSourceset(""),On(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):In(e)||On(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=l,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}};class Rn extends qi{constructor(e,t){super(e,t);const source=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,source&&(this.el_.currentSrc!==source.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(source):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const r=[];for(;t--;){const o=e[t];"track"===o.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),this.textTracks().addTrack(o.track),n||this.el_.hasAttribute("crossorigin")||!Di(o.src)||(n=!0)):r.push(o))}for(let i=0;i<r.length;i++)this.el_.removeChild(r[i])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&j.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(_e||me)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Rn.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){Ln(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const n=()=>{t=[];for(let i=0;i<e.length;i++){const track=e[i];"metadata"===track.kind&&t.push({track:track,storedMode:track.mode})}};n(),e.addEventListener("change",n),this.on("dispose",()=>e.removeEventListener("change",n));const r=()=>{for(let i=0;i<t.length;i++){const e=t[i];"disabled"===e.track.mode&&e.track.mode!==e.storedMode&&(e.track.mode=e.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}
2TracksListeners_`]).forEach(e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Bi[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const o={change:t=>{const n={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(n),"text"===e&&this[Fi.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},l=function(){const e=[];for(let i=0;i<r.length;i++){let t=!1;for(let e=0;e<n.length;e++)if(n[e]===r[i]){t=!0;break}t||e.push(r[i])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=o,Object.keys(o).forEach(e=>{const t=o[e];n.addEventListener(e,t),this.on("dispose",r=>n.removeEventListener(e,t))}),this.on("loadstart",l),this.on("dispose",e=>this.off("loadstart",l))}proxyNativeTracks_(){Bi.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Rn.disposeMediaElement(e),e=t}else{e=h.a.createElement("video");const t=K({},this.options_.tag&&Me(this.options_.tag));_e&&!0===this.options_.nativeControlsForTouch||delete t.controls,Ne(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&Be(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],r=this.options_[n];void 0!==r&&(r?Be(e,n,n):Fe(e,n),e[n]=r)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const n=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",n),e||this.trigger("loadstart")})}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Te?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){j(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ie&&ae&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const video=this.el_;if(video.paused&&video.networkState<=video.HAVE_METADATA)oi(this.el_.play()),this.setTimeout(function(){video.pause();try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return j.error("Invalid source URL."),!1;const n={src:e};t&&(n.type=t);const r=Ie("source",{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return j.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const n of t)if(n.src===e)return this.el_.removeChild(n),!0;return j.warn(`No matching source element found with src: ${e}`),!1}reset(){Rn.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,label,t){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,label,t):super.addTextTrack(e,label,t)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=h.a.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(track){if(super.removeRemoteTextTrack(track),this.featuresNativeTextTracks){const e=this.$$("track");let i=e.length;for(;i--;)track!==e[i]&&track!==e[i].track||this.el().removeChild(e[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),o.a.performance&&(e.creationTime=o.a.performance.now()),e}}Q(Rn,"TEST_VID",function(){if(!we())return;const video=h.a.createElement("video"),track=h.a.createElement("track");return track.kind="captions",track.srclang="en",track.label="English",video.appendChild(track),video}
vendor: 4,738 bytes, line 2
2),Rn.isSupported=function(){try{Rn.TEST_VID.volume=.5}catch(e){return!1}return!(!Rn.TEST_VID||!Rn.TEST_VID.canPlayType)},Rn.canPlayType=function(e){return Rn.TEST_VID.canPlayType(e)},Rn.canPlaySource=function(e,t){return Rn.canPlayType(e.type)},Rn.canControlVolume=function(){try{const e=Rn.TEST_VID.volume;Rn.TEST_VID.volume=e/2+.1;const t=e!==Rn.TEST_VID.volume;return t&&ve?(o.a.setTimeout(()=>{Rn&&Rn.prototype&&(Rn.prototype.featuresVolumeControl=e!==Rn.TEST_VID.volume)}),!1):t}catch(e){return!1}},Rn.canMuteVolume=function(){try{const e=Rn.TEST_VID.muted;return Rn.TEST_VID.muted=!e,Rn.TEST_VID.muted?Be(Rn.TEST_VID,"muted","muted"):Fe(Rn.TEST_VID,"muted"),e!==Rn.TEST_VID.muted}catch(e){return!1}},Rn.canControlPlaybackRate=function(){if(ie&&ae&&le<58)return!1;try{const e=Rn.TEST_VID.playbackRate;return Rn.TEST_VID.playbackRate=e/2+.1,e!==Rn.TEST_VID.playbackRate}catch(e){return!1}},Rn.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(h.a.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(h.a.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(h.a.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(h.a.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Rn.supportsNativeTextTracks=function(){return Te||ve&&ae},Rn.supportsNativeVideoTracks=function(){return!(!Rn.TEST_VID||!Rn.TEST_VID.videoTracks)},Rn.supportsNativeAudioTracks=function(){return!(!Rn.TEST_VID||!Rn.TEST_VID.audioTracks)},Rn.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){Q(Rn.prototype,e,()=>Rn[t](),!0)}),Rn.prototype.featuresVolumeControl=Rn.canControlVolume(),Rn.prototype.movingMediaElementInDOM=!ve,Rn.prototype.featuresFullscreenResize=!0,Rn.prototype.featuresProgressEvents=!0,Rn.prototype.featuresTimeupdateEvents=!0,Rn.prototype.featuresVideoFrameCallback=!(!Rn.TEST_VID||!Rn.TEST_VID.requestVideoFrameCallback),Rn.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Rn.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Rn.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Rn.prototype["set"+zt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Rn.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Rn.prototype["set"+zt(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Rn.prototype[e]=function(){return this.el_[e]()}}),qi.withSourceHandlers(Rn),Rn.nativeSourceHandler={},Rn.nativeSourceHandler.canPlayType=function(e){try{return Rn.TEST_VID.canPlayType(e)}catch(e){return""}},Rn.nativeSourceHandler.canHandleSource=function(source,e){if(source.type)return Rn.nativeSourceHandler.canPlayType(source.type);if(source.src){const e=Ai(source.src);return Rn.nativeSourceHandler.canPlayType(`video/${e}`)}return""},Rn.nativeSourceHandler.handleSource=function(source,e,t){e.setSrc(source.src)},Rn.nativeSourceHandler.dispose=function(){},Rn.registerSourceHandler(Rn.nativeSourceHandler),qi.registerTech("Html5",Rn);const Nn=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Mn={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Un=["tiny","xsmall","small","medium","large","xlarge","huge"],Bn={};
vendor: 2,994 bytes, line 2
2Un.forEach(e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;Bn[e]=`vjs-layout-${t}`});const Fn={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class jn extends Xt{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${mt()}`,(t=Object.assign(jn.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const n=e.closest("[lang]");n&&(t.language=n.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=$(this.id_),this.fsApi_=N,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Me(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach(function(n){e[n.toLowerCase()]=t.languages[n]}),this.languages_=e}else this.languages_=jn.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),qt(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(bt(h.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=K(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new o.a
vendor: 17,827 bytes, line 2
2.DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n  <defs>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n      <path d="M16 10v28l22-14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n      <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n      <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n      <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n      <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n      <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n      <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n      <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n      <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n      <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n      <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n      <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n      <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n    </symbol>\n    <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n      <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n      <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n      <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n      <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n      <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n      <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n      <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n      <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n      <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n      <circle cx="24" cy="24" r="20"></circle>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n      <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n      <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n      <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n      <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n      <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n      <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n      <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n      <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n      <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n    </symbol>\n    <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n      <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n      <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n      <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n      <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n      <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n      <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n      <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n      <path fill="none" d="M-1-3h24v24H-1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n      <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n      <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n      <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n      <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n      <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n    </symbol>\n  </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))
vendor: 1,952 bytes, line 2
2j.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new ns(this),this.addClass("vjs-spatial-navigation-enabled")),_e&&this.addClass("vjs-touch-enabled"),ve||this.addClass("vjs-workinghover"),jn.players[this.id_]=this;const l=O.split(".")[0];this.addClass(`vjs-v${l}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){var e;this.trigger("dispose"),this.off("dispose"),vt(h.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),vt(h.a,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),jn.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),e=this,Vi.hasOwnProperty(e.id())&&delete Vi[e.id()],ji.names.forEac
vendor: 5,306 bytes, line 2
2h(e=>{const t=this[ji[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r="video-js"===this.tag.tagName.toLowerCase();n?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const l=Me(t);if(r){for(e=this.el_=t,t=this.tag=h.a.createElement("video");e.children.length;)t.appendChild(e.firstChild);Oe(e,"video-js")||Pe(e,"video-js"),e.appendChild(t),n=this.playerElIngest_=e,Object.keys(e).forEach(n=>{try{t[n]=e[n]}catch(e){}})}t.setAttribute("tabindex","-1"),l.tabindex="-1",ae&&ce&&(t.setAttribute("role","application"),l.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(n){r&&"class"===n||e.setAttribute(n,l[n]),r&&t.setAttribute(n,l[n])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const d=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>Se[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...d),!0!==o.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=lt("vjs-styles-dimensions");const e=Qe(".vjs-styles-defaults"),head=Qe("head");head.insertBefore(this.styleEl_,e?e.nextSibling:head.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const c=t.getElementsByTagName("a");for(let i=0;i<c.length;i++){const e=c.item(i);Pe(e,"vjs-hidden"),e.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(e,t),De(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):j.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();const r=parseFloat(t);isNaN(r)?j.error(`Improper value "${t}" supplied for for ${e}`):(this[n]=r,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,n;this.fluid_=!!e,Lt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},Lt(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===o.a.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}let e,t,n,r;n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const l=n.split(":"),h=l[1]/l[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/h:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*h,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),ut(this.styleEl_,`\n      .${r} {\n        width: ${e}px;\n        height: ${t}px;\n      }\n\n      .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: ${100*h}%;\n      }\n    `)}loadTech_(e,source){this.tech_&&this.unloadTech_();const t=zt(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==t&&this.tag&&(qi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=t,this.isReady_=!1;let r=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(r=!1);const o={source:source,autoplay:r,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};
vendor: 2,657 bytes, line 2
2ji.names.forEach(e=>{const t=ji[e];o[t.getterName]=this[t.privateName]}),Object.assign(o,this.options_[t]),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),source&&source.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);const l=qi.getTech(e);if(!l)throw new Error(`No Tech named '${t}' exists! '${t}' should be registered using videojs.registerTech()'`);this.tech_=new l(o),this.tech_.ready(kt(this,this.handleTechReady_),!0),di(this.textTracksJson_||[],this.tech_),Nn.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${zt(e)}_`](t))}),Object.keys(Mn).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Mn[e]}_`].bind(this),event:t}):this[`handleTech${Mn[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,data)=>this.handleTechFullscreenChange_(e,data)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===t&&this.tag||De(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ji.names.forEach(e=>{const t=ji[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=hi(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&j.warn("Using the tech directly can be dangerous. I hope you know 
2what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":O}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const n=this.play();if(ai(n))return n.catch(e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};let n;return"any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():t():(n=this.play(),ai(n)&&(n=n.catch(t))),ai(n)?n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const n=e.cache_.sources.filter(s=>s.src===t);if(n.length)return n[0].type;const r=e.$$("source");for(let i=0;i<r.length;i++){const s=r[i];if(s.type&&s.src&&s.src===t)return s.type}return Zi(t)})(this,t)),this.cache_.source=K({},e,{src:t,type:n});const r=this.cache_.sources.filter(s=>s.src&&s.src===t),o=[],l=this.$$("source"),h=[];for(let i=0;i<l.length;i++){const e=Me(l[i]);o.push(e),e.src&&e.src===t&&h.push(e.src)}h.length&&!r.length?this.cache_.sources=o:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
vendor: 26,217 bytes, line 2
2handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?oi(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!h.a.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=h.a[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,data){data&&(data.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(data.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let data=null;arguments.length>1&&(data=arguments[1]),this.trigger("textdata",data)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Xi)return function(e,t,n,r){return t[n](e.reduce(Yi(n),r))}(this.middleware_,this.tech_,e,t);if(e in Ki)return Wi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw j(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Gi)return function(e,t,n){return e.reduceRight(Yi(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Ki)return Wi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw j(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw j(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw j(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=oi){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),n=Boolean(Te||ve);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&n&&this.load());const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(q){q()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Qt(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Qt(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Qt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ni(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((n,r)=>{function o(){t.off("fullscreenerror",h),t.off("fullscreenchange",l)}function l(){o(),n()}function h(e,t){o(),r(t)}t.one("fullscreenchange",l),t.one("fullscreenerror",h);const d=t.requestFullscreenHelper_(e);d&&(d.then(o,o),d.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,n)=>{function r(){e.off("fullscreenerror",l),e.off("fullscreenchange",o)}function o(){r(),t()}function l(e,t){r(),n(t)}e.one("fullscreenchange",o),e.one("fullscreenerror",l);const h=e.exitFullscreenHelper_();h&&(h.then(r,r),h.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=h.a[this.fsApi_.exitFullscreen]();return e&&oi(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=h.a.documentElement.style.overflow,bt(h.a,"keydown",this.boundFullWindowOnEscKey_),h.a.documentElement.style.overflow="hidden",Pe(h.a.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,vt(h.a,"keydown",this.boundFullWindowOnEscKey_),h.a.documentElement.style.overflow=this.docOrigOverflow,Le(h.a.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&o.a.documentPictureInPicture){const e=h.a.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(Ie("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),o.a.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(et(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{const n=t.target.querySelector(".video-js");e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in h.a&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return o.a.documentPictureInPicture&&o.a.documentPictureInPicture.window?(o.a.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in h.a?h.a.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=t=>"f"===e.key.toLowerCase(),muteKey:r=t=>"m"===e.key.toLowerCase(),playPauseKey:o=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Xt.getComponent("FullscreenToggle");!1!==h.a[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault(),e.stopPropagation();Xt.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation();Xt.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const r=n[i];let o=qi.getTech(r);if(o||(o=Xt.getComponent(r)),o){if(o.isSupported()&&(t=o.canPlayType(e),t))return t}else j.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map(e=>[e,qi.getTech(e)]).filter(([e,t])=>t?t.isSupported():(j.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(e,t,n){let r;return e.some(e=>t.some(t=>{if(r=n(e,t),r)return!0})),r};let r;const o=([e,t],source)=>{if(t.canPlaySource(source,this.options_[e.toLowerCase()]))return{source:source,tech:e}};var l;return r=this.options_.sourceOrder?n(e,t,(l=o,(a,b)=>l(b,a))):n(t,e,o),r||!1}handleSrc_(source,e){if(void 0===source)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const t=es(source);if(t.length){if(this.changingSrc_=!0,e||(this.cache_.sources=t),this.updateSourceCaches_(t[0]),zi(this,t[0],(n,r)=>{this.middleware_=r,e||(this.cache_.sources=t),this.updateSourceCaches_(n);if(this.src_(n))return t.length>1?this.handleSrc_(t.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());var o,l;o=r,l=this.tech_,o.forEach(e=>e.setTech&&e.setTech(l))}),t.length>1){const e=()=>{this.error(null),this.handleSrc_(t.slice(1),!0)},n=()=>{this.off("error",e)};this.one("error",e),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",n)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(source){return this.handleSrc_(source,!1)}src_(source){const e=this.selectSource([source]);return!e||(Wt(e.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",source):this.techCall_("src",source.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(e.tech,e.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{oi(this.play().then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Lt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:o}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),o&&(o.update(),o.loadProgressBar&&o.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const source=this.currentSource(),e=[];return 0!==Object.keys(source).length&&e.push(source),this.cache_.sources||e}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(L("beforeerror").forEach(t=>{const n=t(this,e);G(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new ri(e),this.addClass("vjs-error"),j.error(`(CODE:${this.error_.code} ${ri.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),L("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=kt(this,this.reportUserActivity),o=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())}),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");let h;!l||ve||ie||(l.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(h);const e=this.options_.inactivityTimeout;e<=0||(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,label,t){if(this.tech_)return this.tech_.addTextTrack(e,label,t)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:track}=e;if(track||(track=e),this.tech_)return this.tech_.removeRemoteTextTrack(track)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(code){if(void 0===code)return this.language_;this.language_!==String(code).toLowerCase()&&(this.language_=String(code).toLowerCase(),Lt(this)&&this.trigger("languagechange"))}languages(){return K(jn.prototype.options_.languages,this.languages_)}toJSON(){const e=K(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let track=t[i];track=K(track),track.player=void 0,e.tracks[i]=track}return e}createModal(content,e){(e=e||{}).content=content||"";const t=new mi(this,e);return this.addChild(t),t.on("dispose",()=>{this.removeChild(t)}),t.open(),t}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<Un.length;i++){const n=Un[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(Bn[e]),this.addClass(Bn[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},Fn,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;return(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Bn[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const n=this.crossOrigin();this.reset(),this.cache_.media=K(e);const{artist:r,artwork:o,description:l,poster:h,src:d,textTracks:c,title:title}=this.cache_.media;!o&&h&&(this.cache_.media.artwork=[{src:h,type:Zi(h)}]),n&&this.crossOrigin(n),d&&this.src(d),h&&this.poster(h),Array.isArray(c)&&c.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:title,description:l||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Zi(t.poster)}]),t}return K(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=Me(e),r=n["data-setup"];if(Oe(e,"vjs-fill")&&(n.fill=!0),Oe(e,"vjs-fluid")&&(n.fluid=!0),null!==r)try{Object.assign(n,JSON.parse(r||"{}"))}catch(e){j.error("data-setup",e)}if(Object.assign(t,n),e.hasChildNodes()){const n=e.childNodes;for(let i=0,e=n.length;i<e;i++){const e=n[i],r=e.nodeName.toLowerCase();"source"===r?t.sources.push(Me(e)):"track"===r&&t.tracks.push(Me(e))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}jn.prototype.videoTracks=()=>{},jn.prototype.audioTracks=()=>{},jn.prototype.textTracks=()=>{},jn.prototype.remoteTextTracks=()=>{},jn.prototype.remoteTextTrackEls=()=>{}
vendor: 4,201 bytes, line 2
2,ji.names.forEach(function(e){const t=ji[e];jn.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),jn.prototype.crossorigin=jn.prototype.crossOrigin,jn.players={};const qn=o.a.navigator;jn.prototype.options_={techOrder:qi.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:qn&&(qn.languages&&qn.languages[0]||qn.userLanguage||qn.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Nn.forEach(function(e){jn.prototype[`handleTech${zt(e)}_`]=function(){return this.trigger(e)}}),Xt.registerComponent("Player",jn);const $n="plugin",Vn="activePlugins_",Hn={},zn=e=>Hn.hasOwnProperty(e),Wn=e=>zn(e)?Hn[e]:void 0,Gn=(e,t)=>{e[Vn]=e[Vn]||{},e[Vn][t]=!0},Xn=(e,t,n)=>{const r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},Kn=(e,t)=>(t.prototype.name=e,function(...n){Xn(this,{name:e,plugin:t,instance:null},!0);const r=new t(...[this,...n]);return this[e]=()=>r,Xn(this,r.getEventHash()),r});class Yn{constructor(e){if(this.constructor===Yn)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),qt(this),delete this.trigger,Vt(this,this.constructor.defaultState),Gn(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Tt(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Vn][e]=!1,this.player=this.state=null,t[e]=Kn(e,Hn[e])}static isBasic(e){const p="string"==typeof e?Wn(e):e;return"function"==typeof p&&!Yn.prototype.isPrototypeOf(p.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(zn(e))j.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(jn.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Hn[e]=t,e!==$n&&(Yn.isBasic(t)?jn.prototype[e]=function(e,t){const n=function(){Xn(this,{name:e,plugin:t,instance:null},!0);const n=t.apply(this,arguments);return Gn(this,e),Xn(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n}(e,t):jn.prototype[e]=Kn(e,t)),t}static deregisterPlugin(e){if(e===$n)throw new Error("Cannot de-register base plugin.");zn(e)&&(delete Hn[e],delete jn.prototype[e])}static getPlugins(e=Object.keys(Hn)){let t;return e.forEach(e=>{const n=Wn(e);n&&(t=t||{},t[e]=n)}),t}static getPluginVersion(e){const t=Wn(e);return t&&t.VERSION||""}}function Qn(e,t,n,r){return function(e,t){let n=!1;return function(...r){return n||j.warn(e),n=!0,t.apply(this,r)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}Yn.getPlugin=Wn,Yn.BASE_PLUGIN_NAME=$n,Yn.registerPlugin($n,Yn),jn.prototype.usingPlugin=function(e){return!!this[Vn]&&!0===this[Vn][e]},jn.prototype.hasPlugin=function(e){return!!zn(e)};const Jn=e=>0===e.indexOf("#")?e.slice(1):e;function Zn(e,t,n){let r=Zn.getPlayer(e);if(r)return t&&j.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;const l="string"==typeof e?Qe("#"+Jn(e)):e;if(!Ce(l))throw new TypeError("The element or ID supplied is not val
2id. (videojs)");const h="getRootNode"in l&&l.getRootNode()instanceof o.a.ShadowRoot?l.getRootNode():l.ownerDocument.body;l.ownerDocument.defaultView&&h.contains(l)||j.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(l.parentNode&&l.parentNode.hasAttribute&&l.parentNode.hasAttribute("data-vjs-player")?l.parentNode:l).cloneNode(!0)),L("beforesetup").forEach(e=>{const n=e(l,K(t));G(n)&&!Array.isArray(n)?t=K(t,n):j.error("please return an object in beforesetup hooks")});const d=Xt.getComponent("Player");return r=new d(l,t,n),L("setup").forEach(e=>e(r)),r}if(Zn.hooks_=P,Zn.hooks=L,Zn.hook=function(e,t){L(e,t)},Zn.hookOnce=function(e,t){L(e,[].concat(t).map(t=>{const n=(...r)=>(R(e,n),t(...r));return n}))},Zn.removeHook=R,!0!==o.a.VIDEOJS_NO_DYNAMIC_STYLE&&we()){let style=Qe(".vjs-styles-defaults");if(!style){style=lt("vjs-styles-defaults");const head=Qe("head");head&&head.insertBefore(style,head.firstChild),ut(style,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: 56.25%\n      }\n    ")}}at(1,Zn),Zn.VERSION=O,Zn.options=jn.prototype.options_,Zn.getPlayers=()=>jn.players,Zn.getPlayer=e=>{const t=jn.players;let n;if("string"==typeof e){const r=Jn(e),o=t[r];if(o)return o;n=Qe("#"+r)}else n=e;if(Ce(n)){const{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},Zn.getAllPlayers=()=>Object.keys(jn.players).map(e=>jn.players[e]).filter(Boolean),Zn.players=jn.players,Zn.getComponent=Xt.getComponent,Zn.registerComponent=(e,t)=>(qi.isTech(t)&&j.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Xt.registerComponent.call(Xt,e,t)),Zn.getTech=qi.getTech,Zn.registerTech=qi.registerTech,Zn.use=function(e,t){$i[e]=$i[e]||[],$i[e].push(t)},Object.defineProperty(Zn,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Zn.middleware,"TERMINATOR",{value:Hi,writeable:!1,enumerable:!0}),Zn.browser=Se,Zn.obj=J,Zn.mergeOptions=Qn(9,"videojs.mergeOptions","videojs.obj.merge",K),Zn.defineLazyProperty=Qn(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Q),Zn.bind=Qn(9,"videojs.bind","native Function.prototype.bind",kt),Zn.registerPlugin=Yn.registerPlugin,Zn.deregisterPlugin=Yn.deregisterPlugin,Zn.plugin=(e,t)=>(j.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Yn.registerPlugin(e,t)),Zn.getPlugins=Yn.getPlugins,Zn.getPlugin=Yn.getPlugin,Zn.getPluginVersion=Yn.getPluginVersion,Zn.addLanguage=function(code,data){return code=(""+code).toLowerCase(),Zn.options.languages=K(Zn.options.languages,{[code]:data}),Zn.options.languages[code]},Zn.log=j,Zn.createLogger=$,Zn.time=si,Zn.createTimeRange=Qn(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Qt),Zn.createTimeRanges=Qn(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Qt),Zn.formatTime=Qn(9,"videojs.formatTime","videojs.time.formatTime",ii),Zn.setFormatTime=Qn(9,"videojs.setFormatTime","videojs.time.setFormatTime",ei),Zn.resetFormatTime=Qn(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ti),Zn.parseUrl=Qn(9,"videojs.parseUrl","videojs.url.parseUrl",xi),Zn.isCrossOrigin=Qn(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Di),Zn.EventTarget=Ot,Zn.any=Et,Zn.on=bt,Zn.one=St,Zn.off=vt,Zn.trigger=Tt,Zn.xhr=c.a,Zn.TrackList=gi,Zn.TextTrack=Ri,Zn.TextTrackList=vi,Zn.AudioTrack=Ni,Zn.AudioTrackList=yi,Zn.VideoTrack=Mi,Zn.VideoTrackList=bi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{Zn[e]=function(){return j.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),tt[e].apply(null,arguments)}}),Zn.computedStyle=Qn(9,"videojs.computedStyle","videojs.dom.computedStyle",Ze),Zn.dom=tt,Zn.fn=At,Zn.num=Ss,Zn.str=Gt,Zn.url=Oi,Zn.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};class er{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class ir extends Zn.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new er(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let i=0,t=this.length;i<t;i++){const t=this[i];if(t.id===e)return t}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}ir.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in ir.prototype.allowedEvents_)ir.prototype["on"+e]=null;var sr="4.1.0";const nr=function(e){return function(e){const t=e.qualityLevels,n=new ir,r=function(){n.dispose(),e.qualityLevels=t,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>n,e.qualityLevels.VERSION=sr,n}(this,Zn.obj.merge({},e))};Zn.registerPlugin("qualityLevels",nr),nr.VERSION=sr;const rr=v.a,ar=(e,t)=>
vendor: 34,766 bytes, line 2
2t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,or=source=>Zn.log.debug?Zn.log.debug.bind(Zn,"VHS:",`${source} >`):function(){};function lr(...e){const t=Zn.obj||Zn;return(t.merge||t.mergeOptions).apply(t,e)}function ur(...e){const t=Zn.time||Zn;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const dr=1/30,cr=.1,pr=function(e,t){const n=[];let i;if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return ur(n)},mr=function(e,time){return pr(e,function(e,t){return e-cr<=time&&t+cr>=time})},gr=function(e,time){return pr(e,function(e){return e-dr>=time})},fr=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},yr=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},_r=function(a){if(a&&a.length&&a.end)return a.end(a.length-1)},vr=function(e,t){let time=0;if(!e||!e.length)return time;for(let i=0;i<e.length;i++){const n=e.start(i),r=e.end(i);t>r||(time+=t>n&&t<=r?r-t:r-n)}return time},Tr=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach(function(p){n+=p.duration}),(t.preloadHints||[]).forEach(function(p){"PART"===p.type&&(n+=e.partTargetDuration)}),n},Sr=e=>(e.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,o){e.push({duration:r.duration,segmentIndex:n,partIndex:o,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),Er=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},wr=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:n}=e;let r=(n||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return r+=t&&t.length?t.length:0,r},Cr=(main,e)=>{if(e.endList)return 0;if(main&&main.suggestedPresentationDelay)return main.suggestedPresentationDelay;const t=Er(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},kr=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const r=function(e,t){let n=0,i=t-e.mediaSequence,r=e.segments[i];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=e.segments[i],void 0!==r.end)return{result:n+r.end,precise:!0};if(n+=Tr(e,r),void 0!==r.start)return{result:n+r.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(r.precise)return r.result;const o=function(e,t){let n,r=0,i=t-e.mediaSequence;for(;i<e.segments.length;i++){if(n=e.segments[i],void 0!==n.start)return{result:n.start-r,precise:!0};if(r+=Tr(e,n),void 0!==n.end)return{result:n.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return o.precise?o.result:r.result+n},xr=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return o.a.Infinity}return kr(e,t,n)},Ir=function({defaultDuration:e,durationList:t,startIndex:n,endIndex:r}){let o=0;if(n>r&&([n,r]=[r,n]),n<0){for(let i=n;i<Math.min(0,r);i++)o+=e;n=0}for(let i=n;i<r;i++)o+=t[i].duration;return o},Ar=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return xr(e);if(null===t)return null;t=t||0;let o=kr(e,e.mediaSequence+e.segments.length,t);return n&&(o-=r="number"==typeof r?r:Cr(null,e)),Math.max(0,o)},Dr=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Or=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Pr=function(e){const t=Dr(e);return!e.disabled&&!t},Lr=function(e,t){return t.attributes&&t.attributes[e]},Rr=(main,e)=>{if(1===main.playlists.length)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===main.playlists.filter(e=>!!Pr(e)&&(e.attributes.BANDWIDTH||0)<t).length},Nr=(a,b)=>!(!a&&!b||!a&&b||a&&!b)&&(a===b||(!(!a.id||!b.id||a.id!==b.id)||(!(!a.resolvedUri||!b.resolvedUri||a.resolvedUri!==b.resolvedUri)||!(!a.uri||!b.uri||a.uri!==b.uri)))),Mr=function(main,e){const t=main&&main.mediaGroups&&main.mediaGroups.AUDIO||{};let n=!1;for(const r in t){for(const label in t[r])if(n=e(t[r][label]),n)break;if(n)break}return!!n},Ur=main=>{if(!main||!main.playlists||!main.playlists.length){return Mr(main,e=>e.playlists&&e.playlists.length||e.uri)}for(let i=0;i<main.playlists.length;i++){const e=main.playlists[i],t=e.attributes&&e.attributes.CODECS;if(t&&t.split(",").every(e=>Object(S.f)(e)))continue;if(!Mr(main,t=>Nr(e,t)))return!1}return!0};var Br={liveEdgeDelay:Cr,duration:xr,seekable:function(e,t,n){const r=t||0;let o=Ar(e,t,!0,n);return null===o?ur():(o<r&&(o=r),ur(r,o))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:o,exactManifestTimings:l}){let time=t-o;const h=Sr(e);let d=0;for(let i=0;i<h.length;i++){const e=h[i];if(n===e.segmentIndex&&("number"!=typeof r||"number"!=typeof e.partIndex||r===e.partIndex)){d=i;break}}if(time<0){if(d>0)for(let i=d-1;i>=0;i--){const t=h[i];if(time+=t.duration,l){if(time<0)continue}else if(time+dr<=0)continue;return{partIndex:t.partIndex,segmentIndex:t.segmentIndex,startTime:o-Ir({defaultDuration:e.targetDuration,durationList:h,startIndex:d,endIndex:i})}}return{partIndex:h[0]&&h[0].partIndex||null,segmentIndex:h[0]&&h[0].segmentIndex||0,startTime:t}}if(d<0){for(let i=d;i<0;i++)if(time-=e.targetDuration,time<0)return{partIndex:h[0]&&h[0].partIndex||null,segmentIndex:h[0]&&h[0].segmentIndex||0,startTime:t};d=0}for(let i=d;i<h.length;i++){const t=h[i];time-=t.duration;const n=t.duration>dr;if(!(0===time)&&!(n&&time+dr>=0)||i===h.length-1){if(l){if(time>0)continue}else if(time-dr>=0)continue;return{partIndex:t.partIndex,segmentIndex:t.segmentIndex,startTime:o+Ir({defaultDuration:e.targetDuration,durationList:h,startIndex:d,endIndex:i})}}}return{segmentIndex:h[h.length-1].segmentIndex,partIndex:h[h.length-1].partIndex,startTime:t}},isEnabled:Pr,isDisabled:function(e){return e.disabled},isExcluded:Dr,isIncompatible:Or,playlistEnd:Ar,isAes:function(e){for(let i=0;i<e.segments.length;i++)if(e.segments[i].key)return!0;return!1},hasAttribute:Lr,estimateSegmentRequestTime:function(e,t,n,r=0){if(!Lr("BANDWIDTH",n))return NaN;return(e*n.attributes.BANDWIDTH-8*r)/t},isLowestEnabledRendition:Rr,isAudioOnly:Ur,playlistMatch:Nr,segmentDurationWithParts:Tr};const{log:Fr}=Zn,jr=(e,t)=>`${e}-${t}`,qr=(e,t,label)=>`placeholder-uri-${e}-${t}-${label}`,$r=(main,e)=>{main.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(main.mediaGroups[t])for(const n in main.mediaGroups[t])for(const r in main.mediaGroups[t][n]){const o=main.mediaGroups[t][n][r];e(o,t,n,r)}})},Vr=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},Hr=(main,e,t=qr)=>{main.uri=e;for(let i=0;i<main.playlists.length;i++)if(!main.playlists[i].uri){const e=`placeholder-uri-${i}`;main.playlists[i].uri=e}const n=Ur(main);$r(main,(e,r,o,l)=>{if(!e.playlists||!e.playlists.length){if(n&&"AUDIO"===r&&!e.uri)for(let i=0;i<main.playlists.length;i++){const p=main.playlists[i];if(p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===o)return}e.playlists=[_()({},e)]}e.playlists.forEach(function(p,i){const e=t(r,o,l,p),n=jr(i,e);p.uri?p.resolvedUri=p.resolvedUri||rr(main.uri,p.uri):(p.uri=0===i?e:n,p.resolvedUri=p.uri),p.id=p.id||n,p.attributes=p.attributes||{},main.playlists[p.id]=p,main.playlists[p.uri]=p})}),(main=>{let i=main.playlists.length;for(;i--;){const e=main.playlists[i];Vr({playlist:e,id:jr(i,e.uri)}),e.resolvedUri=rr(main.uri,e.uri),main.playlists[e.id]=e,main.playlists[e.uri]=e,e.attributes.BANDWIDTH||Fr.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(main),(main=>{$r(main,e=>{e.uri&&(e.resolvedUri=rr(main.uri,e.uri))})})(main)};class zr{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce((map,e)=>(map.set(e.id,e),map),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),n.class))if(e[n.class]){const t=e[n.class].push(n);n.classListIndex=t-1}else e[n.class]=[n],n.classListIndex=0});for(const n of t){const t=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&t[n.classListIndex+1]?n.endTime=t[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,n)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(n)})}}const Wr=({requestType:e,request:t,error:n,parseFailure:r})=>{const o=t.status<200||t.status>299,l=t.status>=400&&t.status<=499,h={uri:t.uri,requestType:e},d=o&&!l||r;if(n&&l)h.error=_()({},n),h.errorType=Zn.Error.NetworkRequestFailed;else if(t.aborted)h.errorType=Zn.Error.NetworkRequestAborted;else if(t.timedout)h.errorType=Zn.Error.NetworkRequestTimeout;else if(d){const e=r?Zn.Error.NetworkBodyParserFailed:Zn.Error.NetworkBadStatus;h.errorType=e,h.status=t.status,h.headers=t.headers}return h},Gr=or("CodecUtils"),Xr=function(e){const t=e.attributes||{};if(t.CODECS)return Object(S.h)(t.CODECS)},Kr=(main,e)=>{const t=e.attributes||{};return main&&main.mediaGroups&&main.mediaGroups.AUDIO&&t.AUDIO&&main.mediaGroups.AUDIO[t.AUDIO]},Yr=function(e){const t={};return e.forEach(({mediaType:e,type:n,details:details})=>{t[e]=t[e]||[],t[e].push(Object(S.i)(`${n}${details}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return Gr(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]}),t},Qr=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Jr=function(main,e){const t=e.attributes||{},n=Yr(Xr(e)||[]);if(Kr(main,e)&&!n.audio&&!((main,e)=>{if(!Kr(main,e))return!0;const t=e.attributes||{},n=main.mediaGroups.AUDIO[t.AUDIO];for(const e in n)if(!n[e].uri&&!n[e].playlists)return!0;return!1})(main,e)){const e=Yr(Object(S.d)(main,t.AUDIO)||[]);e.audio&&(n.audio=e.audio)}return n},{EventTarget:Zr}=Zn,ea=(a,b)=>{if(!a)return b;const e=lr(a,b);if(a.preloadHints&&!b.preloadHints&&delete e.preloadHints,a.parts&&!b.parts)delete e.parts;else if(a.parts&&b.parts)for(let i=0;i<b.parts.length;i++)a.parts&&a.parts[i]&&(e.parts[i]=lr(a.parts[i],b.parts[i]));return!a.skipped&&b.skipped&&(e.skipped=!1),a.preload&&!b.preload&&(e.preload=!1),e},ta=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=rr(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=rr(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=rr(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=rr(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(p=>{p.resolvedUri||(p.resolvedUri=rr(t,p.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(p=>{p.resolvedUri||(p.resolvedUri=rr(t,p.uri))})},ia=function(e){const t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(let i=0;i<n.preloadHints.length;i++)if("MAP"===n.preloadHints[i].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},sa=(a,b)=>a===b||a.segments&&b.segments&&a.segments.length===b.segments.length&&a.endList===b.endList&&a.mediaSequence===b.mediaSequence&&a.preloadSegment===b.preloadSegment,na=(main,e,t=sa)=>{const n=lr(main,{}),r=n.playlists[e.id];if(!r)return null;if(t(r,e))return null;e.segments=ia(e);const o=lr(r,e);if(o.preloadSegment&&!e.preloadSegment&&delete o.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let i=0;i<e.skip.skippedSegments;i++)e.segments.unshift({skipped:!0})}o.segments=((e,t,n)=>{const r=e.slice(),o=t.slice();n=n||0;const l=[];let h;for(let e=0;e<o.length;e++){const t=r[e+n],d=o[e];t?(h=t.map||h,l.push(ea(t,d))):(h&&!d.map&&(d.map=h),l.push(d))}return l})(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}o.segments.forEach(e=>{ta(e,o.resolvedUri)});for(let i=0;i<n.playlists.length;i++)n.playlists[i].id===e.id&&(n.playlists[i]=o);return n.playlists[e.id]=o,n.playlists[e.uri]=o,$r(main,(t,n,r,l)=>{if(t.playlists)for(let i=0;i<t.playlists.length;i++)e.id===t.playlists[i].id&&(t.playlists[i]=o)}),n},ra=(e,t)=>{const n=e.segments||[],r=n[n.length-1],o=r&&r.parts&&r.parts[r.parts.length-1],l=o&&o.duration||r&&r.duration;return t&&l?1e3*l:500*(e.partTargetDuration||e.targetDuration||10)},aa=(e,t,n)=>{if(!e)return;const r=[];return e.forEach(e=>{if(!e.attributes)return;const{BANDWIDTH:t,RESOLUTION:n,CODECS:o}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:n,codecs:o})}),{type:t,isLive:n,renditions:r}};class oa extends Zr{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=or("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const o=t.options_;this.customTagParsers=o&&o.customTagParsers||[],this.customTagMappers=o&&o.customTagMappers||[],this.llhls=o&&o.llhls,this.dateRangesStorage_=new zr,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=rr(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const n={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let r=t.mediaSequence+t.segments.length;if(e){const o=e.parts||[],l=wr(t)-1;l>-1&&l!==o.length-1&&(n._HLS_part=l),(l>-1||o.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){const t=new o.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,n){const{uri:r,id:o}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[o],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Wr({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const n=(({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:o=[],llhls:l})=>{const h=new T.a;e&&h.on("warn",e),t&&h.on("info",t),r.forEach(e=>h.addParser(e)),o.forEach(e=>h.addTagMapper(e)),h.push(n),h.end();const d=h.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){d.hasOwnProperty(e)&&delete d[e]}),d.segments&&d.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!d.targetDuration){let t=10;d.segments&&d.segments.length&&(t=d.segments.reduce((e,s)=>Math.max(e,s.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),d.targetDuration=t}const c=Er(d);if(c.length&&!d.partTargetDuration){const t=c.reduce((e,p)=>Math.max(e,p.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),Fr.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.")),d.partTargetDuration=t}return d})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return n.playlists&&n.playlists.length?(this.excludeAudioOnlyVariants(n.playlists),n):n}catch(e){this.error=e,this.error.metadata={errorType:Zn.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){const t=e=>{const t=e.attributes||{},{width:n,height:r}=t.RESOLUTION||{};if(n&&r)return!0;const o=Xr(e)||[],l=Yr(o);return Boolean(l.video)};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const o={playlistInfo:{type:"media",uri:n}};this.trigger({type:"playlistparsestart",metadata:o});const l=t||this.parseManifest_({url:n,manifestString:e});l.lastRequest=Date.now(),Vr({playlist:l,uri:n,id:r});const h=na(this.main,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,h?(this.main=h,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(ra(this.media(),!!h)),o.parsedPlaylist=aa(this.main.playlists,o.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:o}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),o.a.clearTimeout(this.mediaUpdateTimeout),o.a.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new zr,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(o.a.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=o.a.setTimeout(this.media.bind(this,e,!1),t))}const n=this.state,r=!this.media_||e.id!==this.media_.id,l=this.main.playlists[e.id];if(l&&l.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(ra(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const h={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:h}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=ar(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.trigger({type:"playlistrequestcomplete",metadata:h}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;return void(this.mediaUpdateTimeout=o.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e))}this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=o.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=o.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,n)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:Wr({requestType:n.requestType,request:n,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=ar(this.src,n),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=aa(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,Hr(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=ia(e),e.segments.forEach(t=>{ta(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||o.a.location.href;this.main=((e,t)=>{const n=jr(0,t),main={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:o.a.location.href,resolvedUri:o.a.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return main.playlists[n]=main.playlists[0],main.playlists[t]=main.playlists[0],main})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const main=this.main,n=e.ID;let i=main.playlists.length;for(;i--;){const p=main.playlists[i];if(p.attributes["PATHWAY-ID"]===n){const r=p.resolvedUri,o=p.id;if(t){const t=this.createCloneURI_(p.resolvedUri,e),r=jr(n,t),o=this.createCloneAttributes_(n,p.attributes),l=this.createClonePlaylist_(p,r,e,o);main.playlists[i]=l,main.playlists[r]=l,main.playlists[t]=l}else main.playlists.splice(i,1);delete main.playlists[o],delete main.playlists[r]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const main=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(main.mediaGroups[e]&&main.mediaGroups[e][n])for(const t in main.mediaGroups[e])if(t===n){for(const n in main.mediaGroups[e][t]){main.mediaGroups[e][t][n].playlists.forEach((p,i)=>{const e=main.playlists[p.id],t=e.id,n=e.resolvedUri;delete main.playlists[t],delete main.playlists[n]})}delete main.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const main=this.main,n=main.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),o=jr(e.ID,r),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,o,e,l);main.playlists[n]=h,main.playlists[o]=h,main.playlists[r]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,n=e["BASE-ID"],main=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{if(main.mediaGroups[r]&&!main.mediaGroups[r][t])for(const o in main.mediaGroups[r])if(o===n){main.mediaGroups[r][t]={};for(const n in main.mediaGroups[r][o]){const l=main.mediaGroups[r][o][n];main.mediaGroups[r][t][n]=_()({},l);const h=main.mediaGroups[r][t][n],d=this.createCloneURI_(l.resolvedUri,e);h.resolvedUri=d,h.uri=d,h.playlists=[],l.playlists.forEach((p,i)=>{const o=main.playlists[p.id],l=qr(r,t,n),d=jr(t,l);if(o&&!main.playlists[d]){const t=this.createClonePlaylist_(o,d,e),n=t.resolvedUri;main.playlists[d]=t,main.playlists[n]=t}h.playlists[i]=this.createClonePlaylist_(p,d,e)})}}})}createClonePlaylist_(e,t,n,r){const o=this.createCloneURI_(e.resolvedUri,n),l={resolvedUri:o,uri:o,id:t};return e.segments&&(l.segments=[]),r&&(l.attributes=r),lr(e,l)}createCloneURI_(e,t){const n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(r))n.searchParams.set(e,r[e]);return n.href}createCloneAttributes_(e,t){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(n[r]=e)}),n}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const n in e.contentProtection)if(e.contentProtection[n]&&e.contentProtection[n].attributes&&e.contentProtection[n].attributes.keyId){const r=e.contentProtection[n].attributes.keyId;t.add(r.toLowerCase())}return t}}const la=function(e,t,n,r){const o="arraybuffer"===e.responseType?e.response:e.responseText;!t&&o&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=o.byteLength||o.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(o||e.responseText)))),r(t,e)},ua=function(){const e=function e(t,n){t=lr({timeout:45e3},t);const r=e.beforeRequest||Zn.Vhs.xhr.beforeRequest,o=e._requestCallbackSet||Zn.Vhs.xhr._requestCallbackSet||new Set,l=e._responseCallbackSet||Zn.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(Zn.log.warn("beforeRequest is deprecated, use onRequest instead."),o.add(r));const h=!0===Zn.Vhs.xhr.original?Zn.xhr:Zn.Vhs.xhr,d=((e,t)=>{if(!e||!e.size)return;let n=t;return e.forEach(e=>{n=e(n)}),n})(o,t);o.delete(r);const c=h(d||t,function(e,t){return((e,t,n,r)=>{e&&e.size&&e.forEach(e=>{e(t,n,r)})})(l,c,e,t),la(c,e,t,n)}),m=c.abort;return c.abort=function(){return c.aborted=!0,m.apply(c,arguments)},c.uri=t.uri,c.requestType=t.requestType,c.requestTime=Date.now(),c};return e.original=!0,e},ha=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const n=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?o.a.BigInt(e.offset)+o.a.BigInt(e.length)-o.a.BigInt(1):e.offset+e.length-1,"bytes="+n+"-"+t}(e.byterange)),t},da=function(e,i){return e.start(i)+"-"+e.end(i)},ca=function(e,i){const t=e.toString(16);return"00".substring(0,2-t.length)+t+(i%2?" ":"")},pa=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},ma=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];Object(w.e)(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t},ga=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},fa=function(e){return e.resolvedUri},ya=data=>{const e=Array.prototype.slice.call(data),t=16;let n,r,o="";for(let l=0;l<e.length/t;l++)n=e.slice(l*t,l*t+t).map(ca).join(""),r=e.slice(l*t,l*t+t).map(pa).join(""),o+=n+" "+r+"\n";return o};var _a=Object.freeze({__proto__:null,createTransferableMessage:ma,initSegmentId:ga,segmentKeyId:fa,hexDump:ya,tagDump:({bytes:e})=>ya(e),textRanges:e=>{let i,t="";for(i=0;i<e.length;i++)t+=da(e,i)+" ";return t}});const ba=({playlist:e,time:time,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===time)return t({message:"getProgramTime: playlist and time must be provided"});const n=((time,e)=>{if(!e||!e.segments||0===e.segments.length)return null;let t,n=0;for(let i=0;i<e.segments.length&&(t=e.segments[i],n=t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationEnd:n+t.duration,!(time<=n));i++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<time)return null;if(time>n){if(time>n+.25*r.duration)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:n-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}})(time,e);if(!n)return t({message:"valid programTime was not found"});if("estimate"===n.type)return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:time},o=((e,t)=>{if(!t.dateTimeObject)return null;const n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)})(time,n.segment);return o&&(r.programDateTime=o.toISOString()),t(null,r)},va=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:o=!0,tech:l,callback:h})=>{if(!h)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!r)return h({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!l.hasStarted_)return h({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let i=0;i<e.segments.length;i++)if(!e.segments[i].dateTimeObject)return!1;return!0})(t))return h({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const d=((e,t)=>{let n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let i=0;i<t.segments.length-1&&(r=t.segments[i],!(n<new Date(t.segments[i+1].dateTimeObject)));i++);const o=t.segments[t.segments.length-1],l=o.dateTimeObject,h=o.videoTimingInfo?(d=o.videoTimingInfo).transmuxedPresentationEnd-d.transmuxedPresentationStart-d.transmuxerPrependedSeconds:o.duration+.25*o.duration;var d;return n>new Date(l.getTime()+1e3*h)?null:(n>new Date(l)&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Br.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!d)return h({message:`${e} was not found in the stream`});const c=d.segment,m=((e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch(e){}const o=n.getTime();return(r.getTime()-o)/1e3})(c.dateTimeObject,e);if("estimate"===d.type)return 0===n?h({message:`${e} is not buffered yet. Try again`}):(r(d.estimatedStart+m),void l.one("seeked",()=>{va({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:o,tech:l,callback:h})}));const f=c.start+m;l.one("seeked",()=>h(null,l.currentTime())),o&&l.pause(),r(f)},Ta=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Sa}=Zn,Ea=function(a,b){if(!sa(a,b))return!1;if(a.sidx&&b.sidx&&(a.sidx.offset!==b.sidx.offset||a.sidx.length!==b.sidx.length))return!1;if(!a.sidx&&b.sidx||a.sidx&&!b.sidx)return!1;if(a.segments&&!b.segments||!a.segments&&b.segments)return!1;if(!a.segments&&!b.segments)return!0;for(let i=0;i<a.segments.length;i++){const e=a.segments[i],t=b.segments[i];if(e.uri!==t.uri)return!1;if(!e.byterange&&!t.byterange)continue;const n=e.byterange,r=t.byterange;if(n&&!r||!n&&r)return!1;if(n.offset!==r.offset||n.length!==r.length)return!1}return!0},wa=(e,t,label,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||label}`,Ca=(e,t,n)=>{let r=!0,o=lr(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let i=0;i<t.playlists.length;i++){const e=t.playlists[i];if(e.sidx){const t=Object(C.b)(e.sidx);n&&n[t]&&n[t].sidx&&Object(C.a)(e,n[t].sidx,e.sidx.resolvedUri)}const l=na(o,e,Ea);l&&(o=l,r=!1)}return $r(t,(e,t,n,label)=>{if(e.playlists&&e.playlists.length){const l=e.playlists[0].id,h=na(o,e.playlists[0],Ea);h&&(o=h,label in o.mediaGroups[t][n]||(o.mediaGroups[t][n][label]=e),o.mediaGroups[t][n][label].playlists[0]=o.playlists[l],r=!1)}}),((e,t)=>{$r(e,(n,r,o,label)=>{t.mediaGroups[r][o]&&label in t.mediaGroups[r][o]||delete e.mediaGroups[r][o][label]})})(o,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:o},ka=(a,b)=>(Boolean(!a.map&&!b.map)||Boolean(a.map&&b.map&&a.map.byterange.offset===b.map.byterange.offset&&a.map.byterange.length===b.map.byterange.length))&&a.uri===b.uri&&a.byterange.offset===b.byterange.offset&&a.byterange.length===b.byterange.length,xa=(e,t)=>{const n={};for(const r in e){const o=e[r].sidx;if(o){const e=Object(C.b)(o);if(!t[e])break;const r=t[e].sidxInfo;ka(r,o)&&(n[e]=t[e])}}return n};class Ia extends Sa{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:o=!1}=n;if(this.vhs_=t,this.withCredentials=o,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)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_=or("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,n){const r=e.sidx&&Object(C.b)(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return o.a.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=o.a.setTimeout(()=>n(!1),0));const l=ar(e.sidx.resolvedUri),h=(o,l)=>{if(this.requestErrored_(o,l,t))return;const h=this.mainPlaylistLoader_.sidxMapping_,{requestType:d}=l;let c;
2try{c=x()(Object(w.k)(l.response).subarray(8))}catch(e){return e.metadata=Wr({requestType:d,request:l,parseFailure:!0}),void this.requestErrored_(e,l,t)}return h[r]={sidxInfo:e.sidx,sidx:c},Object(C.a)(e,c,e.sidx.resolvedUri),n(!0)};this.request=((e,t,n,r)=>{let o,l=[],h=!1;const d=function(e,t,r,o){return t.abort(),h=!0,n(e,t,r,o)},c=function(e,t){if(h)return;if(e)return e.metadata=Wr({requestType:r,request:t,error:e}),d(e,t,"",l);const n=t.responseText.substring(l&&l.byteLength||0,t.responseText.length);if(l=Object(w.d)(l,Object(w.h)(n,!0)),o=o||Object(I.a)(l),l.length<10||o&&l.length<o+2)return Ta(t,()=>d(e,t,"",l));const c=Object(A.a)(l);return"ts"===c&&l.length<188||!c&&l.length<376?Ta(t,()=>d(e,t,"",l)):d(null,t,c,l)},m={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:n}){return la(e,null,{statusCode:e.status},c)})}},f=t(m,function(e,t){return la(f,e,t,c)});return f})(l,this.vhs_.xhr,(t,n,r,o)=>{if(t)return h(t,n);if(!r||"mp4"!==r){const t=r||"unknown";return h({status:n.status,message:`Unsupported ${t} container type for sidx segment at URL: ${l}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n)}const{offset:d,length:c}=e.sidx.byterange;if(o.length>=c+d)return h(t,{response:o.subarray(d,d+c),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",requestType:"dash-sidx",headers:ha({byterange:e.sidx.byterange})},h)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},o.a.clearTimeout(this.minimumUpdatePeriodTimeout_),o.a.clearTimeout(this.mediaRequest_),o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,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 e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,o.a.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(o.a.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,o.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=o.a.setTimeout(()=>this.load(),e))}this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){if(this.started=!0,!this.isMain_)return o.a.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=o.a.setTimeout(()=>this.haveMain_(),0));this.requestMain_((e,t)=>
vendor: 48,845 bytes, line 2
2{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(n,r)=>{if(n){const{requestType:e}=r;n.metadata=Wr({requestType:e,request:r,error:n})}if(this.requestErrored_(n,r))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const o=r.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=ar(this.mainPlaylistLoader_.srcUrl,r),o?(this.handleMain_(),void this.syncClientServerClock_(()=>e(r,o))):e(r,o)})}syncClientServerClock_(e){const t=Object(C.d)(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:rr(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(n,r)=>{if(!this.request)return;if(n){const{requestType:t}=r;return this.error.metadata=Wr({requestType:t,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let o;o="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=o-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){o.a.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let n;this.trigger({type:"manifestparsestart",metadata:t});try{n=(({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:o})=>{const l=Object(C.c)(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:o});return Hr(l,t,wa),l})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:Zn.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(n=Ca(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){const{duration:e,endList:r}=n,o=[];n.playlists.forEach(e=>{o.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})});const l={duration:e,isLive:!r,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(n)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(o.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=o.a.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((main,e)=>{let t=xa(main.playlists,e);return $r(main,(n,r,o,l)=>{if(n.playlists&&n.playlists.length){const r=n.playlists;t=lr(t,xa(r,e))}}),t})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=o.a.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},ra(this.media(),Boolean(n))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Aa={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 Da=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Oa=function(code){return function(){const e=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const n=new BlobBuilder;return n.append(e),URL.createObjectURL(n.getBlob())}}(code),t=Da(new Worker(e));t.objURL=e;const n=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),n.call(this)},t}},Pa=function(code){return`var browserWorkerPolyFill = ${Da.toString()};\nbrowserWorkerPolyFill(self);\n`+code},La=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Ra=Pa(La(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,i,r,o;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(o=[],i=arguments.length,i=1;i<arguments.length;++i)o.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].apply(this,o)}},this.dispose=function(){e={}}}};n.prototype.pipe=function(e){return this.on("data",function(data){e.push(data)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},n.prototype.push=function(data){this.trigger("data",data)},n.prototype.flush=function(e){this.trigger("done",e)},n.prototype.partialFlush=function(e){this.trigger("partialdone",e)},n.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},n.prototype.reset=function(e){this.trigger("reset",e)};var r,o,l,h,d,c,m,f,y,_,v,T,S,E,w,C,k,x,I,A,D,O,P,L,R,N,M,U,B,F,j,$,V,H,z,W,G,X,K,Y,Q=n,J=Math.pow(2,32),Z={getUint64:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*J+n.getUint32(4)},MAX_UINT32:J},ee=Z.MAX_UINT32;!function(){var i;if(O={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:[]},"undefined"!=typeof Uint8Array){for(i in O)O.hasOwnProperty(i)&&(O[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]);P=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),R=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),L=new Uint8Array([0,0,0,1]),N=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]),U={video:N,audio:M},j=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),F=new Uint8Array([0,0,0,0,0,0,0,0]),$=new Uint8Array([0,0,0,0,0,0,0,0]),V=$,H=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),z=$,B=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),r=function(e){var i,t,n=[],r=0;for(i=1;i<arguments.length;i++)n.push(arguments[i]);for(i=n.length;i--;)r+=n[i].byteLength;for(t=new Uint8Array(r+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),i=0,r=8;i<n.length;i++)t.set(n[i],r),r+=n[i].byteLength;return t},o=function(){return r(O.dinf,r(O.dref,j))},l=function(track){return r(O.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,track.audioobjecttype<<3|track.samplingfrequencyindex>>>1,track.samplingfrequencyindex<<7|track.channelcount<<3,6,1,2]))},w=function(e){return r(O.hdlr,U[e])},E=function(track){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,track.duration>>>24&255,track.duration>>>16&255,track.duration>>>8&255,255&track.duration,85,196,0,0]);return track.samplerate&&(e[12]=track.samplerate>>>24&255,e[13]=track.samplerate>>>16&255,e[14]=track.samplerate>>>8&255,e[15]=255&track.samplerate),r(O.mdhd,e)},S=function(track){return r(O.mdia,E(track),w(track.type),c(track))},d=function(e){return r(O.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},c=function(track){return r(O.minf,"video"===track.type?r(O.vmhd,B):r(O.smhd,F),o(),k(track))},m=function(e,t){for(var n=[],i=t.length;i--;)n[i]=I(t[i]);return r.apply(null,[O.moof,d(e)].concat(n))},f=function(e){for(var i=e.length,t=[];i--;)t[i]=v(e[i]);return r.apply(null,[O.moov,_(4294967295)].concat(t).concat(y(e)))},y=function(e){for(var i=e.length,t=[];i--;)t[i]=A(e[i]);return r.apply(null,[O.mvex].concat(t))},_=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 r(O.mvhd,t)},C=function(track){var e,i,t=track.samples||[],n=new Uint8Array(4+t.length);for(i=0;i<t.length;i++)e=t[i].flags,n[i+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return r(O.sdtp,n)},k=function(track){return r(O.stbl,x(track),r(O.stts,z),r(O.stsc,V),r(O.stsz,H),r(O.stco,$))},x=function(track){return r(O.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===track.type?W(track):G(track))},W=function(track){var i,e,t=track.sps||[],n=track.pps||[],o=[],l=[];for(i=0;i<t.length;i++)o.push((65280&t[i].byteLength)>>>8),o.push(255&t[i].byteLength),o=o.concat(Array.prototype.slice.call(t[i]));for(i=0;i<n.length;i++)l.push((65280&n[i].byteLength)>>>8),l.push(255&n[i].byteLength),l=l.concat(Array.prototype.slice.call(n[i]));if(e=[O.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,(65280&track.width)>>8,255&track.width,(65280&track.height)>>8,255&track.height,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]),r(O.avcC,new Uint8Array([1,track.profileIdc,track.profileCompatibility,track.levelIdc,255].concat([t.length],o,[n.length],l))),r(O.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],track.sarRatio){var h=track.sarRatio[0],d=track.sarRatio[1];e.push(r(O.pasp,new Uint8Array([(4278190080&h)>>24,(16711680&h)>>16,(65280&h)>>8,255&h,(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])))}return r.apply(null,e)},G=function(track){return r(O.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&track.channelcount)>>8,255&track.channelcount,(65280&track.samplesize)>>8,255&track.samplesize,0,0,0,0,(65280&track.samplerate)>>8,255&track.samplerate,0,0]),l(track))},T=function(track){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,0,(4278190080&track.duration)>>24,(16711680&track.duration)>>16,(65280&track.duration)>>8,255&track.duration,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,(65280&track.width)>>8,255&track.width,0,0,(65280&track.height)>>8,255&track.height,0,0]);return r(O.tkhd,e)},I=function(track){var e,t,n,o,l,h;return e=r(O.tfhd,new Uint8Array([0,0,0,58,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),l=Math.floor(track.baseMediaDecodeTime/ee),h=Math.floor(track.baseMediaDecodeTime%ee),t=r(O.tfdt,new Uint8Array([1,0,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l,h>>>24&255,h>>>16&255,h>>>8&255,255&h])),"audio"===track.type?(n=D(track,92),r(O.traf,e,t,n)):(o=C(track),n=D(track,o.length+92),r(O.traf,e,t,n,o))},v=function(track){return track.duration=track.duration||4294967295,r(O.trak,T(track),S(track))},A=function(track){var e=new Uint8Array([0,0,0,0,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==track.type&&(e[e.length-1]=0),r(O.trex,e)},Y=function(e,t){var n=0,r=0,o=0,l=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(o=4),void 0!==e[0].compositionTimeOffset&&(l=8)),[0,0,n|r|o|l,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},K=function(track,e){var t,n,header,o,l,i;for(e+=20+16*(o=track.samples||[]).length,header=Y(o,e),(n=new Uint8Array(header.length+16*o.length)).set(header),t=header.length,i=0;i<o.length;i++)l=o[i],n[t++]=(4278190080&l.duration)>>>24,n[t++]=(16711680&l.duration)>>>16,n[t++]=(65280&l.duration)>>>8,n[t++]=255&l.duration,n[t++]=(4278190080&l.size)>>>24,n[t++]=(16711680&l.size)>>>16,n[t++]=(65280&l.size)>>>8,n[t++]=255&l.size,n[t++]=l.flags.isLeading<<2|l.flags.dependsOn,n[t++]=l.flags.isDependedOn<<6|l.flags.hasRedundancy<<4|l.flags.paddingValue<<1|l.flags.isNonSyncSample,n[t++]=61440&l.flags.degradationPriority,n[t++]=15&l.flags.degradationPriority,n[t++]=(4278190080&l.compositionTimeOffset)>>>24,n[t++]=(16711680&l.compositionTimeOffset)>>>16,n[t++]=(65280&l.compositionTimeOffset)>>>8,n[t++]=255&l.compositionTimeOffset;return r(O.trun,n)},X=function(track,e){var t,n,header,o,l,i;for(e+=20+8*(o=track.samples||[]).length,header=Y(o,e),(t=new Uint8Array(header.length+8*o.length)).set(header),n=header.length,i=0;i<o.length;i++)l=o[i],t[n++]=(4278190080&l.duration)>>>24,t[n++]=(16711680&l.duration)>>>16,t[n++]=(65280&l.duration)>>>8,t[n++]=255&l.duration,t[n++]=(4278190080&l.size)>>>24,t[n++]=(16711680&l.size)>>>16,t[n++]=(65280&l.size)>>>8,t[n++]=255&l.size;return r(O.trun,t)},D=function(track,e){return"audio"===track.type?X(track,e):K(track,e)};var te,ie,se,ne,re,ae,oe,le,ue={ftyp:h=function(){return r(O.ftyp,P,L,P,R)},mdat:function(data){return r(O.mdat,data)},moof:m,moov:f,initSegment:function(e){var t,n=h(),r=f(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},he=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},de={groupNalsIntoFrames:function(e){var i,t,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,i=0;i<e.length;i++)"access_unit_delimiter_rbsp"===(t=e[i]).nalUnitType?(n.length&&(n.duration=t.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[t]).byteLength=t.data.byteLength,n.pts=t.pts,n.dts=t.dts):("slice_layer_without_partitioning_rbsp_idr"===t.nalUnitType&&(n.keyFrame=!0),n.duration=t.dts-n.dts,n.byteLength+=t.data.byteLength,n.push(t));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},groupFramesIntoGops:function(e){var i,t,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i=0;i<e.length;i++)(t=e[i]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[t]).nalCount=t.length,n.byteLength=t.byteLength,n.pts=t.pts,n.dts=t.dts,n.duration=t.duration):(n.duration+=t.duration,n.nalCount+=t.length,n.byteLength+=t.byteLength,n.push(t));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var n,i,r,o,l,h=t||0,d=[];for(n=0;n<e.length;n++)for(o=e[n],i=0;i<o.length;i++)l=o[i],h+=(r=he(l,h)).size,d.push(r);return d},concatenateNalData:function(e){var t,i,n,r,o,l,h=0,d=e.byteLength,c=e.nalCount,data=new Uint8Array(d+4*c),view=new DataView(data.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(o=r[i],n=0;n<o.length;n++)l=o[n],view.setUint32(h,l.data.byteLength),h+=4,data.set(l.data,h),h+=l.data.byteLength;return data},generateSampleTableForFrame:function(e,t){var n,r=[];return n=he(e,t||0),r.push(n),r},concatenateNalDataForFrame:function(e){var i,t,n=0,r=e.byteLength,o=e.length,data=new Uint8Array(r+4*o),view=new DataView(data.buffer);for(i=0;i<e.length;i++)t=e[i],view.setUint32(n,t.data.byteLength),n+=4,data.set(t.data,n),n+=t.data.byteLength;return data}},ce=[33,16,5,32,164,27],pe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],me=function(e){for(var a=[];e--;)a.push(0);return a},ge=9e4;ae=function(e,t){return ie(re(e,t))},oe=function(e,t){return se(ne(e),t)},le=function(e,t,n){return ne(n?e:e-t)};var fe={ONE_SECOND_IN_TS:ge,secondsToVideoTs:ie=function(e){return e*ge},secondsToAudioTs:se=function(e,t){return e*t},videoTsToSeconds:ne=function(e){return e/ge},audioTsToSeconds:re=function(e,t){return e/t},audioTsToVideoTs:ae,videoTsToAudioTs:oe,metadataTsToSeconds:le},ye=function(){if(!te){var e={96e3:[ce,[227,64],me(154),[56]],88200:[ce,[231],me(170),[56]],64e3:[ce,[248,192],me(240),[56]],48e3:[ce,[255,192],me(268),[55,148,128],me(54),[112]],44100:[ce,[255,192],me(268),[55,163,128],me(84),[112]],32e3:[ce,[255,192],me(268),[55,234],me(226),[112]],24e3:[ce,[255,192],me(268),[55,255,128],me(268),[111,112],me(126),[224]],16e3:[ce,[255,192],me(268),[55,255,128],me(268),[111,255],me(269),[223,108],me(195),[1,192]],12e3:[pe,me(268),[3,127,248],me(268),[6,255,240],me(268),[13,255,224],me(268),[27,253,128],me(259),[56]],11025:[pe,me(268),[3,127,248],me(268),[6,255,240],me(268),[13,255,224],me(268),[27,255,192],me(268),[55,175,128],me(108),[112]],8e3:[pe,me(268),[3,121,16],me(47),[7]]};t=e,te=Object.keys(t).reduce(function(e,n){return e[n]=new Uint8Array(t[n].reduce(function(e,t){return e.concat(t)},[])),e},{})}var t;return te},_e=fe,be={prefixWithSilence:function(track,e,t,n){var r,o,l,i,h,d=0,c=0,m=0;if(e.length&&(r=_e.audioTsToVideoTs(track.baseMediaDecodeTime,track.samplerate),o=Math.ceil(_e.ONE_SECOND_IN_TS/(track.samplerate/1024)),t&&n&&(d=r-Math.max(t,n),m=(c=Math.floor(d/o))*o),!(c<1||m>_e.ONE_SECOND_IN_TS/2))){for((l=ye()[track.samplerate])||(l=e[0].data),i=0;i<c;i++)h=e[0],e.splice(0,0,{data:l,dts:h.dts-o,pts:h.pts-o});return track.baseMediaDecodeTime-=Math.floor(_e.videoTsToAudioTs(m,track.samplerate)),m}},trimAdtsFramesByEarliestDts:function(e,track,t){return track.minSegmentDts>=t?e:(track.minSegmentDts=1/0,e.filter(function(e){return e.dts>=t&&(track.minSegmentDts=Math.min(track.minSegmentDts,e.dts),track.minSegmentPts=track.minSegmentDts,!0)}))},generateSampleTable:function(e){var i,t,n=[];for(i=0;i<e.length;i++)t=e[i],n.push({size:t.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var i,t,n=0,data=new Uint8Array(function(e){var i,t=0;for(i=0;i<e.length;i++)t+=e[i].data.byteLength;return t}(e));for(i=0;i<e.length;i++)t=e[i],data.set(t.data,n),n+=t.data.byteLength;return data}},ve=fe.ONE_SECOND_IN_TS,Te={clearDtsInfo:function(track){delete track.minSegmentDts,delete track.maxSegmentDts,delete track.minSegmentPts,delete track.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(track,e){var t,n=track.minSegmentDts;return e||(n-=track.timelineStartInfo.dts),t=track.timelineStartInfo.baseMediaDecodeTime,t+=n,t=Math.max(0,t),"audio"===track.type&&(t*=track.samplerate/ve,t=Math.floor(t)),t},collectDtsInfo:function(track,data){"number"==typeof data.pts&&(void 0===track.timelineStartInfo.pts&&(track.timelineStartInfo.pts=data.pts),void 0===track.minSegmentPts?track.minSegmentPts=data.pts:track.minSegmentPts=Math.min(track.minSegmentPts,data.pts),void 0===track.maxSegmentPts?track.maxSegmentPts=data.pts:track.maxSegmentPts=Math.max(track.maxSegmentPts,data.pts)),"number"==typeof data.dts&&(void 0===track.timelineStartInfo.dts&&(track.timelineStartInfo.dts=data.dts),void 0===track.minSegmentDts?track.minSegmentDts=data.dts:track.minSegmentDts=Math.min(track.minSegmentDts,data.dts),void 0===track.maxSegmentDts?track.maxSegmentDts=data.dts:track.maxSegmentDts=Math.max(track.maxSegmentDts,data.dts))}},Se={parseSei:function(e){for(var i=0,t={payloadType:-1,payloadSize:0},n=0,r=0;i<e.byteLength&&128!==e[i];){for(;255===e[i];)n+=255,i++;for(n+=e[i++];255===e[i];)r+=255,i++;if(r+=e[i++],!t.payload&&4===n){if("GA94"===String.fromCharCode(e[i+3],e[i+4],e[i+5],e[i+6])){t.payloadType=n,t.payloadSize=r,t.payload=e.subarray(i,i+r);break}t.payload=void 0}i+=r,n=0,r=0}return t},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,data,o=[];if(!(64&t[0]))return o;for(n=31&t[0],i=0;i<n;i++)data={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(data.ccData=t[r+3]<<8|t[r+4],o.push(data));return o},discardEmulationPreventionBytes:function(data){for(var e,t,n=data.byteLength,r=[],i=1;i<n-2;)0===data[i]&&0===data[i+1]&&3===data[i+2]?(r.push(i+2),i+=2):i++;if(0===r.length)return data;e=n-r.length,t=new Uint8Array(e);var o=0;for(i=0;i<e;o++,i++)o===r[0]&&(o++,r.shift()),t[i]=data[o];return t},USER_DATA_REGISTERED_ITU_T_T35:4},Ee=Q,we=Se,Ce=function(e){e=e||{},Ce.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ne(0,0),new Ne(0,1),new Ne(1,0),new Ne(1,1)],this.parse708captions_&&(this.cc708Stream_=new De({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),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")))};Ce.prototype=new Ee,Ce.prototype.push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&(t=we.parseSei(e.escapedRBSP)).payload&&t.payloadType===we.USER_DATA_REGISTERED_ITU_T_T35&&(n=we.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=we.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Ce.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},Ce.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(a,b){return a.pts===b.pts?a.presortIndex-b.presortIndex:a.pts-b.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},Ce.prototype.flush=function(){return this.flushStream("flush")},Ce.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ce.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},Ce.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Ce.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},Ce.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},Ce.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},Ce.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ke={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},xe=function(b){return 32<=b&&b<=127||160<=b&&b<=255},Ie=function(e){this.windowNum=e,this.reset()};Ie.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,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},Ie.prototype.getText=function(){return this.rows.join("\n")},Ie.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ie.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ie.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Ie.prototype.addText=function(text){this.rows[this.rowIdx]+=text},Ie.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Ae=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Ie(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Ae.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Ie(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Ae.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Ae.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var De=function(e){e=e||{},De.prototype.init.call(this);var t,n=this,r=e.captionServices||{},o={};Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(o[e]=t.encoding)}),this.serviceEncodings=o,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};De.prototype=new Ee,De.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},De.prototype.add708Bytes=function(e){var data=e.ccData,t=data>>>8,n=255&data;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t),this.current708Packet.data.push(n)},De.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,b=t[i++];for(e.seq=b>>6,e.sizeCode=63&b;i<t.length;i++)r=31&(b=t[i++]),7===(n=b>>5)&&r>0&&(n=b=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},De.prototype.pushServiceBlock=function(e,t,n){var b,i=t,r=this.current708Packet.data,o=this.services[e];for(o||(o=this.initService(e,i));i<t+n&&i<r.length;i++)b=r[i],xe(b)?i=this.handleText(i,o):24===b?i=this.multiByteCharacter(i,o):16===b?i=this.extendedCommands(i,o):128<=b&&b<=135?i=this.setCurrentWindow(i,o):152<=b&&b<=159?i=this.defineWindow(i,o):136===b?i=this.clearWindows(i,o):140===b?i=this.deleteWindows(i,o):137===b?i=this.displayWindows(i,o):138===b?i=this.hideWindows(i,o):139===b?i=this.toggleWindows(i,o):151===b?i=this.setWindowAttributes(i,o):144===b?i=this.setPenAttributes(i,o):145===b?i=this.setPenColor(i,o):146===b?i=this.setPenLocation(i,o):143===b?o=this.reset(i,o):8===b?o.currentWindow.backspace():12===b?o.currentWindow.clearText():13===b?o.currentWindow.pendingNewLine=!0:14===b?o.currentWindow.clearText():141===b&&i++},De.prototype.extendedCommands=function(i,e){var b=this.current708Packet.data[++i];return xe(b)&&(i=this.handleText(i,e,{isExtended:!0})),i},De.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},De.prototype.initService=function(e,i){var t,n,r=this;return(t="SERVICE"+e)in this.serviceEncodings&&(n=this.serviceEncodings[t]),this.services[e]=new Ae(e,n,r),this.services[e].init(this.getPts(i),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},De.prototype.handleText=function(i,e,t){var n,r,code,o,l=t&&t.isExtended,h=t&&t.isMultiByte,d=this.current708Packet.data,c=l?4096:0,m=d[i],f=d[i+1],y=e.currentWindow;if(h?(r=[m,f],i++):r=[m],e.textDecoder_&&!l)n=e.textDecoder_.decode(new Uint8Array(r));else if(h){const e=r.map(e=>("0"+(255&e).toString(16)).slice(-2)).join("");n=String.fromCharCode(parseInt(e,16))}else o=ke[code=c|m]||code,n=4096&code&&code===o?"":String.fromCharCode(o);return y.pendingNewLine&&!y.isEmpty()&&y.newLine(this.getPts(i)),y.pendingNewLine=!1,y.addText(n),i},De.prototype.multiByteCharacter=function(i,e){var t=this.current708Packet.data,n=t[i+1],r=t[i+2];return xe(n)&&xe(r)&&(i=this.handleText(++i,e,{isMultiByte:!0})),i},De.prototype.setCurrentWindow=function(i,e){var t=7&this.current708Packet.data[i];return e.setCurrentWindow(t),i},De.prototype.defineWindow=function(i,e){var t=this.current708Packet.data,b=t[i],n=7&b;e.setCurrentWindow(n);var r=e.currentWindow;return b=t[++i],r.visible=(32&b)>>5,r.rowLock=(16&b)>>4,r.columnLock=(8&b)>>3,r.priority=7&b,b=t[++i],r.relativePositioning=(128&b)>>7,r.anchorVertical=127&b,b=t[++i],r.anchorHorizontal=b,b=t[++i],r.anchorPoint=(240&b)>>4,r.rowCount=15&b,b=t[++i],r.columnCount=63&b,b=t[++i],r.windowStyle=(56&b)>>3,r.penStyle=7&b,r.virtualRowCount=r.rowCount+1,i},De.prototype.setWindowAttributes=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.winAttr;return b=t[++i],n.fillOpacity=(192&b)>>6,n.fillRed=(48&b)>>4,n.fillGreen=(12&b)>>2,n.fillBlue=3&b,b=t[++i],n.borderType=(192&b)>>6,n.borderRed=(48&b)>>4,n.borderGreen=(12&b)>>2,n.borderBlue=3&b,b=t[++i],n.borderType+=(128&b)>>5,n.wordWrap=(64&b)>>6,n.printDirection=(48&b)>>4,n.scrollDirection=(12&b)>>2,n.justify=3&b,b=t[++i],n.effectSpeed=(240&b)>>4,n.effectDirection=(12&b)>>2,n.displayEffect=3&b,i},De.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},De.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},De.prototype.displayWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<<n&&(e.windows[n].visible=1);return i},De.prototype.hideWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<<n&&(e.windows[n].visible=0);return i},De.prototype.toggleWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<<n&&(e.windows[n].visible^=1);return i},De.prototype.clearWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<<n&&e.windows[n].clearText();return i},De.prototype.deleteWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<<n&&e.windows[n].reset();return i},De.prototype.setPenAttributes=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.penAttr;return b=t[++i],n.textTag=(240&b)>>4,n.offset=(12&b)>>2,n.penSize=3&b,b=t[++i],n.italics=(128&b)>>7,n.underline=(64&b)>>6,n.edgeType=(56&b)>>3,n.fontStyle=7&b,i},De.prototype.setPenColor=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.penColor;return b=t[++i],n.fgOpacity=(192&b)>>6,n.fgRed=(48&b)>>4,n.fgGreen=(12&b)>>2,n.fgBlue=3&b,b=t[++i],n.bgOpacity=(192&b)>>6,n.bgRed=(48&b)>>4,n.bgGreen=(12&b)>>2,n.bgBlue=3&b,b=t[++i],n.edgeRed=(48&b)>>4,n.edgeGreen=(12&b)>>2,n.edgeBlue=3&b,i},De.prototype.setPenLocation=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,b=t[++i],n.row=15&b,b=t[++i],n.column=63&b,i},De.prototype.reset=function(i,e){var t=this.getPts(i);return this.flushDisplayed(t,e),this.initService(e.serviceNum,i)};var Oe={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},Pe=function(code){return null===code?"":(code=Oe[code]||code,String.fromCharCode(code))},Le=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Re=function(){for(var e=[],i=15;i--;)e.push({text:"",indent:0,offset:0});return e},Ne=function(e,t){Ne.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var data,t,n,r,text;if((data=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&data)?this.lastControlCode_=data:data!==this.PADDING_&&(this.lastControlCode_=null),n=data>>>8,r=255&data,data!==this.PADDING_)if(data===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(data===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),t=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=t,this.startPts_=e.pts;else if(data===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(data===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(data===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(data===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(data===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(data===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Re();else if(data===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Re();else if(data===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Re()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))text=Pe((n=(3&n)<<8)|r),this[this.mode_](e.pts,text),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),text=Pe((n=(3&n)<<8)|r),this[this.mode_](e.pts,text),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~r||this.addFormatting(e.pts,["i"]),1&~r||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r)){const e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,r)){var o=Le.indexOf(7968&data);if("rollUp"===this.mode_&&(o-this.rollUpRows_+1<0&&(o=this.rollUpRows_-1),this.setRollUp(e.pts,o)),o!==this.row_&&o>=0&&o<=14&&(this.clearFormatting(e.pts),this.row_=o),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~data)){const e=(14&data)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&(14&~r||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(n)&&(0===r&&(r=null),text=Pe(n),text+=Pe(r),this[this.mode_](e.pts,text),this.column_+=text.length)}else this.lastControlCode_=null}};Ne.prototype=new Ee,Ne.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},content=[];this.displayed_.forEach((e,i)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(i)}e.text.length&&content.push({text:e.text,line:i+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(i)}),content.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:content,stream:this.name_})},Ne.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Re(),this.nonDisplayed_=Re(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ne.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ne.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ne.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ne.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ne.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ne.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ne.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ne.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ne.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Re(),this.displayed_=Re()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ne.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var text=t.reduce(function(text,e){return text+"<"+e+">"},"");this[this.mode_](e,text)},Ne.prototype.clearFormatting=function(e){if(this.formatting_.length){var text=this.formatting_.reverse().reduce(function(text,e){return text+"</"+e+">"},"");this.formatting_=[],this[this.mode_](e,text)}},Ne.prototype.popOn=function(e,text){var t=this.nonDisplayed_[this.row_].text;t+=text,this.nonDisplayed_[this.row_].text=t},Ne.prototype.rollUp=function(e,text){var t=this.displayed_[this.row_].text;t+=text,this.displayed_[this.row_].text=t},Ne.prototype.shiftRowsUp_=function(){var i;for(i=0;i<this.topRow_;i++)this.displayed_[i]={text:"",indent:0,offset:0};for(i=this.row_+1;i<15;i++)this.displayed_[i]={text:"",indent:0,offset:0};for(i=this.topRow_;i<this.row_;i++)this.displayed_[i]=this.displayed_[i+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ne.prototype.paintOn=function(e,text){var t=this.displayed_[this.row_].text;t+=text,this.displayed_[this.row_].text=t};var Me={CaptionStream:Ce,Cea608Stream:Ne,Cea708Stream:De},Ue={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Be=Q,Fe="shared",je=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},qe=function(e){var t,n;qe.prototype.init.call(this),this.type_=e||Fe,this.push=function(data){"metadata"!==data.type?this.type_!==Fe&&data.type!==this.type_||(void 0===n&&(n=data.dts),data.dts=je(data.dts,n),data.pts=je(data.pts,n),t=data.dts,this.trigger("data",data)):this.trigger("data",data)},this.flush=function(){n=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};qe.prototype=new Be;var $e,Ve={TimestampRolloverStream:qe,handleRollover:je},He=(e,element,t)=>{if(!e)return-1;for(var n=t;n<e.length;n++)if(e[n]===element)return n;return-1},ze=He,We=3,Ge=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},Xe=function(e,t,n){return decodeURIComponent(Ge(e,t,n))},Ke=function(e,t,n){return unescape(Ge(e,t,n))},Ye=function(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3]},Qe={APIC:function(e){var t,n,i=1;e.data[0]===We&&((t=ze(e.data,0,i))<0||(e.mimeType=Ke(e.data,i,t),i=t+1,e.pictureType=e.data[i],i++,(n=ze(e.data,0,i))<0||(e.description=Xe(e.data,i,n),i=n+1,"--\x3e"===e.mimeType?e.url=Ke(e.data,i,e.data.length):e.pictureData=e.data.subarray(i,e.data.length))))},"T*":function(e){e.data[0]===We&&(e.value=Xe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===We&&-1!==(t=ze(e.data,0,1))&&(e.description=Xe(e.data,1,t),e.value=Xe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ke(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===We&&-1!==(t=ze(e.data,0,1))&&(e.description=Xe(e.data,1,t),e.url=Ke(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var i;for(i=0;i<e.data.length;i++)if(0===e.data[i]){e.owner=Ke(e.data,0,i);break}e.privateData=e.data.subarray(i+1),e.data=e.privateData}},Je={parseId3Frames:function(data){var e,t=10,n=0,r=[];if(!(data.length<10||data[0]!=="I".charCodeAt(0)||data[1]!=="D".charCodeAt(0)||data[2]!=="3".charCodeAt(0))){n=Ye(data.subarray(6,10)),n+=10,64&data[5]&&(t+=4,t+=Ye(data.subarray(10,14)),n-=Ye(data.subarray(16,20)));do{if((e=Ye(data.subarray(t+4,t+8)))<1)break;var o={id:String.fromCharCode(data[t],data[t+1],data[t+2],data[t+3]),data:data.subarray(t+10,t+e+10)};o.key=o.id,Qe[o.id]?Qe[o.id](o):"T"===o.id[0]?Qe["T*"](o):"W"===o.id[0]&&Qe["W*"](o),r.push(o),t+=10,t+=e}while(t<n);return r}},parseSyncSafeInteger:Ye,frameParsers:Qe},Ze=Ue,et=Je;($e=function(e){var i,t={descriptor:e&&e.descriptor},n=0,r=[],o=0;if($e.prototype.init.call(this),this.dispatchType=Ze.METADATA_STREAM_TYPE.toString(16),t.descriptor)for(i=0;i<t.descriptor.length;i++)this.dispatchType+=("00"+t.descriptor[i].toString(16)).slice(-2);this.push=function(e){var t,l,h,d,i;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(o=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),o+=e.data.byteLength,1===r.length&&(n=et.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(o<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},i=0;i<n;)t.data.set(r[0].data.subarray(0,n-i),i),i+=r[0].data.byteLength,o-=r[0].data.byteLength,r.shift();l=10,64&t.data[5]&&(l+=4,l+=et.parseSyncSafeInteger(t.data.subarray(10,14)),n-=et.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((h=et.parseSyncSafeInteger(t.data.subarray(l+4,l+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((d={id:String.fromCharCode(t.data[l],t.data[l+1],t.data[l+2],t.data[l+3]),data:t.data.subarray(l+10,l+h+10)}).key=d.id,et.frameParsers[d.id]?et.frameParsers[d.id](d):"T"===d.id[0]?et.frameParsers["T*"](d):"W"===d.id[0]&&et.frameParsers["W*"](d),"com.apple.streaming.transportStreamTimestamp"===d.owner){var c=d.data,m=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;m*=4,m+=3&c[7],d.timeStamp=m,void 0===t.pts&&void 0===t.dts&&(t.pts=d.timeStamp,t.dts=d.timeStamp),this.trigger("timestamp",d)}t.frames.push(d),l+=10,l+=h}while(l<n);this.trigger("data",t)}}}).prototype=new Q;var tt,it,st,nt=$e,at=Q,ot=Me,lt=Ue,ut=Ve.TimestampRolloverStream,ht=188;(tt=function(){var e=new Uint8Array(ht),t=0;tt.prototype.init.call(this),this.push=function(n){var r,o=0,l=ht;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;l<r.byteLength;)71!==r[o]||71!==r[l]?(o++,l++):(this.trigger("data",r.subarray(o,l)),o+=ht,l+=ht);o<r.byteLength&&(e.set(r.subarray(o),0),t=r.byteLength-o)},this.flush=function(){t===ht&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new at,it=function(){var e,t,n,r;it.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var o=0;r.payloadUnitStartIndicator&&(o+=e[o]+1),"pat"===r.type?t(e.subarray(o),r):n(e.subarray(o),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,o;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,o=12+((15&e[10])<<8|e[11]);o<n;){var l=e[o],h=(31&e[o+1])<<8|e[o+2];l===lt.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=h:l===lt.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=h:l===lt.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][h]=l),o+=5+((15&e[o+3])<<8|e[o+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
vendor: 3,124 bytes, line 2
2else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=lt.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=lt.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},it.prototype=new at,it.STREAM_TYPES={h264:27,adts:15},st=function(){var e,t=this,n=!1,video={data:[],size:0},audio={data:[],size:0},r={data:[],size:0},o=function(e,n,r){var o,l,h=new Uint8Array(e.size),d={type:n},i=0,c=0;if(e.data.length&&!(e.size<9)){for(d.trackId=e.data[0].pid,i=0;i<e.data.length;i++)l=e.data[i],h.set(l.data,c),c+=l.data.byteLength;!function(e,t){var n;const r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(n=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(h,d),o="video"===n||d.packetLength<=e.size,(r||o)&&(e.size=0,e.data.length=0),o&&t.trigger("data",d)}};st.prototype.init.call(this),this.push=function(data){({pat:function(){},pes:function(){var e,t;switch(data.streamType){case lt.H264_STREAM_TYPE:e=video,t="video";break;case lt.ADTS_STREAM_TYPE:e=audio,t="audio";break;case lt.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}data.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(data),e.size+=data.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=data.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[data.type]()},this.reset=function(){video.size=0,video.data.length=0,audio.size=0,audio.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(video,"video"),o(audio,"audio"),o(r,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}},st.prototype=new at;var ct={PAT_PID:0,MP2T_PACKET_LENGTH:ht,TransportPacketStream:tt,TransportParseStream:it,ElementaryStream:st,TimestampRolloverStream:ut,CaptionStream:ot.CaptionStream,Cea608Stream:ot.Cea608Stream,Cea708Stream:ot.Cea708Stream,MetadataStream:nt};for(var pt in lt)lt.hasOwnProperty(pt)&&(ct[pt]=lt[pt]);var mt,gt=ct,ft=fe.ONE_SECOND_IN_TS,yt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(mt=function(e){var t,n=0;mt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts ski
2ping bytes ${e} to ${t} in frame ${n} outside syncword`})},this.push=function(r){var o,l,h,d,c,i=0;if(e||(n=0),"audio"===r.type){var m;for(t&&t.length?(h=t,(t=new Uint8Array(h.byteLength+r.data.byteLength)).set(h),t.set(r.data,h.byteLength)):t=r.data;i+7<t.length;)if(255===t[i]&&240==(246&t[i+1])){if("number"==typeof m&&(this.skipWarn_(m,i),m=null),l=2*(1&~t[i+1]),o=(3&t[i+3])<<11|t[i+4]<<3|(224&t[i+5])>>5,c=(d=1024*(1+(3&t[i+6])))*ft/yt[(60&t[i+2])>>>2],t.byteLength-i<o)break;this.trigger("data",{pts:r.pts+n*c,dts:r.dts+n*c,sampleCount:d,audioobjecttype:1+(t[i+2]>>>6&3),channelcount:(1&t[i+2])<<2|(192&t[i+3])>>>6,samplerate:yt[(60&t[i+2])>>>2],samplingfrequencyindex:(60&t[i+2])>>>2,samplesize:16,data:t.subarray(i+7+l,i+o)}),n++,i+=o}else"number"!=typeof m&&(m=i),i++;"number"==typeof m&&(this.skipWarn_(m,i),m=null),t=t.subarray(i)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new Q;var _t,bt,vt,Tt=mt,St=Q,Et=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var o=e.byteLength-t,l=new Uint8Array(4),h=Math.min(4,t);if(0===h)throw new Error("no bytes available");l.set(e.subarray(o,o+h)),n=new DataView(l.buffer).getUint32(0),r=8*h,t-=h},this.skipBits=function(e){var o;r>e?(n<<=e,r-=e):(e-=r,e-=8*(o=Math.floor(e/8)),t-=o,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var o=Math.min(r,e),l=n>>>32-o;return(r-=o)>0?n<<=o:t>0&&this.loadWord(),(o=e-o)>0?l<<o|this.readBits(o):l},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(n&2147483648>>>e)return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(bt=function(){var i,e,t=0;bt.prototype.init.call(this),this.push=function(data){var n;e?((n=new Uint8Array(e.byteLength+data.data.byteLength)).set(e),n.set(data.data,e.byteLength),e=n):e=data.data;for(var r=e.byteLength;t<r-3;t++)if(1===e[t+2]){i=t+5;break}for(;i<r;)switch(e[i]){case 0:if(0!==e[i-1]){i+=2;break}if(0!==e[i-2]){i++;break}t+3!==i-2&&this.trigger("data",e.subarray(t+3,i-2));do{i++}while(1!==e[i]&&i<r);t=i-2,i+=3;break;case 1:if(0!==e[i-1]||0!==e[i-2]){i+=3;break}this.trigger("data",e.subarray(t+3,i-2)),t=i-2,i+=3;break;default:i+=3}e=e.subarray(t),i-=t,t=0},this.reset=function(){e=null,t=0,this.trigger("reset")},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(t+3)),e=null,t=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new St,vt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},_t=function(){var e,t,n,r,o,l,h,d=new bt;_t.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,d.push(e))},d.on("data",function(data){var h={trackId:t,pts:n,dts:r,data:data,nalUnitTypeCode:31&data[0]};switch(h.nalUnitTypeCode){case 5:h.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:h.nalUnitType="sei_rbsp",h.escapedRBSP=o(data.subarray(1));break;case 7:h.nalUnitType="seq_parameter_set_rbsp",h.escapedRBSP=o(data.subarray(1)),h.config=l(h.escapedRBSP);break;case 8:h.nalUnitType="pic_parameter_set_rbsp";break;case 9:h.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",h)}),d.on("done",function(){e.trigger("done")}),d.on("partialdone",function(){e.trigger("partialdone")}),d.on("reset",function(){e.trigger("reset")}),d.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},h=function(e,t){var n,r=8,o=8;for(n=0;n<e;n++)0!==o&&(o=(r+t.readExpGolomb()+256)%256),r=0===o?r:o},o=function(data){for(var e,t,n=data.byteLength,r=[],i=1;i<n-2;)0===data[i]&&0===data[i+1]&&3===data[i+2]?(r.push(i+2),i+=2):i++;
vendor: 10,874 bytes, line 2
2if(0===r.length)return data;e=n-r.length,t=new Uint8Array(e);var o=0;for(i=0;i<e;o++,i++)o===r[0]&&(o++,r.shift()),t[i]=data[o];return t},l=function(data){var e,t,n,r,o,l,d,c,m,f,y,i,_=0,v=0,T=0,S=0,E=[1,1];if(t=(e=new Et(data)).readUnsignedByte(),r=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),vt[t]&&(3===(o=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(y=3!==o?8:12,i=0;i<y;i++)e.readBoolean()&&h(i<6?16:64,e);if(e.skipUnsignedExpGolomb(),0===(l=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===l)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),d=e.readUnsignedExpGolomb(),i=0;i<d;i++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),c=e.readUnsignedExpGolomb(),m=e.readUnsignedExpGolomb(),0===(f=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(_=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb(),T=e.readUnsignedExpGolomb(),S=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}E&&(E[0],E[1])}return{profileIdc:t,levelIdc:n,profileCompatibility:r,width:16*(c+1)-2*_-2*v,height:(2-f)*(m+1)*16-2*T-2*S,sarRatio:E}}},_t.prototype=new St;var wt,Ct={H264Stream:_t,NalByteStream:bt},kt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],xt=function(header,e){var t=header[e+6]<<21|header[e+7]<<14|header[e+8]<<7|header[e+9];return t=t>=0?t:0,(16&header[e+5])>>4?t+20:t+10},It=function(data,e){return data.length-e<10||data[e]!=="I".charCodeAt(0)||data[e+1]!=="D".charCodeAt(0)||data[e+2]!=="3".charCodeAt(0)?e:(e+=xt(data,e),It(data,e))},At=function(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3]},Dt=function(e,t,n){return unescape(function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r}(e,t,n))},Ot={isLikelyAacData:function(data){var e=It(data,0);return data.length>=e+2&&!(255&~data[e])&&!(240&~data[e+1])&&16==(22&data[e+1])},parseId3TagSize:xt,parseAdtsSize:function(header,e){var t=(224&header[e+5])>>5,n=header[e+4]<<3;return 6144&header[e+3]|n|t},parseType:function(header,e){return header[e]==="I".charCodeAt(0)&&header[e+1]==="D".charCodeAt(0)&&header[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&header[e]&&!(240&~header[e+1])?"audio":null},parseSampleRate:function(e){for(var i=0;i+5<e.length;){if(255===e[i]&&240==(246&e[i+1]))return kt[(60&e[i+2])>>>2];i++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=At(e.subarray(10,14)));do{if((n=At(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){if("com.apple.streaming.transportStreamTimestamp"===Dt(r,0,i)){var o=r.subarray(i+1),l=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return l*=4,l+=3&o[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null}},Pt=Ot;(wt=function(){var e=new Uint8Array,t=0;wt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,o,l,h,d=0,c=0;for(e.length?(h=e.length,(e=new Uint8Array(n.byteLength+h)).set(e.subarray(0,h)),e.set(n,h)):e=n;e.length-c>=3;)if(e[c]!=="I".charCodeAt(0)||e[c+1]!=="D".charCodeAt(0)||e[c+2]!=="3".charCodeAt(0))if(255&~e[c]||240&~e[c+1])c++;else{if(e.length-c<7)break;if(c+(d=Pt.parseAdtsSize(e,c))>e.length)break;l={type:"audio",data:e.subarray(c,c+d),pts:t,dts:t},this.trigger("data",l),c+=d}else{if(e.length-c<10)break;if(c+(d=Pt.parseId3TagSize(e,c))>e.length)break;o={type:"timed-metadata",data:e.subarray(c,c+d)},this.trigger("data",o),c+=d}r=e.length-c,e=r>0?e.subarray(c):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Q;var Lt,Rt,Nt,Mt,Ut=Q,Bt=ue,Ft=de,jt=be,qt=Te,$t=gt,Vt=fe,Ht=Tt,zt=Ct.H264Stream,Wt=wt,Gt=Ot.isLikelyAacData,Xt=fe.ONE_SECOND_IN_TS,Kt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Yt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Qt=function(e,t){t.stream=e,this.trigger("log",t)},Jt=function(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++){var r=n[i];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",Qt.bind(e,r))}},Zt=function(a,b){var i;if(a.length!==b.length)return!1;for(i=0;i<a.length;i++)if(a[i]!==b[i])return!1;return!0},ei=function(e,t,n,r,o,l){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(o-n)},prependedContentDuration:l,baseMediaDecodeTime:e}};Rt=function(track,e){var t,n=[],r=0,o=0,l=1/0;t=(e=e||{}).firstSequenceNumber||0,Rt.prototype.init.call(this),this.push=function(data){qt.collectDtsInfo(track,data),track&&Kt.forEach(function(e){track[e]=data[e]}),n.push(data)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){l=e},this.setAudioAppendStart=function(e){o=e},this.flush=function(){var h,d,c,m,f,y,_;0!==n.length?(h=jt.trimAdtsFramesByEarliestDts(n,track,r),track.baseMediaDecodeTime=qt.calculateTrackBaseMediaDecodeTime(track,e.keepOriginalTimestamps),_=jt.prefixWithSilence(track,h,o,l),track.samples=jt.generateSampleTable(h),c=Bt.mdat(jt.concatenateFrameData(h)),n=[],d=Bt.moof(t,[track]),m=new Uint8Array(d.byteLength+c.byteLength),t++,m.set(d),m.set(c,d.byteLength),qt.clearDtsInfo(track),f=Math.ceil(1024*Xt/track.samplerate),h.length&&(y=h.length*f,this.trigger("segmentTimingInfo",ei(Vt.audioTsToVideoTs(track.baseMediaDecodeTime,track.samplerate),h[0].dts,h[0].pts,h[0].dts+y,h[0].pts+y,_||0)),this.trigger("timingInfo",{start:h[0].pts,end:h[0].pts+y})),this.trigger("data",{track:track,boxes:m}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){qt.clearDtsInfo(track),n=[],this.trigger("reset")}},Rt.prototype=new Ut,Lt=function(track,e){var t,n,r,o=[],l=[];t=(e=e||{}).firstSequenceNumber||0,Lt.prototype.init.call(this),delete track.minPTS,this.gopCache_=[],this.push=function(e){qt.collectDtsInfo(track,e),"seq_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.config,track.sps=[e.data],Yt.forEach(function(e){track[e]=n[e]},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||r||(r=e.data,track.pps=[e.data]),o.push(e)},this.flush=function(){for(var n,r,h,d,c,m,f,y,_=0;o.length&&"access_unit_delimiter_rbsp"!==o[0].nalUnitType;)o.shift();if(0===o.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=Ft.groupNalsIntoFrames(o),(h=Ft.groupFramesIntoGops(n))[0][0].keyFrame||((r=this.getGopForFusion_(o[0],track))?(_=r.duration,h.unshift(r),h.byteLength+=r.byteLength,h.nalCount+=r.nalCount,h.pts=r.pts,h.dts=r.dts,h.duration+=r.duration):h=Ft.extendFirstKeyFrame(h)),l.length){var v;if(!(v=e.alignGopsAtEnd?this.alignGopsAtEnd_(h):this.alignGopsAtStart_(h)))return this.gopCache_.unshift({gop:h.pop(),pps:track.pps,sps:track.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");qt.clearDtsInfo(track),h=v}qt.collectDtsInfo(track,h),track.samples=Ft.generateSampleTable(h),c=Bt.mdat(Ft.concatenateNalData(h)),track.baseMediaDecodeTime=qt.calculateTrackBaseMediaDecodeTime(track,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",h.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),f=h[0],y=h[h.length-1],this.trigger("segmentTimingInfo",ei(track.baseMediaDecodeTime,f.dts,f.pts,y.dts+y.duration,y.pts+y.duration,_)),this.trigger("timingInfo",{start:h[0].pts,end:h[h.length-1].pts+h[h.length-1].duration}),this.gopCache_.unshift({gop:h.pop(),pps:track.pps,sps:track.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.trigger("baseMediaDecodeTime",track.baseMediaDecodeTime),this.trigger("timelineStartInfo",track.timelineStartInfo),d=Bt.moof(t,[track]),m=new Uint8Array(d.byteLength+c.byteLength),t++,m.set(d),m.set(c,d.byteLength),this.trigger("data",{track:track,boxes:m}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),o=[],this.gopCache_.length=0,l.length=0,this.trigger("reset")},this.resetStream_=function(){qt.clearDtsInfo(track),n=void 0,r=void 0},this.getGopForFusion_=function(e){var t,n,r,o,i,l=1/0;for(i=0;i<this.gopCache_.length;i++)r=(o=this.gopCache_[i]).gop,track.pps&&Zt(track.pps[0],o.pps[0])&&track.sps&&Zt(track.sps[0],o.sps[0])&&(r.dts<track.timelineStartInfo.dts||(t=e.dts-r.dts-r.duration)>=-1e4&&t<=45e3&&(!n||l>t)&&(n=o,l=t));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,o,h,d,c,m;for(h=e.byteLength,d=e.nalCount,c=e.duration,t=n=0;t<l.length&&n<e.length&&(r=l[t],o=e[n],r.pts!==o.pts);)o.pts>r.pts?t++:(n++,h-=o.byteLength,d-=o.nalCount,c-=o.duration);return 0===n?e:n===e.length?null:((m=e.slice(n)).byteLength=h,m.duration=c,m.nalCount=d,m.pts=m[0].pts,m.dts=m[0].dts,m)},this.alignGopsAtEnd_=function(e){var t,n,r,o,h,d,c;for(t=l.length-1,n=e.length-1,h=null,d=!1;t>=0&&n>=0;){if(r=l[t],o=e[n],r.pts===o.pts){d=!0;break}r.pts>o.pts?t--:(t===l.length-1&&(h=n),n--)}if(!d&&null===h)return null;if(0===(c=d?n:h))return e;var m=e.slice(c),f=m.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return m.byteLength=f.byteLength,m.duration=f.duration,m.nalCount=f.nalCount,m.pts=m[0].pts,m.dts=m[0].dts,m},this.alignGopsWith=function(e){l=e}},Lt.prototype=new Ut,Mt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Mt.prototype.init.call(this),this.push=function(output){return output.content||output.text?this.pendingCaptions.push(output):output.frames?this.pendingMetadata.push(output):(this.pendingTracks.push(output.track),this.pendingBytes+=output.boxes.byteLength,"video"===output.track.type&&(this.videoTrack=output.track,this.pendingBoxes.push(output.boxes)),void("audio"===output.track.type&&(this.audioTrack=output.track,this.pendingBoxes.unshift(output.boxes))))}},Mt.prototype=new Ut,Mt.prototype.flush=function(e){var caption,t,n,i,r=0,o={captions:[],captionStream
vendor: 7,133 bytes, line 2
2s:{},metadata:[],info:{}},l=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(l=this.videoTrack.timelineStartInfo.pts,Yt.forEach(function(e){o.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,Kt.forEach(function(e){o.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?o.type=this.pendingTracks[0].type:o.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Bt.initSegment(this.pendingTracks),o.initSegment=new Uint8Array(n.byteLength),o.initSegment.set(n),o.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)o.data.set(this.pendingBoxes[i],r),r+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(caption=this.pendingCaptions[i]).startTime=Vt.metadataTsToSeconds(caption.startPts,l,this.keepOriginalTimestamps),caption.endTime=Vt.metadataTsToSeconds(caption.endPts,l,this.keepOriginalTimestamps),o.captionStreams[caption.stream]=!0,o.captions.push(caption);for(i=0;i<this.pendingMetadata.length;i++)(t=this.pendingMetadata[i]).cueTime=Vt.metadataTsToSeconds(t.pts,l,this.keepOriginalTimestamps),o.metadata.push(t);for(o.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",o),i=0;i<o.captions.length;i++)caption=o.captions[i],this.trigger("caption",caption);for(i=0;i<o.metadata.length;i++)t=o.metadata[i],this.trigger("id3Frame",t)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Mt.prototype.setRemux=function(e){this.remuxTracks=e},(Nt=function(e){var t,n,r=this,o=!0;Nt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var o={};this.transmuxPipeline_=o,o.type="aac",o.metadataStream=new $t.MetadataStream,o.aacStream=new Wt,o.audioTimestampRolloverStream=new $t.TimestampRolloverStream("audio"),o.timedMetadataTimestampRolloverStream=new $t.TimestampRolloverStream("timed-metadata"),o.adtsStream=new Ht,o.coalesceStream=new Mt(e,o.metadataStream),o.headOfPipeline=o.aacStream,o.aacStream.pipe(o.audioTimestampRolloverStream).pipe(o.adtsStream),o.aacStream.pipe(o.timedMetadataTimestampRolloverStream).pipe(o.metadataStream).pipe(o.coalesceStream),o.metadataStream.on("timestamp",function(e){o.aacStream.setTimestamp(e.timeStamp)}),o.aacStream.on("data",function(data){"timed-metadata"!==data.type&&"audio"!==data.type||o.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},o.coalesceStream.numberOfTracks++,o.audioSegmentStream=new Rt(n,e),o.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),o.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),o.adtsStream.pipe(o.audioSegmentStream).pipe(o.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))}),o.coalesceStream.on("data",this.trigger.bind(this,"data")),o.coalesceStream.on("done",this.trigger.bind(this,"done")),Jt(this,o)},this.setupTsPipeline=function(){var o={};this.transmuxPipeline_=o,o.type="ts",o.metadataStream=new $t.MetadataStream,o.packetStream=new $t.TransportPacketStream,o.parseStream=new $t.TransportParseStream,o.elementaryStream=new $t.ElementaryStream,o.timestampRolloverStream=new $t.TimestampRolloverStream,o.adtsStream=new Ht,o.h264Stream=new zt,o.captionStream=new $t.CaptionStream(e),o.coalesceStream=new Mt(e,o.metadataStream),o.headOfPipeline=o.packetStream,o.packetStream.pipe(o.parseStream).pipe(o.elementaryStream).pipe(o.timestampRolloverStream),o.timestampRolloverStream.pipe(o.h264Stream),o.timestampRolloverStream.pipe(o.adtsStream),o.timestampRolloverStream.pipe(o.metadataStream).pipe(o.coalesceStream),o.h264Stream.pipe(o.captionStream).pipe(o.coalesceStream),o.elementaryStream.on("data",function(data){var i;if("metadata"===data.type){for(i=data.tracks.length;i--;)t||"video"!==data.tracks[i].type?n||"audio"!==data.tracks[i].type||((n=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!o.videoSegmentStream&&(o.coalesceStream.numberOfTracks++,o.videoSegmentStream=new Lt(t,e),o.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),o.videoSegmentStream.on("timelineStartInfo",function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,o.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))}),o.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),o.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),o.videoSegmentStream.on("baseMediaDecodeTime",function(e){n&&o.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),o.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),o.h264Stream.pipe(o.videoSegmentStream).pipe(o.coalesceStream)),n&&!o.audioSegmentStream&&(o.coalesceStream.numberOfTracks++,o.audioSegmentStream=new Rt(n,e),o.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),o.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),o.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),o.adtsStream.pipe(o.audioSegmentStream).pipe(o.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}}),o.coalesceStream.on("data",this.trigger.bind(this,"data")),o.coalesceStream.on("id3Frame",function(e){e.dispatchType=o.metadataStream.dispatchType,r.trigger("id3Frame",e)}),o.coalesceStream.on("caption",this.trigger.bind(this,"caption")),o.coalesceStream.on("done",this.trigger.bind(this,"done")),Jt(this,o)},this.setBaseMediaDecodeTime=function(r){var o=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,qt.clearDtsInfo(n),o.audioTimestampRolloverStream&&o.audioTimestampRolloverStream.discontinuity()),t&&(o.videoSegmentStream&&(o.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,qt.clearDtsInfo(t),o.captionStream.reset()),o.timestampRolloverStream&&o.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(data){if(o){var e=Gt(data);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"t
vendor: 13,516 bytes, line 2
2s"===this.transmuxPipeline_.type||this.setupTsPipeline(),o=!1}this.transmuxPipeline_.headOfPipeline.push(data)},this.flush=function(){o=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new Ut;var ti,ii,si={Transmuxer:Nt,VideoSegmentStream:Lt,AudioSegmentStream:Rt,AUDIO_PROPERTIES:Kt,VIDEO_PROPERTIES:Yt,generateSegmentTimingInfo:ei},ni=function(e){return e>>>0},ri=function(e){return("00"+e.toString(16)).slice(-2)},ai=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},oi=ni,ui=ai,hi=function(data,path){var i,e,t,n,r,o=[];if(!path.length)return null;for(i=0;i<data.byteLength;)e=oi(data[i]<<24|data[i+1]<<16|data[i+2]<<8|data[i+3]),t=ui(data.subarray(i+4,i+8)),n=e>1?i+e:data.byteLength,t===path[0]&&(1===path.length?o.push(data.subarray(i+8,n)):(r=hi(data.subarray(i+8,n),path.slice(1))).length&&(o=o.concat(r))),i=n;return o},di=hi,ci=ni,pi=Z.getUint64,mi=function(data){var e={version:data[0],flags:new Uint8Array(data.subarray(1,4))};return 1===e.version?e.baseMediaDecodeTime=pi(data.subarray(4)):e.baseMediaDecodeTime=ci(data[4]<<24|data[5]<<16|data[6]<<8|data[7]),e},gi=function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4)},t=1&e.flags[2],n=2&e.flags[2],r=8&e.flags[2],o=16&e.flags[2],l=32&e.flags[2],h=65536&e.flags[0],d=131072&e.flags[0];return i=8,t&&(i+=4,e.baseDataOffset=view.getUint32(12),i+=4),n&&(e.sampleDescriptionIndex=view.getUint32(i),i+=4),r&&(e.defaultSampleDuration=view.getUint32(i),i+=4),o&&(e.defaultSampleSize=view.getUint32(i),i+=4),l&&(e.defaultSampleFlags=view.getUint32(i)),h&&(e.durationIsEmpty=!0),!t&&d&&(e.baseDataOffsetIsMoof=!0),e},fi=Z.getUint64,yi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},_i=function(data){var e,t={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]},view=new DataView(data.buffer,data.byteOffset,data.byteLength),n=1&t.flags[2],r=4&t.flags[2],o=1&t.flags[1],l=2&t.flags[1],h=4&t.flags[1],d=8&t.flags[1],c=view.getUint32(4),m=8;for(n&&(t.dataOffset=view.getInt32(m),m+=4),r&&c&&(e={flags:yi(data.subarray(m,m+4))},m+=4,o&&(e.duration=view.getUint32(m),m+=4),l&&(e.size=view.getUint32(m),m+=4),d&&(1===t.version?e.compositionTimeOffset=view.getInt32(m):e.compositionTimeOffset=view.getUint32(m),m+=4),t.samples.push(e),c--);c--;)e={},o&&(e.duration=view.getUint32(m),m+=4),l&&(e.size=view.getUint32(m),m+=4),h&&(e.flags=yi(data.subarray(m,m+4)),m+=4),d&&(1===t.version?e.compositionTimeOffset=view.getInt32(m):e.compositionTimeOffset=view.getUint32(m),m+=4),t.samples.push(e);return t},bi=Z.getUint64,vi=function(e){return new Date(1e3*e-20828448e5)},Ti=ai,Si=function(e){var i,t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(i=0;i+4<e.length;i+=t)if(t=n.getUint32(i),i+=4,t<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[i]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[i]&31)}return r},Ei={avc1:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{dataReferenceIndex:view.getUint16(6),width:view.getUint16(24),height:view.getUint16(26),horizresolution:view.getUint16(28)+view.getUint16(30)/16,vertresolution:view.getUint16(32)+view.getUint16(34)/16,frameCount:view.getUint16(40),depth:view.getUint16(74),config:ti(data.subarray(78,data.byteLength))}},avcC:function(data){var e,t,n,i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),r={configurationVersion:data[0],avcProfileIndication:data[1],profileCompatibility:data[2],avcLevelIndication:data[3],lengthSizeMinusOne:3&data[4],sps:[],pps:[]},o=31&data[5];for(n=6,i=0;i<o;i++)t=view.getUint16(n),n+=2,r.sps.push(new Uint8Array(data.subarray(n,n+t))),n+=t;for(e=data[n],n++,i=0;i<e;i++)t=view.getUint16(n),n+=2,r.pps.push(new Uint8Array(data.subarray(n,n+t))),n+=t;return r},btrt:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{bufferSizeDB:view.getUint32(0),maxBitrate:view.getUint32(4),avgBitrate:view.getUint32(8)}},edts:function(data){return{boxes:ti(data)}},elst:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),edits:[]},t=view.getUint32(4);for(i=8;t;t--)0===e.version?(e.edits.push({segmentDuration:view.getUint32(i),mediaTime:view.getInt32(i+4),mediaRate:view.getUint16(i+8)+view.getUint16(i+10)/65536}),i+=12):(e.edits.push({segmentDuration:bi(data.subarray(i)),mediaTime:bi(data.subarray(i+8)),mediaRate:view.getUint16(i+16)+view.getUint16(i+18)/65536}),i+=20);return e},esds:function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),esId:data[6]<<8|data[7],streamPriority:31&data[8],decoderConfig:{objectProfileIndication:data[11],streamType:data[12]>>>2&63,bufferSize:data[13]<<16|data[14]<<8|data[15],maxBitrate:data[16]<<24|data[17]<<16|data[18]<<8|data[19],avgBitrate:data[20]<<24|data[21]<<16|data[22]<<8|data[23],decoderConfigDescriptor:{tag:data[24],length:data[25],audioObjectType:data[26]>>>3&31,samplingFrequencyIndex:(7&data[26])<<1|data[27]>>>7&1,channelConfiguration:data[27]>>>3&15}}}},ftyp:function(data){for(var view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={majorBrand:Ti(data.subarray(0,4)),minorVersion:view.getUint32(4),compatibleBrands:[]},i=8;i<data.byteLength;)e.compatibleBrands.push(Ti(data.subarray(i,i+4))),i+=4;return e},dinf:function(data){return{boxes:ti(data)}},dref:function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),dataReferences:ti(data.subarray(8))}},hdlr:function(data){var e={version:new DataView(data.buffer,data.byteOffset,data.byteLength).getUint8(0),flags:new Uint8Array(data.subarray(1,4)),handlerType:Ti(data.subarray(8,12)),name:""},i=8;for(i=24;i<data.byteLength;i++){if(0===data[i]){i++;break}e.name+=String.fromCharCode(data[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(data){return{byteLength:data.byteLength,nals:Si(data)}},mdhd:function(data){var e,view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,t={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),language:""};return 1===t.version?(i+=4,t.creationTime=vi(view.getUint32(i)),i+=8,t.modificationTime=vi(view.getUint32(i)),i+=4,t.timescale=view.getUint32(i),i+=8,t.duration=view.getUint32(i)):(t.creationTime=vi(view.getUint32(i)),i+=4,t.modificationTime=vi(view.getUint32(i)),i+=4,t.timescale=view.getUint32(i),i+=4,t.duration=view.getUint32(i)),i+=4,e=view.getUint16(i),t.language+=String.fromCharCode(96+(e>>10)),t.language+=String.fromCharCode(96+((992&e)>>5)),t.language+=String.fromCharCode(96+(31&e)),t},mdia:function(data){return{boxes:ti(data)}},mfhd:function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),sequenceNumber:data[4]<<24|data[5]<<16|data[6]<<8|data[7]}},minf:function(data){return{boxes:ti(data)}},mp4a:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={dataReferenceIndex:view.getUint16(6),channelcount:view.getUint16(16),samplesize:view.getUint16(18),samplerate:view.getUint16(24)+view.getUint16(26)/65536};return data.byteLength>28&&(e.streamDescriptor=ti(data.subarray(28))[0]),e},moof:function(data){return{boxes:ti(data)}},moov:function(data){return{boxes:ti(data)}},mvex:function(data){return{boxes:ti(data)}},mvhd:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,e={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4))};return 1===e.version?(i+=4,e.creationTime=vi(view.getUint32(i)),i+=8,e.modificationTime=vi(view.getUint32(i)),i+=4,e.timescale=view.getUint32(i),i+=8,e.duration=view.getUint32(i)):(e.creationTime=vi(view.getUint32(i)),i+=4,e.modificationTime=vi(view.getUint32(i)),i+=4,e.timescale=view.getUint32(i),i+=4,e.duration=view.getUint32(i)),i+=4,e.rate=view.getUint16(i)+view.getUint16(i+2)/16,i+=4,e.volume=view.getUint8(i)+view.getUint8(i+1)/8,i+=2,i+=2,i+=8,e.matrix=new Uint32Array(data.subarray(i,i+36)),i+=36,i+=24,e.nextTrackId=view.getUint32(i),e},pdin:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),rate:view.getUint32(4),initialDelay:view.getUint32(8)}},sdtp:function(data){var i,e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]};for(i=4;i<data.byteLength;i++)e.samples.push({dependsOn:(48&data[i])>>4,isDependedOn:(12&data[i])>>2,hasRedundancy:3&data[i]});return e},sidx:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),references:[],referenceId:view.getUint32(4),timescale:view.getUint32(8)},i=12;0===e.version?(e.earliestPresentationTime=view.getUint32(i),e.firstOffset=view.getUint32(i+4),i+=8):(e.earliestPresentationTime=fi(data.subarray(i)),e.firstOffset=fi(data.subarray(i+8)),i+=16),i+=2;var t=view.getUint16(i);for(i+=2;t>0;i+=12,t--)e.references.push({referenceType:(128&data[i])>>>7,referencedSize:2147483647&view.getUint32(i),subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(128&data[i+8]),sapType:(112&data[i+8])>>>4,sapDeltaTime:268435455&view.getUint32(i+8)});return e},smhd:function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),balance:data[4]+data[5]/256}},stbl:function(data){return{boxes:ti(data)}},ctts:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),compositionOffsets:[]},t=view.getUint32(4);for(i=8;t;i+=8,t--)e.compositionOffsets.push({sampleCount:view.getUint32(i),sampleOffset:view[0===e.version?"getUint32":"getInt32"](i+4)});return e},stss:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4)),syncSamples:[]},t=view.getUint32(4);for(i=8;t;i+=4,t--)e.syncSamples.push(view.getUint32(i));return e},stco:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),chunkOffsets:[]},t=view.getUint32(4);for(i=8;t;i+=4,t--)e.chunkOffsets.push(view.getUint32(i));return e},stsc:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e=view.getUint32(4),t={version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleToChunks:[]};for(i=8;e;i+=12,e--)t.sampleToChunks.push({firstChunk:view.getUint32(i),samplesPerChunk:view.getUint32(i+4),sampleDescriptionIndex:view.getUint32(i+8)});return t},stsd:function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleDescriptions:ti(data.subarray(8))}},stsz:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),sampleSize:view.getUint32(4),entries:[]};for(i=12;i<data.byteLength;i+=4)e.entries.push(view.getUint32(i));return e},stts:function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),timeToSamples:[]},t=view.getUint32(4);for(i=8;t;i+=8,t--)e.timeToSamples.push({sampleCount:view.getUint32(i),sampleDelta:view.getUint32(i+4)});return e},styp:function(data){return Ei.ftyp(data)},tfdt:mi,tfhd:gi,tkhd:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),i=4,e={version:view.getUint8(0),flags:new Uint8Array(data.subarray(1,4))};return 1===e.version?(i+=4,e.creationTime=vi(view.getUint32(i)),i+=8,e.modificationTime=vi(view.getUint32(i)),i+=4,e.trackId=view.getUint32(i),i+=4,i+=8,e.duration=view.getUint32(i)):(e.creationTime=vi(view.getUint32(i)),i+=4,e.modificationTime=vi(view.getUint32(i)),i+=4,e.trackId=view.getUint32(i),i+=4,i+=4,e.duration=view.getUint32(i)),i+=4,i+=8,e.layer=view.getUint16(i),i+=2,e.alternateGroup=view.getUint16(i),i+=2,e.volume=view.getUint8(i)+view.getUint8(i+1)/8,i+=2,i+=2,e.matrix=new Uint32Array(data.subarray(i,i+36)),i+=36,e.width=view.getUint16(i)+view.getUint16(i+2)/65536,i+=4,e.height=view.getUint16(i)+view.getUint16(i+2)/65536,e},traf:function(data){return{boxes:ti(data)}},trak:function(data){return{boxes:ti(data)}},trex:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4),defaultSampleDescriptionIndex:view.getUint32(8),defaultSampleDuration:view.getUint32(12),defaultSampleSize:view.getUint32(16),sampleDependsOn:3&data[20],sampleIsDependedOn:(192&data[21])>>6,sampleHasRedundancy:(48&data[21])>>4,samplePaddingValue:(14&data[21])>>
vendor: 4,316 bytes, line 2
21,sampleIsDifferenceSample:!!(1&data[21]),sampleDegradationPriority:view.getUint16(22)}},trun:_i,"url ":function(data){return{version:data[0],flags:new Uint8Array(data.subarray(1,4))}},vmhd:function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength);return{version:data[0],flags:new Uint8Array(data.subarray(1,4)),graphicsmode:view.getUint16(4),opcolor:new Uint16Array([view.getUint16(6),view.getUint16(8),view.getUint16(10)])}}};ti=function(data){for(var view,e,t,n,r,i=0,o=[],l=new ArrayBuffer(data.length),h=new Uint8Array(l),d=0;d<data.length;++d)h[d]=data[d];for(view=new DataView(l);i<data.byteLength;)e=view.getUint32(i),t=Ti(data.subarray(i+4,i+8)),n=e>1?i+e:data.byteLength,(r=(Ei[t]||function(data){return{data:data}})(data.subarray(i+8,n))).size=e,r.type=t,o.push(r),i=n;return o},ii=function(e,t){var n;return t=t||0,n=new Array(2*t+1).join(" "),e.map(function(e,r){return n+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var r=n+"  "+t+": ",o=e[t];if(o instanceof Uint8Array||o instanceof Uint32Array){var l=Array.prototype.slice.call(new Uint8Array(o.buffer,o.byteOffset,o.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return l?1===l.length?r+"<"+l.join("").slice(1)+">":r+"<\n"+l.map(function(line){return n+"  "+line}).join("\n")+"\n"+n+"  >":r+"<>"}return r+JSON.stringify(o,null,2).split("\n").map(function(line,e){return 0===e?line:n+"  "+line}).join("\n")}).join("\n")+(e.boxes?"\n"+ii(e.boxes,t+1):"")}).join("\n")};var wi,Ci,ki,xi,Ii,Ai,Di,Oi={inspect:ti,textify:ii,parseType:Ti,findBox:di,parseTraf:Ei.traf,parseTfdt:Ei.tfdt,parseHdlr:Ei.hdlr,parseTfhd:Ei.tfhd,parseTrun:Ei.trun,parseSidx:Ei.sidx},Pi=function(data){for(var e=0,t=String.fromCharCode(data[e]),n="";"\0"!==t;)n+=t,e++,t=String.fromCharCode(data[e]);return n+=t},Li=Z.getUint64,Ri=function(e,t){var n="\0"!==t.scheme_id_uri,r=0===e&&Ni(t.presentation_time_delta)&&n,o=1===e&&Ni(t.presentation_time)&&n;return!(e>1)&&r||o},Ni=function(data){return void 0!==data||null!==data},Mi={parseEmsgBox:function(e){var t,n,r,o,l,h,d,c=4,m=e[0];if(0===m)c+=(t=Pi(e.subarray(c))).length,c+=(n=Pi(e.subarray(c))).length,r=(f=new DataView(e.buffer)).getUint32(c),c+=4,l=f.getUint32(c),c+=4,h=f.getUint32(c),c+=4,d=f.getUint32(c),c+=4;else if(1===m){var f;r=(f=new DataView(e.buffer)).getUint32(c),c+=4,o=Li(e.subarray(c)),c+=8,h=f.getUint32(c),c+=4,d=f.getUint32(c),c+=4,c+=(t=Pi(e.subarray(c))).length,c+=(n=Pi(e.subarray(c))).length}var y={scheme_id_uri:t,value:n,timescale:r||1,presentation_time:o,presentation_time_delta:l,event_duration:h,id:d,message_data:new Uint8Array(e.subarray(c,e.byteLength))};return Ri(m,y)?y:void 0},scaleTime:function(e,t,n,r){return e||0===e?e/t:r+n/t}},Ui="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},Bi=ni,Fi=ri,ji=di,qi=ai,$i=Mi,Vi=gi,Hi=_i,zi=mi,Wi=Z.getUint64,Gi=Ui,Xi=Je.parseId3Frames;wi=function(e){return ji(e,["moov","trak"]).reduce(function(e,t){var n,r,o,l,h;return(n=ji(t,["tkhd"])[0])?(r=n[0],l=Bi(n[o=0===r?12:20]<<24|n[o+1]<<16|n[o+2]<<8|n[o+3]),(h=ji(t,["mdia","mdhd"])[0])?(o=0===(r=h[0])?12:20,e[l]=Bi(h[o]<<24|h[o+1]<<16|h[o+2]<<8|h[o+3]),e):null):null},{})},Ci=function(e,t){var n=ji(t,["moof","traf"]).reduce(function(t,n){var r,o=ji(n,["tfhd"])[0],l=Bi(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),h=e[l]||9e4,d=ji(n,["tfdt"])[0],c=new DataView(d.buffer,d.byteOffset,d.byteLength);let m;return"bigint"==typeof(r=1===d[0]?Wi(d.subarray(4,12)):c.getUint32(4))?m=r/Gi.BigInt(h):"number"!=typeof r||isNaN(r)||(m=r/h),m<Number.MAX_SAFE_INTEGER&&(m=Number(m)),m<t&&(t=m),t},1/0);return"bigint"==typeof n||isFinite(n)?n:0},ki=function(e,t){var n,r=ji(t,["moof","traf"]),o=0,l=0;if(r&&r.length){var h=ji(r[0],["tfhd"])[0],d=ji(r[0],["trun"])[0],c=ji(r[0],["tfdt"])[0];if(h)n=Vi(h).trackId;if(c)o=zi(c).baseMediaDecodeTime;if(d){var m=Hi(d);m.samples&&m.samples.length&&(l=m.samples[0].compositionTimeOffset||0)}}var f=e[n]||9e4;"bigint"==typeof o&&(l=Gi.BigInt(l),f=Gi.BigInt(f));var y=(o+l)/f;return"bigint"==typeof y&&y<Number.MAX_SAFE_INTEGER&&(y=Number(y)),y},xi=function(e){var t=ji(e,["moov","trak"]),n=[];return t.forEach(function(e){var t=ji(e,["mdia","hdlr"]),r=ji(e,["tkhd"]);t.forEach(function(e,t){var view,o,l=qi(e.subarray(8,12)),h=r[t];
vendor: 48,916 bytes, line 2
2"vide"===l&&(o=0===(view=new DataView(h.buffer,h.byteOffset,h.byteLength)).getUint8(0)?view.getUint32(12):view.getUint32(20),n.push(o))})}),n},Ai=function(e){var t=0===e[0]?12:20;return Bi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Ii=function(e){var t=ji(e,["moov","trak"]),n=[];return t.forEach(function(e){var view,t,track={},r=ji(e,["tkhd"])[0];r&&(t=(view=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),track.id=0===t?view.getUint32(12):view.getUint32(20));var o=ji(e,["mdia","hdlr"])[0];if(o){var l=qi(o.subarray(8,12));track.type="vide"===l?"video":"soun"===l?"audio":l}var h=ji(e,["mdia","minf","stbl","stsd"])[0];if(h){var d=h.subarray(8);track.codec=qi(d.subarray(4,8));var c,m=ji(d,[track.codec])[0];m&&(/^[asm]vc[1-9]$/i.test(track.codec)?(c=m.subarray(78),"avcC"===qi(c.subarray(4,8))&&c.length>11?(track.codec+=".",track.codec+=Fi(c[9]),track.codec+=Fi(c[10]),track.codec+=Fi(c[11])):track.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(track.codec)?(c=m.subarray(28),"esds"===qi(c.subarray(4,8))&&c.length>20&&0!==c[19]?(track.codec+="."+Fi(c[19]),track.codec+="."+Fi(c[20]>>>2&63).replace(/^0/,"")):track.codec="mp4a.40.2"):track.codec=track.codec.toLowerCase())}var f=ji(e,["mdia","mdhd"])[0];f&&(track.timescale=Ai(f)),n.push(track)}),n},Di=function(e,t=0){return ji(e,["emsg"]).map(data=>{var e=$i.parseEmsgBox(new Uint8Array(data)),n=Xi(e.message_data);return{cueTime:$i.scaleTime(e.presentation_time,e.timescale,e.presentation_time_delta,t),duration:$i.scaleTime(e.event_duration,e.timescale),frames:n}})};var Ki={findBox:ji,parseType:qi,timescale:wi,startTime:Ci,compositionStartTime:ki,videoTrackIds:xi,tracks:Ii,getTimescaleFromMediaHeader:Ai,getEmsgID3:Di};const{parseTrun:Yi}=Oi,{findBox:Qi}=Ki;var Ji=Ui,Zi={getMdatTrafPairs:function(e){var t=Qi(e,["moof","traf"]),n=Qi(e,["mdat"]),r=[];return n.forEach(function(e,n){var o=t[n];r.push({mdat:e,traf:o})}),r},parseSamples:function(e,t,n){var r=t,o=n.defaultSampleDuration||0,l=n.defaultSampleSize||0,h=n.trackId,d=[];return e.forEach(function(e){var t=Yi(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=o),void 0===e.size&&(e.size=l),e.trackId=h,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+Ji.BigInt(e.compositionTimeOffset),r+=Ji.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)}),d=d.concat(t)}),d}},es=Se.discardEmulationPreventionBytes,ts=Me.CaptionStream,is=di,ss=mi,ns=gi,{getMdatTrafPairs:rs,parseSamples:as}=Zi,os=function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(n<r.size)return r;n-=r.size}return null},ls=function(e,t){var n={};return rs(e).forEach(function(e){var r,o=e.mdat,l=e.traf,h=is(l,["tfhd"]),d=ns(h[0]),c=d.trackId,m=is(l,["tfdt"]),f=m.length>0?ss(m[0]).baseMediaDecodeTime:0,y=is(l,["trun"]);t===c&&y.length>0&&(r=function(e,t,n){var r,i,o,l,h=new DataView(e.buffer,e.byteOffset,e.byteLength),d={logs:[],seiNals:[]};for(i=0;i+4<e.length;i+=o)if(o=h.getUint32(i),i+=4,!(o<=0))switch(31&e[i]){case 6:var data=e.subarray(i+1,i+1+o),c=os(i,t);if(r={nalUnitType:"sei_rbsp",size:o,data:data,escapedRBSP:es(data),trackId:n},c)r.pts=c.pts,r.dts=c.dts,l=c;else{if(!l){d.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+i+" for trackId "+n+". See mux.js#223."});break}r.pts=l.pts,r.dts=l.dts}d.seiNals.push(r)}return d}(o,as(y,f,d),c),n[c]||(n[c]={seiNals:[],logs:[]}),n[c].seiNals=n[c].seiNals.concat(r.seiNals),n[c].logs=n[c].logs.concat(r.logs))}),n},us=function(){var e,t,n,r,o,l,h=!1;this.isInitialized=function(){return h},this.init=function(t){e=new ts,h=!0,l=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,o.captions.push(e),o.captionStreams[e.stream]=!0}),e.on("log",function(e){o.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(n!==e[0]||r!==t[n])},this.parse=function(e,l,h){var d;if(!this.isInitialized())return null;if(!l||!h)return null;if(this.isNewInit(l,h))n=l[0],r=h[n];else if(null===n||!r)return t.push(e),null;for(;t.length>0;){var c=t.shift();this.parse(c,l,h)}return d=function(e,t,n){if(null===t)return null;var r=ls(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r),d&&d.logs&&(o.logs=o.logs.concat(d.logs)),null!==d&&d.seiNals?(this.pushNals(d.seiNals),this.flushStream(),o):o.logs.length?{logs:o.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;l?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){o.captions=[],o.captionStreams={},o.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,o?this.clearParsedCaptions():o={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};const{parseTfdt:hs}=Oi,ds=di,{getTimescaleFromMediaHeader:cs}=Ki,{parseSamples:ps,getMdatTrafPairs:ms}=Zi;var gs=function(){let e=9e4;this.init=function(t){const n=ds(t,["moov","trak","mdia","mdhd"])[0];n&&(e=cs(n))},this.parseSegment=function(t){const n=[],r=ms(t);let o=0;return r.forEach(function(t){const r=t.mdat,l=t.traf,h=ds(l,["tfdt"])[0],d=ds(l,["tfhd"])[0],c=ds(l,["trun"]);if(h){const e=hs(h);o=e.baseMediaDecodeTime}if(c.length&&d){const t=ps(c,o,d);let l=0;t.forEach(function(t){const o=new TextDecoder("utf-8"),h=r.slice(l,l+t.size);if(ds(h,["vtte"])[0])return void(l+=t.size);ds(h,["vttc"]).forEach(function(r){const l=ds(r,["payl"])[0],h=ds(r,["sttg"])[0],d=t.pts/e,c=(t.pts+t.duration)/e;let m,f;if(l)try{m=o.decode(l)}catch(e){console.error(e)}if(h)try{f=o.decode(h)}catch(e){console.error(e)}t.duration&&m&&n.push({cueText:m,start:d,end:c,settings:f})}),l+=t.size})}}),n}},fs=Ue,ys=function(e){var t=31&e[1];return t<<=8,t|=e[2]},_s=function(e){return!!(64&e[1])},bs=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},vs=function(e){switch(e){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}},Ts={parseType:function(e,t){var n=ys(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=_s(e),n=4+bs(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=_s(e),r=4+bs(e);if(n&&(r+=e[r]+1),1&e[r+5]){var o;o=3+((15&e[r+1])<<8|e[r+2])-4;for(var l=12+((15&e[r+10])<<8|e[r+11]);l<o;){var i=r+l;t[(31&e[i+1])<<8|e[i+2]]=e[i],l+=5+((15&e[i+3])<<8|e[i+4])}return t}},parsePayloadUnitStartIndicator:_s,parsePesType:function(e,t){switch(t[ys(e)]){case fs.H264_STREAM_TYPE:return"video";case fs.ADTS_STREAM_TYPE:return"audio";case fs.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!_s(e))return null;var t=4+bs(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+bs(e),n=e.subarray(t),r=0,o=0,l=!1;o<n.byteLength-3;o++)if(1===n[o+2]){r=o+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}o+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===vs(31&n[o+3])&&(l=!0);do{r++}while(1!==n[r]&&r<n.length);o=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===vs(31&n[o+3])&&(l=!0),o=r-2,r+=3;break;default:r+=3}return n=n.subarray(o),r-=o,o=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===vs(31&n[o+3])&&(l=!0),l}},Ss=Ue,Es=Ve.handleRollover,ws={};ws.ts=Ts,ws.aac=Ot;var Cs=fe.ONE_SECOND_IN_TS,ks=188,xs=71,Is=function(e,t,n){for(var r,o,l,h,d=0,c=ks,m=!1;c<=e.byteLength;)if(e[d]!==xs||e[c]!==xs&&c!==e.byteLength)d++,c++;else{if(r=e.subarray(d,c),"pes"===ws.ts.parseType(r,t.pid))o=ws.ts.parsePesType(r,t.table),l=ws.ts.parsePayloadUnitStartIndicator(r),"audio"===o&&l&&(h=ws.ts.parsePesTime(r))&&(h.type="audio",n.audio.push(h),m=!0);if(m)break;d+=ks,c+=ks}for(d=(c=e.byteLength)-ks,m=!1;d>=0;)if(e[d]!==xs||e[c]!==xs&&c!==e.byteLength)d--,c--;else{if(r=e.subarray(d,c),"pes"===ws.ts.parseType(r,t.pid))o=ws.ts.parsePesType(r,t.table),l=ws.ts.parsePayloadUnitStartIndicator(r),"audio"===o&&l&&(h=ws.ts.parsePesTime(r))&&(h.type="audio",n.audio.push(h),m=!0);if(m)break;d-=ks,c-=ks}},As=function(e,t,n){for(var r,o,l,h,d,i,c,m=0,f=ks,y=!1,_={data:[],size:0};f<e.byteLength;)if(e[m]!==xs||e[f]!==xs)m++,f++;else{if(r=e.subarray(m,f),"pes"===ws.ts.parseType(r,t.pid))if(o=ws.ts.parsePesType(r,t.table),l=ws.ts.parsePayloadUnitStartIndicator(r),"video"===o&&(l&&!y&&(h=ws.ts.parsePesTime(r))&&(h.type="video",n.video.push(h),y=!0),!n.firstKeyFrame)){if(l&&0!==_.size){for(d=new Uint8Array(_.size),i=0;_.data.length;)c=_.data.shift(),d.set(c,i),i+=c.byteLength;if(ws.ts.videoPacketContainsKeyFrame(d)){var v=ws.ts.parsePesTime(d);v?(n.firstKeyFrame=v,n.firstKeyFrame.type="video"):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.")}_.size=0}_.data.push(r),_.size+=r.byteLength}if(y&&n.firstKeyFrame)break;m+=ks,f+=ks}for(m=(f=e.byteLength)-ks,y=!1;m>=0;)if(e[m]!==xs||e[f]!==xs)m--,f--;else{if(r=e.subarray(m,f),"pes"===ws.ts.parseType(r,t.pid))o=ws.ts.parsePesType(r,t.table),l=ws.ts.parsePayloadUnitStartIndicator(r),"video"===o&&l&&(h=ws.ts.parsePesTime(r))&&(h.type="video",n.video.push(h),y=!0);if(y)break;m-=ks,f-=ks}},Ds=function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,o=ks;o<e.byteLength;)if(e[r]!==xs||e[o]!==xs)r++,o++;else{switch(n=e.subarray(r,o),ws.ts.parseType(n,t.pid)){case"pat":t.pid=ws.ts.parsePat(n);break;case"pmt":var table=ws.ts.parsePmt(n);t.table=t.table||{},Object.keys(table).forEach(function(e){t.table[e]=table[e]})}r+=ks,o+=ks}}(e,t),t.table){if(t.table.hasOwnProperty(r))switch(t.table[r]){case Ss.H264_STREAM_TYPE:n.video=[],As(e,t,n),0===n.video.length&&delete n.video;break;case Ss.ADTS_STREAM_TYPE:n.audio=[],Is(e,t,n),0===n.audio.length&&delete n.audio}}return n},Os=function(e,t){var n;return n=ws.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,o=null,l=null,h=0,d=0;e.length-d>=3;){switch(ws.aac.parseType(e,d)){case"timed-metadata":if(e.length-d<10){n=!0;break}if((h=ws.aac.parseId3TagSize(e,d))>e.length){n=!0;break}null===l&&(t=e.subarray(d,d+h),l=ws.aac.parseAacTimestamp(t)),d+=h;break;case"audio":if(e.length-d<7){n=!0;break}if((h=ws.aac.parseAdtsSize(e,d))>e.length){n=!0;break}null===o&&(t=e.subarray(d,d+h),o=ws.aac.parseSampleRate(t)),r++,d+=h;break;default:d++}if(n)return null}if(null===o||null===l)return null;var c=Cs/o;return{audio:[{type:"audio",dts:l,pts:l},{type:"audio",dts:l+1024*r*c,pts:l+1024*r*c}]}}(e):Ds(e),n&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Es(e.dts,n),e.pts=Es(e.pts,n),e.dtsTime=e.dts/Cs,e.ptsTime=e.pts/Cs})}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=Es(e.dts,r),e.pts=Es(e.pts,r),e.dtsTime=e.dts/Cs,e.ptsTime=e.pts/Cs}),e.firstKeyFrame){var o=e.firstKeyFrame;o.dts=Es(o.dts,r),o.pts=Es(o.pts,r),o.dtsTime=o.dts/Cs,o.ptsTime=o.pts/Cs}}}(n,t),n):null};class Ps{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new si.Transmuxer(this.options),function(e,t){t.on("data",function(t){const n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};const r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on("done",function(data){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){const n={start:{decode:fe.videoTsToSeconds(t.start.dts),presentation:fe.videoTsToSeconds(t.start.pts)},end:{decode:fe.videoTsToSeconds(t.end.dts),presentation:fe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=fe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})}),t.on("audioSegmentTimingInfo",function(t){const n={start:{decode:fe.videoTsToSeconds(t.start.dts),presentation:fe.videoTsToSeconds(t.start.pts)},end:{decode:fe.videoTsToSeconds(t.end.dts),presentation:fe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=fe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(caption){e.postMessage({action:"caption",caption:caption})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:fe.videoTsToSeconds(t.start),end:fe.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:fe.videoTsToSeconds(t.start),end:fe.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}(this.self,this.transmuxer)}pushMp4Captions(data){this.captionParser||(this.captionParser=new us,this.captionParser.init());const e=new Uint8Array(data.data,data.byteOffset,data.byteLength),t=this.captionParser.parse(e,data.trackIds,data.timescales);this.self.postMessage({action:"mp4Captions",captions:t&&t.captions||[],logs:t&&t.logs||[],data:e.buffer},[e.buffer])}initMp4WebVttParser(data){this.webVttParser||(this.webVttParser=new gs);const e=new Uint8Array(data.data,data.byteOffset,data.byteLength);this.webVttParser.init(e)}getMp4WebVttText(data){this.webVttParser||(this.webVttParser=new gs);const e=new Uint8Array(data.data,data.byteOffset,data.byteLength),t=this.webVttParser.parseSegment(e);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:t||[],data:e.buffer},[e.buffer])}probeMp4StartTime({timescales:e,data:data}){const t=Ki.startTime(e,data);this.self.postMessage({action:"probeMp4StartTime",startTime:t,data:data},[data.buffer])}probeMp4Tracks({data:data}){const e=Ki.tracks(data);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:data},[data.buffer])}probeEmsgID3({data:data,offset:e}){const t=Ki.getEmsgID3(data,e);this.self.postMessage({action:"probeEmsgID3",id3Frames:t,emsgData:data},[data.buffer])}probeTs({data:data,baseStartTime:e}){const t="number"!=typeof e||isNaN(e)?void 0:e*fe.ONE_SECOND_IN_TS,n=Os(data,t);let r=null;n&&(r={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},r.hasVideo&&(r.videoStart=n.video[0].ptsTime),r.hasAudio&&(r.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:r,data:data},[data.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(data){const e=new Uint8Array(data.data,data.byteOffset,data.byteLength);this.transmuxer.push(e)}reset(){this.transmuxer.reset()}setTimestampOffset(data){const e=data.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(fe.secondsToVideoTs(e)))}setAudioAppendStart(data){this.transmuxer.setAudioAppendStart(Math.ceil(fe.secondsToVideoTs(data.appendStart)))}setRemux(data){this.transmuxer.setRemux(data.remux)}flush(data){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(data){this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Ps(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Ps(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}));var Na=Oa(Ra);const Ma=e=>{const{transmuxer:t,bytes:n,audioAppendStart:r,gopsToAlignWith:o,remux:l,onData:h,onTrackInfo:d,onAudioTimingInfo:c,onVideoTimingInfo:m,onVideoSegmentTimingInfo:f,onAudioSegmentTimingInfo:y,onId3:_,onCaptions:v,onDone:T,onEndedTimeline:S,onTransmuxerLog:E,isEndOfTimeline:w,segment:C,triggerSegmentEventFn:k}=e,x={buffer:[]};let I=w;if(t.onmessage=n=>{t.currentTransmux===e&&("data"===n.data.action&&((e,t,n)=>{const{type:r,initSegment:o,captions:l,captionStreams:h,metadata:d,videoFrameDtsTime:c,videoFramePtsTime:m}=e.data.segment;t.buffer.push({captions:l,captionStreams:h,metadata:d});const f=e.data.segment.boxes||{data:e.data.segment.data},y={type:r,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};void 0!==c&&(y.videoFrameDtsTime=c),void 0!==m&&(y.videoFramePtsTime=m),n(y)})(n,x,h),"trackinfo"===n.data.action&&d(n.data.trackInfo),"gopInfo"===n.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(n,x),"audioTimingInfo"===n.data.action&&c(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&m(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&f(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&y(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&_([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&v(n.data.caption),"endedtimeline"===n.data.action&&(I=!1,S()),"log"===n.data.action&&E(n.data.log),"transmuxed"===n.data.type&&(I||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:x,callback:T}),Ua(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:Zn.Error.StreamingFailedToTransmuxSegment,segmentInfo:xo({segment:C})}};T(null,e)},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(o)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:o}),void 0!==l&&t.postMessage({action:"setRemux",remux:l}),n.byteLength){const e=n instanceof ArrayBuffer?n:n.buffer,r=n instanceof ArrayBuffer?0:n.byteOffset;k({type:"segmenttransmuxingstart",segment:C}),t.postMessage({action:"push",data:e,byteOffset:r,byteLength:n.byteLength},[e])}w&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Ua=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Ma(e.currentTransmux))},Ba=(e,t)=>{e.postMessage({action:t}),Ua(e)},Fa=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void Ba(t,e);t.transmuxQueue.push(Ba.bind(null,t,e))},ja=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ma(e);e.transmuxer.transmuxQueue.push(e)};var qa=e=>{Fa("reset",e)},$a=e=>{const t=new Na;t.currentTransmux=null,t.transmuxQueue=[];const n=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)),t.postMessage({action:"init",options:e}),t};const Va=function(e){const t=e.transmuxer,n=e.endAction||e.action,r=e.callback,o=_()({},e,{endAction:null,transmuxer:null,callback:null}),l=o=>{o.data.action===n&&(t.removeEventListener("message",l),o.data.data&&(o.data.data=new Uint8Array(o.data.data,e.byteOffset||0,e.byteLength||o.data.data.byteLength),e.data&&(e.data=o.data.data)),r(o.data))};if(t.addEventListener("message",l),e.data){const n=e.data instanceof ArrayBuffer;o.byteOffset=n?0:e.data.byteOffset,o.byteLength=e.data.byteLength;const r=[n?e.data:e.data.buffer];t.postMessage(o,r)}else t.postMessage(o)},Ha=2,za=-101,Wa=-102,Ga="wvtt",Xa=e=>{e.forEach(e=>{e.abort()})},Ka=(e,t)=>{const{requestType:n}=t,r=Wr({requestType:n,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:za,xhr:t,metadata:r}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Wa,xhr:t,metadata:r}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ha,xhr:t,metadata:r}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ha,xhr:t,metadata:r}:null},Ya=(e,t,n,r)=>(o,l)=>{const h=l.response,d=Ka(o,l);if(d)return n(d,e);if(16!==h.byteLength)return n({status:l.status,message:"Invalid HLS key at URL: "+l.uri,code:Ha,xhr:l},e);const view=new DataView(h),c=new Uint32Array([view.getUint32(0),view.getUint32(4),view.getUint32(8),view.getUint32(12)]);for(let i=0;i<t.length;i++)t[i].bytes=c;const m={uri:l.uri};return r({type:"segmentkeyloadcomplete",segment:e,keyInfo:m}),n(null,e)},Qa=(e,t)=>{const n=Object(A.a)(e.map.bytes);if("mp4"!==n){const r=e.map.resolvedUri||e.map.uri,o=n||"unknown";return t({internal:!0,message:`Found unsupported ${o} container for initialization segment at URL: ${r}`,code:Ha,metadata:{mediaType:o}})}Va({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:n,data:data})=>(e.map.bytes=data,n.forEach(function(track){e.map.tracks=e.map.tracks||{},e.map.tracks[track.type]||(e.map.tracks[track.type]=track,"number"==typeof track.id&&track.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[track.id]=track.timescale),"text"===track.type&&((e,t)=>{t===Ga&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})})(e,track.codec))}),t(null))})},Ja=({segment:e,finishProcessingFn:t,responseType:n,triggerSegmentEventFn:r})=>(o,l)=>{const h=Ka(o,l);if(h)return t(h,e);r({type:"segmentloaded",segment:e});const d="arraybuffer"!==n&&l.responseText?(e=>{const view=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)view[i]=e.charCodeAt(i);return view.buffer})(l.responseText.substring(e.lastReachedChar||0)):l.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(l),e.key?e.encryptedBytes=new Uint8Array(d):e.bytes=new Uint8Array(d),t(null,e)},Za=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})=>{const T=e.map&&e.map.tracks||{},S=Boolean(T.audio&&T.video);let E=r.bind(null,e,"audio","start");const w=r.bind(null,e,"audio","end");let C=r.bind(null,e,"video","start");const k=r.bind(null,e,"video","end");Va({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:data=>{e.bytes=t=data.data;const r=data.result;r&&(n(e,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:S}),n=null),ja({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:S,onData:t=>{t.type="combined"===t.type?"video":t.type,f(e,t)},onTrackInfo:t=>{n&&(S&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:e=>{E&&void 0!==e.start&&(E(e.start),E=null),w&&void 0!==e.end&&w(e.end)},onVideoTimingInfo:e=>{C&&void 0!==e.start&&(C(e.start),C=null),k&&void 0!==e.end&&k(e.end)},onVideoSegmentTimingInfo:t=>{const n={pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}};v({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:n}),o(t)},onAudioSegmentTimingInfo:t=>{const n={pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}};v({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:n}),l(t)},onId3:(t,n)=>{h(e,t,n)},onCaptions:t=>{d(e,[t])},isEndOfTimeline:c,onEndedTimeline:()=>{m()},onTransmuxerLog:_,onDone:(t,n)=>{y&&(t.type="combined"===t.type?"video":t.type,v({type:"segmenttransmuxingcomplete",segment:e}),y(n,e,t))},segment:e,triggerSegmentEventFn:v})}})},eo=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})=>{let T=new Uint8Array(t);if(Object(A.b)(T)){e.isFmp4=!0;const{tracks:o}=e.map;if(o.text&&(!o.audio||!o.video))return f(e,{data:T,type:"text"}),void((e,t,n)=>{t===Ga&&Va({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:({data:data,mp4VttCues:t})=>{e.bytes=data,n(null,e,{mp4VttCues:t})}})})(e,o.text.codec,y);const l={isFmp4:!0,hasVideo:!!o.video,hasAudio:!!o.audio};o.audio&&o.audio.codec&&"enca"!==o.audio.codec&&(l.audioCodec=o.audio.codec),o.video&&o.video.codec&&"encv"!==o.video.codec&&(l.videoCodec=o.video.codec),o.video&&o.audio&&(l.isMuxed=!0),n(e,l);const c=(t,n)=>{f(e,{data:T,type:l.hasAudio&&!l.isMuxed?"audio":"video"}),n&&n.length&&h(e,n),t&&t.length&&d(e,t),y(null,e,{})};return void Va({action:"probeMp4StartTime",timescales:e.map.timescales,data:T,transmuxer:e.transmuxer,callback:({data:data,startTime:n})=>{t=data.buffer,e.bytes=T=data,l.hasAudio&&!l.isMuxed&&r(e,"audio","start",n),l.hasVideo&&r(e,"video","start",n),Va({action:"probeEmsgID3",data:T,transmuxer:e.transmuxer,offset:n,callback:({emsgData:n,id3Frames:r})=>{t=n.buffer,e.bytes=T=n,o.video&&n.byteLength&&e.transmuxer?Va({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:T,timescales:e.map.timescales,trackIds:[o.video.id],callback:n=>{t=n.data.buffer,e.bytes=T=n.data,n.logs.forEach(function(e){_(lr(e,{stream:"mp4CaptionParser"}))}),c(n.captions,r)}}):c(void 0,r)}})}})}if(e.transmuxer){if(void 0===e.container&&(e.container=Object(A.a)(T)),"ts"!==e.container&&"aac"!==e.container)return n(e,{hasAudio:!1,hasVideo:!1}),void y(null,e,{});Za({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})}else y(null,e,{})},to=function({id:e,key:t,encryptedBytes:n,decryptionWorker:r,segment:o,doneFn:l},h){const d=t=>{if(t.data.source===e){r.removeEventListener("message",d);const e=t.data.decrypted;h(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let c;r.onerror=()=>{const e="An error occurred in the decryption worker",t=xo({segment:o}),n={message:e,metadata:{error:new Error(e),errorType:Zn.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:o.key.resolvedUri||o.map.key.resolvedUri}}};l(n,o)},r.addEventListener("message",d),c=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(ma({source:e,encrypted:n,key:c,iv:t.iv}),[n.buffer,c.buffer])},io=({activeXhrs:e,decryptionWorker:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})=>{let T=0,S=!1;return(E,w)=>{if(!S){if(E)return S=!0,Xa(e),y(E,w);if(T+=1,T===e.length){const T=function(){if(w.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})=>{v({type:"segmentdecryptionstart"}),to({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:y},e=>{t.bytes=e,v({type:"segmentdecryptioncomplete",segment:t}),eo({segment:t,bytes:t.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})})})({decryptionWorker:t,segment:w,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v});eo({segment:w,bytes:w.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:y,onTransmuxerLog:_,triggerSegmentEventFn:v})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return v({type:"segmentdecryptionstart",segment:w}),to({decryptionWorker:t,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key,segment:w,doneFn:y},t=>{w.map.bytes=t,v({type:"segmentdecryptioncomplete",segment:w}),Qa(w,t=>{if(t)return Xa(e),y(t,w);T()})});T()}}}},so=({segment:e,progressFn:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f})=>n=>{if(!n.target.aborted)return e.stats=lr(e.stats,(e=>{const t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n})(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)},no=({xhr:e,xhrOptions:t,decryptionWorker:n,segment:r,abortFn:o,progressFn:l,trackInfoFn:h,timingInfoFn:d,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:y,isEndOfTimeline:_,endedTimelineFn:v,dataFn:T,doneFn:S,onTransmuxerLog:E,triggerSegmentEventFn:w})=>{const C=[],k=io({activeXhrs:C,decryptionWorker:n,trackInfoFn:h,timingInfoFn:d,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:y,isEndOfTimeline:_,endedTimelineFn:v,dataFn:T,doneFn:S,onTransmuxerLog:E,triggerSegmentEventFn:w});if(r.key&&!r.key.bytes){const n=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&n.push(r.map.key);const o=lr(t,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),l=Ya(r,n,k,w);w({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.key.resolvedUri}});const h=e(o,l);C.push(h)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const n=lr(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),o=Ya(r,[r.map.key],k,w);w({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.map.key.resolvedUri}});const l=e(n,o);C.push(l)}const n=lr(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:ha(r.map),requestType:"segment-media-initialization"}),o=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:n})=>(r,o)=>{const l=Ka(r,o);if(l)return t(l,e);const h=new Uint8Array(o.response);if(n({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=h,t(null,e);e.map.bytes=h,Qa(e,function(n){if(n)return n.xhr=o,n.status=o.status,t(n,e);t(null,e)})})({segment:r,finishProcessingFn:k,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:r});const l=e(n,o);C.push(l)}const x=lr(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:ha(r),requestType:"segment"}),I=Ja({segment:r,finishProcessingFn:k,responseType:x.responseType,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:r});const A=e(x,I);A.addEventListener("progress",so({segment:r,progressFn:l,trackInfoFn:h,timingInfoFn:d,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:y,isEndOfTimeline:_,endedTimelineFn:v,dataFn:T})),C.push(A);const D={};return C.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>n=>{n.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:D,abortFn:o}))}),()=>Xa(C)},ro=or("PlaylistSelector"),ao=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},oo=function(e,t){if(!e)return"";const n=o.a.getComputedStyle(e);return n?n[t]:""},lo=function(e,t){const n=e.slice();e.sort(function(e,r){const o=t(e,r);return 0===o?n.indexOf(e)-n.indexOf(r):o})},uo=function(e,t){let n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||o.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||o.a.Number.MAX_VALUE,n-r};let ho=function(e){const{main:main,bandwidth:t,playerWidth:n,playerHeight:r,playerObjectFit:l,limitRenditionByPlayerDimensions:h,playlistController:d}=e;if(!main)return;const c={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:h};let m=main.playlists;Br.isAudioOnly(main)&&(m=d.getAudioTrackPlaylists_(),c.audioOnly=!0);let f=m.map(e=>{let t;const n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||o.a.Number.MAX_VALUE,{bandwidth:t,width:n,height:r,playlist:e}});lo(f,(e,t)=>e.bandwidth-t.bandwidth),f=f.filter(e=>!Br.isIncompatible(e.playlist));let y=f.filter(e=>Br.isEnabled(e.playlist));y.length||(y=f.filter(e=>!Br.isDisabled(e.playlist)));const _=y.filter(e=>e.bandwidth*Aa.BANDWIDTH_VARIANCE<t);let v=_[_.length-1];const T=_.filter(e=>e.bandwidth===v.bandwidth)[0];if(!1===h){const e=T||y[0]||f[0];if(e&&e.playlist){let t="sortedPlaylistReps";return T&&(t="bandwidthBestRep"),y[0]&&(t="enabledPlaylistReps"),ro(`choosing ${ao(e)} using ${t} with options`,c),e.playlist}return ro("could not choose a playlist with options",c),null}const S=_.filter(e=>e.width&&e.height);lo(S,(e,t)=>e.width-t.width);const E=S.filter(e=>e.width===n&&e.height===r);v=E[E.length-1];const w=E.filter(e=>e.bandwidth===v.bandwidth)[0];let C,k,x,I;if(w||(C=S.filter(e=>"cover"===l?e.width>n&&e.height>r:e.width>n||e.height>r),k=C.filter(e=>e.width===C[0].width&&e.height===C[0].height),v=k[k.length-1],x=k.filter(e=>e.bandwidth===v.bandwidth)[0]),d.leastPixelDiffSelector){const e=S.map(e=>(e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e));lo(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),I=e[0]}const A=I||x||w||T||y[0]||f[0];if(A&&A.playlist){let e="sortedPlaylistReps";return I?e="leastPixelDiffRep":x?e="resolutionPlusOneRep":w?e="resolutionBestRep":T?e="bandwidthBestRep":y[0]&&(e="enabledPlaylistReps"),ro(`choosing ${ao(A)} using ${e} with options`,c),A.playlist}return ro("could not choose a playlist with options",c),null};const co=function(){let e=this.useDevicePixelRatio&&o.a.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),ho({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(oo(this.tech_.el(),"width"),10)*e,playerHeight:parseInt(oo(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?oo(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function po(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const mo=({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t)return;const l=o.a.WebKitDataCue||o.a.VTTCue,h=e.metadataTrack_;if(!h)return;if(t.forEach(e=>{const time=e.cueTime+n;!("number"!=typeof time||o.a.isNaN(time)||time<0)&&time<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{const t=new l(time,time,e.value||e.url||e.data||"");t.frame=e,t.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(Zn.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(Zn.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(Zn.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(t),h.addCue(t)})}),!h.cues||!h.cues.length)return;const d=h.cues,c=[];for(let i=0;i<d.length;i++)d[i]&&c.push(d[i]);const m=c.reduce((e,t)=>{const n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),f=Object.keys(m).sort((a,b)=>Number(a)-Number(b));f.forEach((e,t)=>{const n=m[e],o=isFinite(r)?r:e,l=Number(f[t+1])||o;n.forEach(e=>{e.endTime=l})})},go={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"},fo=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),yo=(e,t,n)=>{e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Zn.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},_o=function(e,t,track){let i,n;if(track&&track.cues)for(i=track.cues.length;i--;)n=track.cues[i],n.startTime>=e&&n.endTime<=t&&track.removeCue(n)},bo=e=>"number"==typeof e&&isFinite(e),vo=1/60,To=e=>{const{startOfSegment:t,duration:n,segment:r,part:o,playlist:{mediaSequence:l,id:h,segments:d=[]},mediaIndex:c,partIndex:m,timeline:f}=e,y=d.length-1;let _="mediaIndex/partIndex increment";e.getMediaInfoForTime?_=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(_="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(_+=` with independent ${e.independent}`);const v="number"==typeof m,T=e.segment.uri?"segment":"pre-segment",S=v?wr({preloadSegment:r})-1:0;return`${T} [${l+c}/${l+y}]`+(v?` part [${m}/${S}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(v?` part start/end [${o.start} => ${o.end}]`:"")+` startOfSegment [${t}]`+` duration [${n}]`+` timeline [${f}]`+` selected by [${_}]`+` playlist [${h}]`},So=e=>`${e}TimingInfo`,Eo=({timelineChangeController:e,currentTimeline:t,segmentTimeline:n,loaderType:r,audioDisabled:o})=>{if(t===n)return!1;if("audio"===r){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==n}if("main"===r&&o){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==n}return!1},wo=e=>{const t=e.pendingSegment_;if(!t)return;if(Eo({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;const t=e.pendingTimelineChange({type:"audio"}),n=e.pendingTimelineChange({type:"main"}),r=t&&n,o=r&&t.to!==n.to;return!(!r||-1===t.from||-1===n.from||!o)})(e.timelineChangeController_)){if((e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),n=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&n&&t.to<n.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},Co=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+dr,ko=(e,t)=>{if("hls"!==t)return null;const n=(e=>{let t=0;return["video","audio"].forEach(function(n){const r=e[`${n}TimingInfo`];if(!r)return;const{start:l,end:h}=r;let d;"bigint"==typeof l||"bigint"==typeof h?d=o.a.BigInt(h)-o.a.BigInt(l):"number"==typeof l&&"number"==typeof h&&(d=h-l),void 0!==d&&d>t&&(t=d)}),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;const r=e.playlist.targetDuration,l=Co({segmentDuration:n,maxDuration:2*r}),h=Co({segmentDuration:n,maxDuration:r}),d=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${n} when the reported duration is ${e.duration} and the target duration is ${r}. 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`;return l||h?{severity:l?"warn":"info",message:d}:null},xo=({type:e,segment:t})=>{if(!t)return;const n=Boolean(t.key||t.map&&t.map.ke),r=Boolean(t.map&&!t.map.bytes),o=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:o,duration:t.duration,isEncrypted:n,isMediaInitialization:r}};class Io extends Zn.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.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",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=or(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():wo(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger(_()({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():wo(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger(_()({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():wo(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():wo(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return $a({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,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_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&o.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state)return this.pendingSegment_&&(this.pendingSegment_=null),void this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){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_=!1,o.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&qa(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ur();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(map,e=!1){if(!map)return null;const t=ga(map);let n=this.initSegments_[t];return e&&!n&&map.bytes&&(this.initSegments_[t]=n={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:map.bytes,tracks:map.tracks,timescales:map.timescales}),n||map}segmentKey(e,t=!1){if(!e)return null;const n=fa(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const o={resolvedUri:(r||e).resolvedUri};return r&&(o.bytes=r.bytes),o}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;if(this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let o=null;if(n&&(n.id?o=n.id:n.uri&&(o=n.uri)),this.logger_(`playlist update [${o} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${_r(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){if(null!==this.mediaIndex){!e.endList&&"number"==typeof e.partTargetDuration?this.resetLoader():this.resyncLoader()}return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}const l=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${l}]`),null!==this.mediaIndex)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=l,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(o.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}
vendor: 11,703 bytes, line 2
2resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&qa(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let o=1;const l=()=>{o--,0===o&&n()};!r&&this.audioDisabled_||(o++,this.sourceUpdater_.removeAudio(e,t,l)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,n,r)=>{const o=Math.ceil((t-r)*D.ONE_SECOND_IN_TS),l=Math.ceil((n-r)*D.ONE_SECOND_IN_TS),h=e.slice();let i=e.length;for(;i--&&!(e[i].pts<=l););if(-1===i)return h;let d=i+1;for(;d--&&!(e[d].pts<=o););return d=Math.max(d,0),h.splice(d,i-d+1),h})(this.gopBuffer_,e,t,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(e,t,l));for(const track in this.inbandTextTracks_)_o(e,t,this.inbandTextTracks_[track]);_o(e,t,this.segmentMetadataTrack_),l()}monitorBuffer_(){this.checkBufferTimeout_&&o.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=o.a.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&o.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=o.a.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:xo({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r="number"==typeof e&&t.segments[e],o=e+1===t.segments.length,l=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&o&&l}chooseNextRequest_(){const e=this.buffered_(),t=_r(e)||0,n=vr(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,o=n>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||r||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const h={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(h.isSyncRequest)h.mediaIndex=function(e,t,n){t=t||[];const r=[];let time=0;for(let i=0;i<t.length;i++){const o=t[i];if(e===o.timeline&&(r.push(i),time+=o.duration,time>n))return i}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,l,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${h.mediaIndex}`);else if(null!==this.mediaIndex){const e=l[this.mediaIndex],n="number"==typeof this.partIndex?this.partIndex:-1;h.startOfSegment=e.end?e.end:t,e.parts&&e.parts[n+1]?(h.mediaIndex=this.mediaIndex,h.partIndex=n+1):h.mediaIndex=this.mediaIndex+1}else{let e,n,r;const o=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${o}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(o);if(!t){const e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:Zn.Error.StreamingFailedToSelectNextSegment,error:new Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,n=t.partIndex,r=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=Br.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:o,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,n=t.partIndex,r=t.startTime}h.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${o}`:`currentTime ${o}`,h.mediaIndex=e,h.startOfSegment=r,h.partIndex=n,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${h.mediaIndex} `)}const d=l[h.mediaIndex];let c=d&&"number"==typeof h.partIndex&&d.parts&&d.parts[h.partIndex];if(!d||"number"==typeof h.partIndex&&!c)return null;"number"!=typeof h.partIndex&&d.parts&&(h.partIndex=0,c=d.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&c&&!m&&!c.independent)if(0===h.partIndex){const e=l[h.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(h.mediaIndex-=1,h.partIndex=e.parts.length-1,h.independent="previous segment")}else d.parts[h.partIndex-1].independent&&(h.partIndex-=1,h.independent="previous part");const f=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return h.mediaIndex>=l.length-1&&f&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,h.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(h))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;const r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:o,isSyncRequest:l,partIndex:h,forceTimestampOffset:d,getMediaInfoForTime:c}=e,m=n.segments[r],f="number"==typeof h&&m.parts[h],y={requestId:"segment-loader-"+Math.random(),uri:f&&f.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:f?h:null,isSyncRequest:l,startOfSegment:o,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:f&&f.duration||m.duration,segment:m,part:f,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},_=void 0!==d?d:this.isPendingTimestampOffset_;y.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:_});const v=_r(this.sourceUpdater_.audioBuffered());return"number"==typeof v&&(y.audioAppendStart=v-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(y.gopsToAlignWith=((e,t,n)=>{if(null==t||!e.length)return[];const r=Math.ceil((t-n+3)*D.ONE_SECOND_IN_TS);let i;for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),y}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:n,buffered:r,overrideCheck:o})=>o||e!==t?e<t?n:r.length?r.end(r.length-1):n:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,o=Br.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),l=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(o<=l)return;const h=function(e){const{main:main,currentTime:t,bandwidth:n,duration:r,segmentDuration:o,timeUntilRebuffer:l,currentTimeline:h,syncController:d}=e,c=main.playlists.filter(e=>!Br.isIncompatible(e));let m=c.filter(Br.isEnabled);m.length||(m=c.filter(e=>!Br.isDisabled(e)));const f=m.filter(Br.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{const c=d.getSyncPoint(e,r,h,t)?1:2;return{playlist:e,rebufferingImpact:Br.estimateSegmentRequestTime(o,n,e)*c-l}}),y=f.filter(e=>e.rebufferingImpact<=0);return lo(y,(a,b)=>uo(b.playlist,a.playlist)),y.length?y[0]:(lo(f,(a,b)=>a.rebufferingImpact-b.rebufferingImpact),f[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!h)return;const d=o-l-h.rebufferingImpact;let c=.5;l<=dr&&(c=1),!h.playlist||h.playlist.uri===this.playlist_.uri||d<c||(this.bandwidth=h.playlist.attributes.BANDWIDTH*Aa.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${To(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:n,hasVideo:r}=t,o={segmentInfo:xo({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:o}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(a,b){if(!a&&!b||!a&&b||a&&!b)return!1;if(a===b)return!0;const e=Object.keys(a).sort(),t=Object.keys(b).sort();if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){const n=e[i];if(n!==t[i])return!1;if(a[n]!==b[n])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():wo(this)))}handleTimingInfo_(e,t,n,time){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const r=this.pendingSegment_,o=So(t);r[o]=r[o]||{},r[o][n]=time,this.logger_(`timinginfo: ${t} - ${n} - ${time}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():wo(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(caption=>{r[caption.stream]=r[caption.stream]||{startTime:1/0,captions:[],endTime:0};const e=r[caption.stream];e.startTime=Math.min(e.startTime,caption.startTime+n),e.endTime=Math.max(e.endTime,caption.endTime+n),e.captions.push(caption)}
vendor: 33,102 bytes, line 2
2),Object.keys(r).forEach(e=>{const{startTime:t,endTime:l,captions:h}=r[e],d=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${l} for ${e}`),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"});let r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);const track=t.textTracks().getTrackById(r);if(track)e[n]=track;else{let label=n,o=n,l=!1;const h=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];h&&(label=h.label,o=h.language,l=h.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:l,label:label,language:o},!1).track}}}(d,this.vhs_.tech_,e),_o(t,l,d[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:n}){if(!t)return;const r=o.a.WebKitDataCue||o.a.VTTCue;t.forEach(caption=>{const track=caption.stream;caption.content?caption.content.forEach(t=>{const o=new r(caption.startTime+n,caption.endTime+n,t.text);o.line=t.line,o.align="left",o.position=t.position,o.positionAlign="line-left",e[track].addCue(o)}):e[track].addCue(new r(caption.startTime+n,caption.endTime+n,caption.text))})}({captionArray:h,inbandTextTracks:d,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(n,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Eo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:o}=t;return!(r&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!o&&!e.audioTimingInfo)&&!Eo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return wo(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[So(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:map,playlist:n}){if(map){const e=ga(map);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(map,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const l=this.sourceUpdater_.audioBuffered(),h=this.sourceUpdater_.videoBuffered();l.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+yr(l).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+yr(h).join(", "));const d=l.length?l.start(0):0,c=l.length?l.end(l.length-1):0,m=h.length?h.start(0):0,f=h.length?h.end(h.length-1):0;if(c-d<=1&&f-m<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${yr(l).join(", ")}, video buffer: ${yr(h).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const y=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=o.a.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(22!==r.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Zn.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:data,bytes:r}){if(!r){const e=[data];let t=data.byteLength;n&&(e.unshift(n),t+=n.byteLength),r=(e=>{let t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,n),n+=e.byteLength})),t})({bytes:t,segments:e})}const o={segmentInfo:xo({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:o}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,o=`${e}TimingInfo`;r[o]||(r[o]={}),r[o].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[o].transmuxedPresentationStart=n.start.presentation,r[o].transmuxedDecodeStart=n.start.decode,r[o].transmuxedPresentationEnd=n.end.presentation,r[o].transmuxedDecodeEnd=n.end.decode,r[o].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:data}=t;if(!data||!data.byteLength)return;if("audio"===n&&this.audioDisabled_)return;const r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:data})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return wo(this),void this.loadQueue_.push(()=>{const t=_()({},e,{forceTimestampOffset:!0});_()(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,o=e.timeline!==this.currentTimeline_&&e.timeline>0,l=n||r&&o;this.logger_(`Requesting\n${po(e.uri)}\n${To(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=no({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:l,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:n,stream:r})=>{this.logger_(`${To(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:n,trackInfo:r,timingInfo:o})=>{const l={segmentInfo:xo({segment:t})};n&&(l.keyInfo=n),r&&(l.trackInfo=r),o&&(l.timingInfo=o),this.trigger({type:e,metadata:l})}})}trimBackBuffer_(e){const t=((e,t,n)=>{let r=t-Aa.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));const o=t-n;return Math.min(o,r)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,o=e.segment.map&&!e.segment.map.bytes,l={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:o},h=e.playlist.segments[e.mediaIndex-1];if(h&&h.timeline===t.timeline&&(h.videoTimingInfo?l.baseStartTime=h.videoTimingInfo.transmuxedDecodeEnd:h.audioTimingInfo&&(l.baseStartTime=h.audioTimingInfo.transmuxedDecodeEnd)),t.key){const n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);l.key=this.segmentKey(t.key),l.key.iv=n}return t.map&&(l.map=this.initSegmentForMap(t.map)),l}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<vo)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`);const n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:n}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,n){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Wa)return;return this.pause(),e.code===za?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=((e,t,n)=>{if(!t.length)return e;if(n)return t.slice();const r=t[0].pts;let i=0;for(;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)})(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:o,useVideoTimingInfo:l,videoTimingInfo:h,audioTimingInfo:d}){if(void 0!==e)return e;if(!l)return d.start;const c=t.segments[n-1];return 0!==n&&c&&void 0!==c.start&&c.end===r+o?h.start:r}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:n,hasVideo:r,isMuxed:o}=t,l="main"===this.loaderType_&&r,h=!this.audioDisabled_&&n&&!o;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);l&&e.waitingOnAppends++,h&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),h&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,n)=>"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"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.":!t.hasVideo&&n.hasVideo?"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.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const e={segmentInfo:xo({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=ko(e,this.sourceType_);if(t&&("warn"===t.severity?Zn.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${To(e)}`);this.logger_(`Appended ${To(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,o=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,l=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(o||l)return this.logger_(`bad ${o?"segment":"part"} ${To(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<vo)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,n=t.start,r=t.end;if(!bo(n)||!bo(r))return;_o(n,r,this.segmentMetadataTrack_);const l=o.a.WebKitDataCue||o.a.VTTCue,h={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},d=new l(n,r,JSON.stringify(h));d.value=h,this.segmentMetadataTrack_.addCue(d)}}function Ao(){}const Do=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},Oo=["video","audio"],Po=(e,t)=>{const n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},Lo=(e,t)=>{if(0===t.queue.length)return;let n=0,r=t.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Po(e,t)){if(r.type!==e){if(n=((e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null})(e,t.queue),null===n)return;r=t.queue[n]}return t.queue.splice(n,1),t.queuePending[e]=r,r.action(e,t),r.doneFn?void 0:(t.queuePending[e]=null,void Lo(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Lo("audio",t),Lo("video",t))},Ro=(e,t)=>{const n=t[`${e}Buffer`],r=Do(e);n&&(n.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),n.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},No=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Mo=(e,t,n)=>(r,o)=>{const l=o[`${r}Buffer`];if(No(o.mediaSource,l)){o.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{l.appendBuffer(e)}catch(e){o.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),o.queuePending[r]=null,n(e)}}},Uo=(e,t)=>(n,r)=>{const o=r[`${n}Buffer`];if(No(r.mediaSource,o)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{o.remove(e,t)}catch(o){r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},Bo=e=>(t,n)=>{const r=n[`${t}Buffer`];No(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},Fo=e=>(t,n)=>{e()},jo=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){Zn.log.warn("Failed to call media source endOfStream",e)}}},qo=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){Zn.log.warn("Failed to set media source duration",e)}},$o=()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const n=t[`${e}Buffer`];if(No(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(t){Zn.log.warn(`Failed to abort on ${e}Buffer`,t)}}},Vo=(e,t)=>n=>{const r=Do(e),o=Object(S.e)(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const l=n.mediaSource.addSourceBuffer(o);l.addEventListener("updateend",n[`on${r}UpdateEnd_`]),l.addEventListener("error",n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=l},Ho=e=>t=>{const n=t[`${e}Buffer`];if(Ro(e,t),No(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(t){Zn.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},zo=e=>(t,n)=>{const r=n[`${t}Buffer`],o=Object(S.e)(e);if(!No(n.mediaSource,r))return;const l=e.substring(0,e.indexOf(".")),h=n.codecs[t];if(h.substring(0,h.indexOf("."))===l)return;const d={codecsChangeInfo:{from:h,to:e}};n.trigger({type:"codecschange",metadata:d}),n.logger_(`changing ${t}Buffer codec from ${h} to ${e}`);try{r.changeType(o),n.codecs[t]=e}catch(e){d.errorType=Zn.Error.StreamingCodecsChangeError,d.error=e,e.metadata=d,n.error_=e,n.trigger("error"),Zn.log.warn(`Failed to changeType on ${t}Buffer`,e)}},Wo=({type:e,sourceUpdater:t,action:n,doneFn:r,name:o})=>{t.queue.push({type:e,action:n,doneFn:r,name:o}),Lo(e,t)},Go=(e,t)=>n=>{const r=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),r=e.end(i);t+=`${n} --\x3e ${r}. Duration (${r-n})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){const n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}Lo(e,t)};class Xo extends Zn.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Lo("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=or("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Go("video",this),this.onAudioUpdateEnd_=Go("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Wo({type:"mediaSource",sourceUpdater:this,action:Vo(e,t),name:"addSourceBuffer"})}abort(e){Wo({type:e,sourceUpdater:this,action:$o(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Wo({type:"mediaSource",sourceUpdater:this,action:Ho(e),name:"removeSourceBuffer"}):Zn.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Zn.browser.IS_FIREFOX&&o.a.MediaSource&&o.a.MediaSource.prototype&&"function"==typeof o.a.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return o.a.SourceBuffer&&o.a.SourceBuffer.prototype&&"function"==typeof o.a.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Wo({type:e,sourceUpdater:this,action:zo(t),name:"changeType"}):Zn.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:o}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${o.length} until video append`);if(Wo({type:r,sourceUpdater:this,action:Mo(o,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return No(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ur()}videoBuffered(){return No(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ur()}buffered(){const video=No(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,audio=No(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return audio&&!video?this.audioBuffered():video&&!audio?this.videoBuffered():function(e,t){let n=null,r=null,o=0;const l=[],h=[];if(!(e&&e.length&&t&&t.length))return ur();let d=e.length;for(;d--;)l.push({time:e.start(d),type:"start"}),l.push({time:e.end(d),type:"end"});for(d=t.length;d--;)l.push({time:t.start(d),type:"start"}),l.push({time:t.end(d),type:"end"});for(l.sort(function(a,b){return a.time-b.time}),d=0;d<l.length;d++)"start"===l[d].type?(o++,2===o&&(n=l[d].time)):"end"===l[d].type&&(o--,1===o&&(r=l[d].time)),null!==n&&null!==r&&(h.push([n,r]),n=null,r=null);return ur(h)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Ao){Wo({type:"mediaSource",sourceUpdater:this,action:qo(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Ao){"string"!=typeof e&&(e=void 0),Wo({type:"mediaSource",sourceUpdater:this,action:jo(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=Ao){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Wo({type:"audio",sourceUpdater:this,action:Uo(e,t),doneFn:n,name:"remove"}):n()}removeVideo(e,t,n=Ao){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Wo({type:"video",sourceUpdater:this,action:Uo(e,t),doneFn:n,name:"remove"}):n()}updating(){return!(!Po("audio",this)&&!Po("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Wo({type:"audio",sourceUpdater:this,action:Bo(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Wo({type:"video",sourceUpdater:this,action:Bo(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Wo({type:"audio",sourceUpdater:this,action:Fo(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Wo({type:"video",sourceUpdater:this,action:Fo(e),name:"callback"})}dispose(){this.trigger("dispose"),Oo.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Ro(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Ko=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Yo=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Qo extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Jo extends Io{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ur();const e=this.subtitlesTrack_.cues;return ur([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(map,e=!1){if(!map)return null;const t=ga(map);let n=this.initSegments_[t];if(e&&!n&&map.bytes){const e=Yo.byteLength+map.bytes.byteLength,r=new Uint8Array(e);r.set(map.bytes),r.set(Yo,map.bytes.byteLength),this.initSegments_[t]=n={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:r}}return n||map}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(track){return void 0===track||(this.subtitlesTrack_=track,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){_o(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===za&&this.handleTimeout_(),e.code===Wa?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_,l=n.mp4VttCues&&n.mp4VttCues.length;l&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const h=r.segment;if(h.map&&(h.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof o.a.WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:"Error loading vtt.js"}));h.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:Zn.Error.StreamingVttParserError,error:e}})}if(l||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=h.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new o.a.VTTCue(e.startTime,e.endTime,e.text):e)}),function(track){const e=track.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const n=e[i],r=`${n.startTime}-${n.endTime}-${n.text}`;t[r]?track.removeCue(n):t[r]=n}}(this.subtitlesTrack_),this.handleAppendsDone_()}
vendor: 7,298 bytes, line 2
2handleData_(e,t){const n=e&&"vtt"===e.type,r=t&&"text"===t.type;n&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{const r=n.start+t,l=n.end+t,h=new o.a.VTTCue(r,l,n.cueText);n.settings&&n.settings.split(" ").forEach(e=>{const t=e.split(":"),n=t[0],r=t[1];h[n]=isNaN(r)?r:Number(r)}),e.cues.push(h)})}parseVTTCues_(e){let t,n=!1;if("function"!=typeof o.a.WebVTT)throw new Qo;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof o.a.TextDecoder?t=new o.a.TextDecoder("utf8"):(t=o.a.WebVTT.StringDecoder(),n=!0);const r=new o.a.WebVTT.Parser(o.a,o.a.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=map=>{e.timestampmap=map},r.onparsingerror=e=>{Zn.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=Ko(t)),r.parse(t)}let l=e.bytes;n&&(l=Ko(l)),r.parse(l),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const{MPEGTS:o,LOCAL:l}=e.timestampmap,h=o/D.ONE_SECOND_IN_TS-l+t.mapping;if(e.cues.forEach(e=>{const n=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+h,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+n,0)}),!n.syncInfo){const t=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,o-r.duration)}}}handleRollover_(e,t){if(null===t)return e;let n=e*D.ONE_SECOND_IN_TS;const r=t*D.ONE_SECOND_IN_TS;let o;for(o=r<n?-8589934592:8589934592;Math.abs(n-r)>4294967296;)n+=o;return n/D.ONE_SECOND_IN_TS}}const Zo=function(track,e){const t=track.cues;for(let i=0;i<t.length;i++){const n=t[i];if(e>=n.adStartTime&&e<=n.adEndTime)return n}return null};class el{constructor({start:e,end:t,segmentIndex:n,partIndex:r=null,appended:o=!1}){this.start_=e,this.end_=t,this.segmentIndex_=n,this.partIndex_=r,this.appended_=o}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}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 tl{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class il{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:n}of this.storage_.values())if(n.length){for(const t of n)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,n){const r=new Map;let o="\n",l=n,h=t;this.start_=l,e.forEach((e,t)=>{const n=this.storage_.get(h),d=l,c=d+e.duration,m=Boolean(n&&n.segmentSyncInfo&&n.segmentSyncInfo.isAppended),f=new el({start:d,end:c,appended:m,segmentIndex:t});e.syncInfo=f;let y=l;const _=(e.parts||[]).map((e,r)=>{const l=y,d=y+e.duration,c=Boolean(n&&n.partsSyncInfo&&n.partsSyncInfo[r]&&n.partsSyncInfo[r].isAppended),m=new el({start:l,end:d,appended:c,segmentIndex:t,partIndex:r});return y=d,o+=`Media Sequence: ${h}.${r} | Range: ${l} --\x3e ${d} | Appended: ${c}\n`,e.syncInfo=m,m});r.set(h,new tl(f,_)),o+=`${po(e.resolvedUri)} | Media Sequence: ${h} | Range: ${d} --\x3e ${c} | Appended: ${m}\n`,h++,l=c}),this.end_=l,this.storage_=r,this.diagnostics_=o}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let o=this.storage_.get(r).segmentSyncInfo.start;for(let i=0;i<n;i++){o-=t[i].duration}return o}return n}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class sl extends il{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){const t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}}const nl=[{name:"VOD",run:(e,t,n,r,o)=>{if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"MediaSequence",run:(e,t,n,r,o,l)=>{const h=e.getMediaSequenceSync(l);if(!h)return null;if(!h.isReliable)return null;const d=h.getSyncInfoForTime(o);return d?{time:d.start,partIndex:d.partIndex,segmentIndex:d.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,n,r,o)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let l=null,h=null;const d=Sr(t);o=o||0;for(let i=0;i<d.length;i++){const n=d[t.endList||0===o?i:d.length-(i+1)],r=n.segment,c=e.timelineToDatetimeMappings[r.timeline];if(!c||!r.dateTimeObject)continue;let m=r.dateTimeObject.getTime()/1e3+c;if(r.parts&&"number"==typeof n.partIndex)for(let e=0;e<n.partIndex;e++)m+=r.parts[e].duration;const f=Math.abs(o-m);if(null!==h&&(0===f||h<f))break;h=f,l={time:m,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return l}},{name:"Segment",run:(e,t,n,r,o)=>{let l=null,h=null;o=o||0;const d=Sr(t);for(let i=0;i<d.length;i++){const e=d[t.endList||0===o?i:d.length-(i+1)],n=e.segment,c=e.part&&e.part.start||n&&n.start;if(n.timeline===r&&void 0!==c){const t=Math.abs(o-c);if(null!==h&&h<t)break;(!l||null===h||h>=t)&&(h=t,l={time:c,segmentIndex:e.segmentIndex,partIndex:e.partIndex})}}return l}},{name:"Discontinuity",run:(e,t,n,r,o)=>{let l=null;if(o=o||0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let i=0;i<t.discontinuityStarts.length;i++){const r=t.discontinuityStarts[i],h=t.discontinuitySequence+i+1,d=e.discontinuities[h];if(d){const e=Math.abs(o-d.time);if(null!==n&&n<e)break;(!l||null===n||n>=e)&&(n=e,l={time:d.time,segmentIndex:r,partIndex:null})}}}return l}},{name:"Playlist",run:(e,t,n,r,o)=>{if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class rl extends Zn.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const main=new il,audio=new sl(main),t=new sl(main);this.mediaSequenceStorage_={main:main,audio:audio,vtt:t},this.logger_=or("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,o){if(t!==1/0){return nl.find(({name:e})=>"VOD"===e).run(this,e,t)}const l=this.runStrategies_(e,t,n,r,o);if(!l.length)return null;for(const t of l){const{syncPoint:n,strategy:o}=t,{segmentIndex:l,time:time}=n;if(l<0)continue;
vendor: 20,857 bytes, line 2
2const h=time,d=h+e.segments[l].duration;if(this.logger_(`Strategy: ${o}. Current time: ${r}. selected segment: ${l}. Time: [${h} -> ${d}]}`),r>=h&&r<d)return this.logger_("Found sync point with exact match: ",n),n}return this.selectSyncPoint_(l,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ir({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,o){const l=[];for(let i=0;i<nl.length;i++){const h=nl[i],d=h.run(this,e,t,n,r,o);d&&(d.strategy=h.name,l.push({strategy:h.name,syncPoint:d}))}return l}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),o=e[0].strategy;for(let i=1;i<e.length;i++){const l=Math.abs(e[i].syncPoint[t.key]-t.value);l<r&&(r=l,n=e[i].syncPoint,o=e[i].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${o}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+("number"==typeof n.partIndex?`,partIndex:${n.partIndex}`:"")+"]"),n}saveExpiredSegmentInfo(e,t){const n=t.mediaSequence-e.mediaSequence;if(n>86400)Zn.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let i=n-1;i>=0;i--){const n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const o=r.dateTimeObject;r.discontinuity&&t&&o&&(this.timelineToDatetimeMappings[r.timeline]=-o.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,o=e.part;let l,h,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${d.time}] [mapping: ${d.mapping}]`)),l=e.startOfSegment,h=t.end+d.mapping;else{if(!d)return!1;l=t.start+d.mapping,h=t.end+d.mapping}return o&&(o.start=l,o.end=h),(!r.start||l<r.start)&&(r.start=l),r.end=h,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let i=0;i<t.discontinuityStarts.length;i++){const r=t.discontinuityStarts[i],o=t.discontinuitySequence+i+1,l=r-e.mediaIndex,h=Math.abs(l);if(!this.discontinuities[o]||this.discontinuities[o].accuracy>h){let time;time=l<0?n.start-Ir({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+Ir({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[o]={time:time,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class al extends Zn.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return"number"==typeof t&&"number"==typeof n&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if("number"==typeof t&&"number"==typeof n){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ll=Pa(La(function(){var t=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),o=t.length,l=0;l<o;++l)t[l].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(data){e.push(data)})},e}();let n=null;class r{constructor(e){let i,t,r;n||(n=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],o=n[4];let i,l,h;const d=[],th=[];let c,m,f,s,y,_;for(i=0;i<256;i++)th[(d[i]=i<<1^283*(i>>7))^i]=i;for(l=h=0;!r[l];l^=c||1,h=th[h]||1)for(s=h^h<<1^h<<2^h<<3^h<<4,s=s>>8^255&s^99,r[l]=s,o[s]=l,f=d[m=d[c=d[l]]],_=16843009*f^65537*m^257*c^16843008*l,y=257*d[s]^16843008*s,i=0;i<4;i++)t[i][l]=y=y<<24^y>>>8,n[i][s]=_=_<<24^_>>>8;for(i=0;i<5;i++)t[i]=t[i].slice(0),n[i]=n[i].slice(0);return e}()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];const o=this._tables[0][4],l=this._tables[1],h=e.length;let d=1;if(4!==h&&6!==h&&8!==h)throw new Error("Invalid aes key size");const c=e.slice(0),m=[];for(this._key=[c,m],i=h;i<4*h+28;i++)r=c[i-1],(i%h===0||8===h&&i%h===4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%h===0&&(r=r<<8^r>>>24^d<<24,d=d<<1^283*(d>>7))),c[i]=c[i-h]^r;for(t=0;i;t++,i--)r=c[3&t?i:i-4],m[t]=i<=4||t<4?r:l[0][o[r>>>24]]^l[1][o[r>>16&255]]^l[2][o[r>>8&255]]^l[3][o[255&r]]}decrypt(e,t,n,r,o,l){const h=this._key[1];let d,c,m,a=e^h[0],b=r^h[1],f=n^h[2],y=t^h[3];const _=h.length/4-2;let i,v=4;const table=this._tables[1],T=table[0],S=table[1],E=table[2],w=table[3],C=table[4];for(i=0;i<_;i++)d=T[a>>>24]^S[b>>16&255]^E[f>>8&255]^w[255&y]^h[v],c=T[b>>>24]^S[f>>16&255]^E[y>>8&255]^w[255&a]^h[v+1],m=T[f>>>24]^S[y>>16&255]^E[a>>8&255]^w[255&b]^h[v+2],y=T[y>>>24]^S[a>>16&255]^E[b>>8&255]^w[255&f]^h[v+3],v+=4,a=d,b=c,f=m;for(i=0;i<4;i++)o[(3&-i)+l]=C[a>>>24]<<24^C[b>>16&255]<<16^C[f>>8&255]<<8^C[255&y]^h[v++],d=a,a=b,b=f,f=y,y=d}}class o extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const l=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class h{constructor(e,t,n,r){const d=h.STEP,c=new Int32Array(e.buffer),m=new Uint8Array(e.byteLength);let i=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(c.subarray(i,i+d),t,n,m)),i=d;i<c.length;i+=d)n=new Uint32Array([l(c[i-4]),l(c[i-3]),l(c[i-2]),l(c[i-1])]),this.asyncStream_.push(this.decryptChunk_(c.subarray(i,i+d),t,n,m));this.asyncStream_.push(function(){var e;r(null,(e=m).subarray(0,e.byteLength-e[e.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,n,o){return function(){const h=function(e,t,n){const o=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),h=new r(Array.prototype.slice.call(t)),d=new Uint8Array(e.byteLength),c=new Int32Array(d.buffer);let m,f,y,_,v,T,S,E,w;for(m=n[0],f=n[1],y=n[2],_=n[3],w=0;w<o.length;w+=4)v=l(o[w]),T=l(o[w+1]),S=l(o[w+2]),E=l(o[w+3]),h.decrypt(v,T,S,E,c,w),c[w]=l(c[w]^m),c[w+1]=l(c[w+1]^f),c[w+2]=l(c[w+2]^y),c[w+3]=l(c[w+3]^_),m=v,f=T,y=S,_=E;return d}(e,t,n);o.set(h,e.byteOffset)}}}var d,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};d="undefined"!=typeof window?window:void 0!==c?c:"undefined"!=typeof self?self:{};var a,b,m=d.BigInt||Number;m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000"),a=new Uint16Array([65484]),255===(b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength))[0]||b[0];const f=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];var o;o=r,("function"===ArrayBuffer.isView?ArrayBuffer.isView(o):o&&o.buffer instanceof ArrayBuffer)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t};self.onmessage=function(e){const data=e.data,t=new Uint8Array(data.encrypted.bytes,data.encrypted.byteOffset,data.encrypted.byteLength),n=new Uint32Array(data.key.bytes,data.key.byteOffset,data.key.byteLength/4),r=new Uint32Array(data.iv.bytes,data.iv.byteOffset,data.iv.byteLength/4);new h(t,n,r,function(e,t){self.postMessage(f({source:data.source,decrypted:t}),[t.buffer])})}}));var hl=Oa(ll);const cl=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},pl=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},ml=(e,t)=>{t.activePlaylistLoader=e,e.load()},gl={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:n},excludePlaylist:r}=t,o=n.activeTrack(),l=n.activeGroup(),h=(l.filter(e=>e.default)[0]||l[0]).id,d=n.tracks[h];if(o!==d){Zn.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in n.tracks)n.tracks[e].enabled=n.tracks[e]===d;n.onTrackChanged()}else r({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:n}}=t;Zn.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const track=n.activeTrack();track&&(track.mode="disabled"),n.onTrackChanged()}},fl={AUDIO:(e,t,n)=>{if(!t)return;const{tech:r,requestOptions:o,segmentLoaders:{[e]:l}}=n;t.on("loadedmetadata",()=>{const e=t.media();l.playlist(e,o),(!r.paused()||e.endList&&"none"!==r.preload())&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),o),r.paused()||l.load()}),t.on("error",gl[e](e,n))},SUBTITLES:(e,t,n)=>{const{tech:r,requestOptions:o,segmentLoaders:{[e]:l},mediaTypes:{[e]:h}}=n;t.on("loadedmetadata",()=>{const e=t.media();l.playlist(e,o),l.track(h.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),o),r.paused()||l.load()}),t.on("error",gl[e](e,n))}},yl={AUDIO:(e,t)=>{const{vhs:n,sourceType:r,segmentLoaders:{[e]:o},requestOptions:l,main:{mediaGroups:h},mediaTypes:{[e]:{groups:d,tracks:c,logger_:m}},mainPlaylistLoader:f}=t,y=Ur(f.main);h[e]&&0!==Object.keys(h[e]).length||(h[e]={main:{default:{default:!0}}},y&&(h[e].main.default.playlists=f.main.playlists));for(const o in h[e]){d[o]||(d[o]=[]);for(const _ in h[e][o]){let v,T=h[e][o][_];if(y?(m(`AUDIO group '${o}' label '${_}' is a main playlist`),T.isMainPlaylist=!0,v=null):v="vhs-json"===r&&T.playlists?new oa(T.playlists[0],n,l):T.resolvedUri?new oa(T.resolvedUri,n,l):T.playlists&&"dash"===r?new Ia(T.playlists[0],n,l,f):null,T=lr({id:_,playlistLoader:v},T),fl[e](e,T.playlistLoader,t),d[o].push(T),void 0===c[_]){const track=new Zn.AudioTrack({id:_,kind:cl(T),enabled:!1,language:T.language,default:T.default,label:_});c[_]=track}}}o.on("error",gl[e](e,t))},SUBTITLES:(e,t)=>{const{tech:n,vhs:r,sourceType:o,segmentLoaders:{[e]:l},requestOptions:h,main:{mediaGroups:d},mediaTypes:{[e]:{groups:c,tracks:m}},mainPlaylistLoader:f}=t;for(const l in d[e]){c[l]||(c[l]=[]);for(const y in d[e][l]){if(!r.options_.useForcedSubtitles&&d[e][l][y].forced)continue;let _,v=d[e][l][y];if("hls"===o)_=new oa(v.resolvedUri,r,h);else if("dash"===o){if(!v.playlists.filter(p=>p.excludeUntil!==1/0).length)return;_=new Ia(v.playlists[0],r,h,f)}else"vhs-json"===o&&(_=new oa(v.playlists?v.playlists[0]:v.resolvedUri,r,h));if(v=lr({id:y,playlistLoader:_},v),fl[e](e,v.playlistLoader,t),c[l].push(v),void 0===m[y]){const track=n.addRemoteTextTrack({id:y,kind:"subtitles",default:v.default&&v.autoselect,language:v.language,label:y},!1).track;m[y]=track}}}l.on("error",gl[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:o,tracks:l}}}=t;for(const t in r[e]){o[t]||(o[t]=[]);for(const h in r[e][t]){const d=r[e][t][h];if(!/^(?:CC|SERVICE)/.test(d.instreamId))continue;const c=n.options_.vhs&&n.options_.vhs.captionServices||{};let m={label:h,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(c[m.instreamId]&&(m=lr(m,c[m.instreamId])),void 0===m.default&&delete m.default,o[t].push(lr({id:h},d)),void 0===l[h]){const track=n.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;l[h]=track}}}}},_l=(e,t)=>{for(let i=0;i<e.length;i++){if(Nr(t,e[i]))return!0;if(e[i].playlists&&_l(e[i].playlists,t))return!0}return!1},bl={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if("showing"===n[e].mode||"hidden"===n[e].mode)return n[e];return null}},vl=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{yl[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:o,segmentLoaders:{AUDIO:l,main:h}}=e;["AUDIO","SUBTITLES"].forEach(n=>{t[n].activeGroup=((e,t)=>track=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:r}}}=t,o=n.media();if(!o)return null;let l=null;o.attributes[e]&&(l=r[o.attributes[e]]);const h=Object.keys(r);if(!l)if("AUDIO"===e&&h.length>1&&Ur(t.main))for(let i=0;i<h.length;i++){const e=r[h[i]];if(_l(e,o)){l=e;break}}else r.main?l=r.main:1===h.length&&(l=r[h[0]]);return void 0===track?l:null!==track&&l&&l.filter(e=>e.id===track.id)[0]||null})(n,e),t[n].activeTrack=bl[n](n,e),t[n].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:o}}=t,l=o.activeTrack(),h=o.getActiveGroup(),d=o.activePlaylistLoader,c=o.lastGroup_;h&&c&&h.id===c.id||(o.lastGroup_=h,o.lastTrack_=l,pl(n,o),h&&!h.isMainPlaylist&&(h.playlistLoader?(n.resyncLoader(),ml(h.playlistLoader,o)):d&&r.resetEverything()))})(n,e),t[n].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()})(n,e),t[n].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:o},mediaTypes:{[e]:l}}=t,h=l.activeTrack(),d=l.getActiveGroup(),c=l.activePlaylistLoader,m=l.lastTrack_;if((!m||!h||m.id!==h.id)&&(l.lastGroup_=d,l.lastTrack_=h,pl(r,l),d)){if(d.isMainPlaylist){if(!h||!m||h.id===m.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return l.logger_(`track change. Switching main audio from ${m.id} to ${h.id}`),n.pause(),o.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!d.playlistLoader)return o.setAudio(!0),void o.resetEverything();r.setAudio(!0),o.setAudio(!1)}c!==d.playlistLoader?(r.track&&r.track(h),r.resetEverything(),ml(d.playlistLoader,l)):ml(d.playlistLoader,l)}})(n,e),t[n].getActiveGroup=((e,{mediaTypes:t})=>()=>{const n=t[e].activeTrack();return n?t[e].activeGroup(n):null})(n,e)});const d=t.AUDIO.activeGroup();if(d){const e=(d.filter(e=>e.default)[0]||d[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();t.AUDIO.getActiveGroup().playlistLoader?(h.setAudio(!1),l.setAudio(!0)):h.setAudio(!0)}n.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),n.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const c=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",c),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),o.on("dispose",()=>{r.audioTracks().removeEventListener("change",c),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])};class Tl{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=rr(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}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 Sl extends Zn.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Tl,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_=or("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const n=t.serverUri||t.serverURL;if(!n)return this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),void this.trigger("error");n.startsWith("data:")?this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1)):(this.steeringManifest.reloadUri=rr(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const n=e?t:this.getRequestURI(t);if(!n)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const r={contentSteeringInfo:{uri:n}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:n,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),void this.excludedSteeringManifestURLs.add(n);if(429===t.status){const n=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),void this.startTTLTimeout_(parseInt(n,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let o;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{o=JSON.parse(this.request_.responseText)}catch(e){const t={errorType:Zn.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new o.a.URL(e),n=new o.a.URL(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const t=JSON.parse(o.a.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new o.a.URL(e),path=this.getPathway(),n=this.getBandwidth_();if(path){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,path)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for c
2ontent steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const path of e)if(this.availablePathways_.has(path))return path;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const n=this.setProxyServerUrl_(e);if(!t(n))return n}const n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=o.a.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){o.a.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){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 Tl}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(rr(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let El;const wl=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Cl=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class kl extends Zn.EventTarget{constructor(e){super(),this.fastQualityChange_=((e,t)=>{let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(null,r)},t)}})(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:n,tech:r,bandwidth:l,externVhs:h,useCueTags:d,playlistExclusionDuration:c,enableLowInitialPlaylist:m,sourceType:f,cacheEncryptionKeys:y,bufferBasedABR:_,leastPixelDiffSelector:v,captionServices:T,experimentalUseMMS:S}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:E}=e;null==E&&(E=1/0),El=h,this.bufferBasedABR=Boolean(_),this.leastPixelDiffSelector=Boolean(v),this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=f,this.useCueTags_=d,this.playlistExclusionDuration=c,this.maxPlaylistRetries=E,this.enableLowInitialPlaylist=m,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:E,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ao,activeTrack:Ao,getActiveGroup:Ao,onGroupChanged:Ao,onTrackChanged:Ao,lastTrack_:null,logger_:or(`MediaGroups[${t}]`)}}),e})(),S&&o.a.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new o.a.ManagedMediaSource,this.usingManagedMediaSource_=!0,Zn.log("Using ManagedMediaSource")):o.a.MediaSource&&(this.mediaSource=new o.a.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=ur(),this.hasPlayed_=!1,this.syncController_=new rl(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new hl,this.sourceUpdater_=new Xo(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new al,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:T,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:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Ia(t,this.vhs_,lr(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new oa(t,this.vhs_,lr(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Io(lr(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Io(lr(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Jo(lr(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>
vendor: 8,767 bytes, line 2
2{function n(){r.off("vttjserror",o),e()}function o(){r.off("vttjsloaded",n),t()}r.one("vttjsloaded",n),r.one("vttjserror",o),r.addWebVttScript_()})}),e);this.contentSteeringController_=new Sl(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),wl.forEach(e=>{this[e+"_"]=Cl.bind(this,e)}),this.logger_=or("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const C="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(C,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const main=this.mainAppendsToLoadedData_(),audio=this.audioAppendsToLoadedData_();return-1===main||-1===audio?-1:main+audio}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),o=r&&(r.id||r.uri),l=e&&(e.id||e.uri);if(o&&o!==l){this.logger_(`switch media ${o} -> ${l} from ${t}`);const n={renditionInfo:{id:l,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:n}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const t=(n.length?n[0].playlists:n.playlists).filter(p=>p.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=o.a.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(o.a.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const main=this.main(),e=main&&main.playlists||[];if(!main||!main.mediaGroups||!main.mediaGroups.AUDIO)return e;const t=main.mediaGroups.AUDIO,n=Object.keys(t);let track;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)track=this.mediaTypes_.AUDIO.activeTrack();else{const e=t.main||n.length&&t[n[0]];for(const label in e)if(e[label].default){track={label:label};break}}if(!track)return e;const r=[];for(const e in t)if(t[e][track.label]){const n=t[e][track.label];if(n.playlists&&n.playlists.length)r.push.apply(r,n.playlists);else if(n.uri)r.push(n);else if(main.playlists.length)for(let i=0;i<main.playlists.length;i++){const t=main.playlists[i];t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===e&&r.push(t)}}return r.length?r:e}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Rr(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),vl({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(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");if(!("vhs-json"===this.sourceType_&&this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Rr(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;this.stuckAtPlaylistEnd_(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"})});["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(_()({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(main,e){const t=main.mediaGroups||{};let n=!0;const r=Object.keys(t.AUDIO);for(const e in t.AUDIO)for(const label in t.AUDIO[e]){t.AUDIO[e][label].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(t.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),El.Playlist.isAes(e)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(t.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),o=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:h,bufferBasedABR:d,log:c}){if(!r)return Zn.log.warn("We received no playlist to switch to. Please check your stream."),!1;const m=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return c(`${m} as current playlist is not set`),!0;if(r.id===e.id)return!1;const f=Boolean(mr(t,n).length);if(!e.endList)return f||"number"!=typeof e.partTargetDuration?(c(`${m} as current playlist is live`),!0):(c(`not ${m} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const y=vr(t,n),_=d?Aa.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Aa.MAX_BUFFER_LOW_WATER_LINE;if(h<_)return c(`${m} as duration < max low water line (${h} < ${_})`),!0;const v=r.attributes.BANDWIDTH,T=e.attributes.BANDWIDTH;if(v<T&&(!d||y<l)){let e=`${m}
2 as next bandwidth < current bandwidth (${v} < ${T})`;return d&&(e+=` and forwardBuffer < bufferHighWaterLine (${y} < ${l})`),c(e),!0}if((!d||v>T)&&y>=o){let e=`${m} as forwardBuffer >= bufferLowWaterLine (${y} >= ${o})`;return d&&(e+=` and next bandwidth > current bandwidth (${v} > ${T})`),c(e),!0}return c(`not ${m} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:o
vendor: 3,255 bytes, line 2
2,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",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),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.timelineChangeController_.on("audioTimelineBehind",()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()});["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(
vendor: 5,612 bytes, line 2
2_()({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(_()({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(_()({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const n=t.end(0);let r=n;if(e.start){const o=e.start.timeOffset;r=o<0?Math.max(n+o,t.start(0)):Math.min(n,o)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const n=El.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),o=this.tech_.buffered();if(!o.length)return n-r<=cr;const l=o.end(o.length-1);return l-r<=cr&&n-l<=cr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,o=r.filter(Pr),l=1===o.length&&o[0]===e;if(1===r.length&&n!==1/0)return Zn.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(l);if(l){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),n=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},n)}let t=!1;r.forEach(n=>{if(n===e)return;const r=n.excludeUntil;void 0!==r&&r!==1/0&&(t=!0,delete n.excludeUntil)}),t&&(Zn.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let h;h=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,e.excludeUntil=h,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const d=this.selectPlaylist();if(!d)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const c=t.internal?this.logger_:Zn.log.warn,m=t.message?" "+t.message:"";c(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${d.id}.`),d.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const f=d.targetDuration/2*1e3||5e3,y="number"==typeof d.lastRequest&&Date.now()-d.lastRequest<=f;return this.switchMedia_(d,"exclude",l||y)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(filter,e){const t=[],n="all"===filter;(n||"main"===filter)&&t.push(this.mainPlaylistLoader_);const r=[];(n||"audio"===filter)&&r.push("AUDIO"),(n||"subtitle"===filter)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach(e
vendor: 5,090 bytes, line 2
2=>{const n=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;n&&t.push(n)}),["main","audio","subtitle"].forEach(e=>{const n=this[`${e}SegmentLoader_`];!n||filter!==e&&"all"!==filter||t.push(n)}),t.forEach(t=>e.forEach(e=>{"function"==typeof t[e]&&t[e]()}))}setCurrentTime(e){const t=mr(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:El.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const n=e.media();if(!n)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;const o=El.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n);return ur([[e,Math.max(e,t-o)]])}const o=this.syncController_.getExpiredTime(n,this.duration());if(null===o)return null;const l=El.Playlist.seekable(n,o,El.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return l.length?l:null}computeFinalSeekable_(e,t){if(!t)return e;const n=e.start(0),r=e.end(0),o=t.start(0),l=t.end(0);return o>r||n>l?e:ur([[Math.max(n,o),Math.min(r,l)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_)return;if(n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${fr(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let n=El.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),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 e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=Jr(this.main(),t),r={},o=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||S.b),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||S.a}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||o)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||S.a,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const l=(e,t)=>
2e?Object(S.c)(t,this.usingManagedMediaSource_):Object(S.g)(t),h={};let d;if(["video","audio"].forEach(function(t){if(r.hasOwnProperty(t)&&!l(e[t].isFmp4,r[t])){const n=e[t].isFmp4?"browser":"muxer";h[n]=h[n]||[],h[n].push(r[t]),"audio"===t&&(d=n)}}),o&&d&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach(n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${d} does not support codec(s): "${r.audio}"`)}if(Object.keys(h).length){const e=Object.keys(h).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${h[t].join(",")}"`),"")+".";return void this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const n=(Object(S.h)(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,o=(Object(S.h)(r[t]||"")[0]||{}).type;n&&o&&n.toLowerCase()!==o.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{const r=e[n];if(-1!==t.indexOf(r.id))return;t.push(r.id);const o=Jr(this.main,r),l=[];!o.audio||Object(S.g)(o.audio)||Object(S.c)(o.audio,this.usingManagedMediaSource_)||l.push(`audio codec ${o.audio}`),!o.video||Object(S.g)(o.video)||Object(S.c)(o.video,this.usingManagedMediaSource_)||l.push(`video codec ${o.video}`),o.text&&"stpp.ttml.im1t"===o.text&&l.push(`text codec ${o.text}`),l.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${l.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=Yr(Object(S.h)(e)),o=Qr(r),l=r.video&&Object(S.h)(r.video)[0]||null,h=r.audio&&Object(S.h)(r.audio)[0]||null;Object.keys(n).forEach(e=>{const r=n[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const d=[],c=Jr(this.mainPlaylistLoader_.main,r),m=Qr(c);if(c.audio||c.video){if(m!==o&&d.push(`codec count "${m}" !== "${o}"`),!this.sourceUpdater_.canChangeType()){const e=c.video&&Object(S.h)(c.video)[0]||null,t=c.audio&&Object(S.h)(c.audio)[0]||null;e&&l&&e.type.toLowerCase()!==l.type.toLowerCase()&&d.push(`video codec "${e.type}" !== "${l.type}"`),t&&h&&t.type.toLowerCase()!==h.type.toLowerCase()&&d.push(`audio codec "${t.type}" !== "${h.type}"`)}d.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${d.join(" && ")}`))}})}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),function(e,track,t=0){if(!e.segments)return;let n,r=t;for(let i=0;i<e.segments.length;i++){const t=e.segments[i];if(n||(n=Zo(track,r+t.duration/2)),n){if("cueIn"in t){n.endTime=r,n.adEndTime=r,r+=t.duration,n=null;continue}if(r<n.endTime){r+=t.duration;continue}n.endTime+=t.duration}else if("cueOut"in t&&(n=new o.a.VTTCue(r,r+t.duration,t.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(t.cueOut),track.addCue(n)),"cueOutCont"in t){const[e,l]=t.cueOutCont.split("/").map(parseFloat);n=new o.a.VTTCue(r,r+t.duration,""),n.adStartTime=r-e,n.adEndTime=n.adStartTime+l,track.addCue(n)}r+=t.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Aa.GOAL_BUFFER_LENGTH,n=Aa.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Aa.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Aa.BUFFER_LOW_WATER_LINE,n=Aa.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Aa.MAX_BUFFER_LOW_WATER_LINE),o=Math.max(t,Aa.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?o:r)}bufferHighWaterLine(){return Aa.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){yo(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const n=e.metadataTrack_;if(!n)return;const r=o.a.WebKitDataCue||o.a.VTTCue;
vendor: 20,271 bytes, line 2
2t.forEach(e=>{for(const t of Object.keys(e)){if(fo.has(t))continue;const o=new r(e.startTime,e.endTime,"");o.id=e.id,o.type="com.apple.quicktime.HLS",o.value={key:go[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),n.addCue(o)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();yo(this.inbandTextTracks_,e,this.tech_),mo({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const main=this.main();if(main.contentSteering){for(const e of main.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(e));this.contentSteeringController_.assignTagProperties(main.uri,main.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):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));["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(_()({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const main=this.main();(this.contentSteeringController_.didDASHTagChange(main.uri,main.contentSteering)||(()=>{const e=this.contentSteeringController_.getAvailablePathways(),t=[];for(const n of main.playlists){const r=n.attributes.serviceLocation;if(r&&(t.push(r),!e.has(r)))return!0}return!(t.length||!e.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,n=new Set;let r=!1;Object.keys(t).forEach(o=>{const l=t[o],h=this.pathwayAttribute_(l),d=h&&e!==h;l.excludeUntil===1/0&&"content-steering"===l.lastExcludeReason_&&!d&&(delete l.excludeUntil,delete l.lastExcludeReason_,r=!0);const c=!l.excludeUntil&&l.excludeUntil!==1/0;!n.has(l.id)&&d&&c&&(n.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{const n=this.mediaTypes_[t];if(n.activePlaylistLoader){const t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(const[e,r]of t.entries()){n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e))}for(const[r,o]of n.entries()){const n=t.get(r);if(!n){e.filter(p=>p.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(p=>{this.mainPlaylistLoader_.addClonePathway(o,p)}),this.contentSteeringController_.addAvailablePathway(r);continue}this.equalPathwayClones_(n,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(a,b){if(a["BASE-ID"]!==b["BASE-ID"]||a.ID!==b.ID||a["URI-REPLACEMENT"].HOST!==b["URI-REPLACEMENT"].HOST)return!1;const e=a["URI-REPLACEMENT"].PARAMS,t=b["URI-REPLACEMENT"].PARAMS;for(const p in e)if(e[p]!==t[p])return!1;for(const p in t)if(e[p]!==t[p])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);r&&r.size&&r.forEach(r=>{const o="usable",l=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===o,h=n.lastExcludeReason_===t&&n.excludeUntil===1/0;l?l&&h&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${o}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${o}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{const n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,Zn.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),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_()}}class xl{constructor(e,t,n){const{playlistController_:r}=e,o=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var l,h,d;this.codecs=Jr(r.main(),t),this.playlist=t,this.id=n,this.enabled=(l=e.playlists,h=t.id,d=o,e=>{const t=l.main.playlists[h],n=Or(t),r=Pr(t);if(void 0===e)return r;e?delete t.disabled:t.disabled=!0;const o={renditionInfo:{id:h,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===r||n||(e?(d(t),l.trigger({type:"renditionenabled",metadata:o})):l.trigger({type:"renditiondisabled",metadata:o})),e})}}const Il=["seeking","seeked","pause","playing","error"];class Al extends Zn.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=or("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),h=this.playlistController_,d=["main","subtitle","audio"],c={};d.forEach(e=>{c[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},h[`${e}SegmentLoader_`].on("appendsdone",c[e].updateend),h[`${e}SegmentLoader_`].on("playlistupdate",c[e].reset),this.tech_.on(["seeked","seeking"],c[e].reset)});const m=e=>{["main","audio"].forEach(t=>{h[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),m("off"))},this.clearSeekingAppendCheck_=()=>m("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),m("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Il,l),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Il,l),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),d.forEach(e=>{h[`${e}SegmentLoader_`].off("appendsdone",c[e].updateend),h[`${e}SegmentLoader_`].off("playlistupdate",c[e].reset),this.tech_.off(["seeked","seeking"],c[e].reset)}),this.checkCurrentTimeTimeout_&&o.a.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&o.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=o.a.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),o=function(a,b){if(a===b)return!1;if(!a&&b||!b&&a)return!0;if(a.length!==b.length)return!0;for(let i=0;i<a.length;i++)if(a.start(i)!==b.start(i)||a.end(i)!==b.end(i))return!0;return!1}(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,o){const n={bufferedRanges:r};return t.trigger({type:"bufferedrangeschanged",metadata:n}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:yr(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+cr>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(ur([this.lastRecordedTime,e]));const t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let n;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)){n=e.end(e.length-1)}if(this.beforeSeekableWindow_(e,t)){const t=e.start(0);n=t+(t===e.end(0)?0:cr)}if(void 0!==n)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${fr(e)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const r=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=r.audioBuffer?r.audioBuffered():null,h=r.videoBuffer?r.videoBuffered():null,d=this.media(),c=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-dr),m=[l,h];for(let i=0;i<m.length;i++){if(!m[i])continue;if(vr(m[i],t)<c)return!1}const f=gr(o,t);return 0!==f.length&&(n=f.start(0)+cr,this.logger_(`Buffered region starts (${f.start(0)})  just beyond seek point (${t}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),n=mr(t,e);return n.length&&e+3<=n.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const o=gr(r,t);return o.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${o.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let o=e.end(e.length-1)+cr;const l=!n.endList,h="number"==typeof n.partTargetDuration;return l&&(h||r)&&(o=e.end(e.length-1)+3*n.targetDuration),t>o}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){const o=mr(e,n-3),l=mr(e,n),h=mr(t,n);h.length&&!l.length&&o.length&&(r={start:o.end(0),end:h.end(0)})}else{gr(e,n).length||(r=this.gapFromVideoUnderflow_(e,n))}return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),n=this.tech_.currentTime(),r=gr(t,n);if(this.resetTimeUpdate_(),0===r.length||n!==e)return;this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+dr);const o={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:o}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const n=function(e){if(e.length<2)return ur();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),r=e.start(i);t.push([n,r])}return ur(t)}(e);for(let i=0;i<n.length;i++){const e=n.start(i),r=n.end(i);if(t-e<4&&t-e>2)return{start:e,end:r}}return null}}const Dl={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ol=function(e,t){let n=0,r=0;const o=lr(Dl,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){r&&e.currentTime(r)},h=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",l),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},d=function(){if(Date.now()-n<1e3*o.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(o.getSource&&"function"==typeof o.getSource)return n=Date.now(),o.getSource.call(e,h);Zn.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},c=function(){e.off("loadedmetadata",l),e.off("error",d),e.off("dispose",c)};e.on("error",d),e.on("dispose",c),e.reloadSourceOnError=function(t){c(),Ol(e,t)}},Pl=function(e){Ol(this,e)};var Ll="3.17.2";const Rl={PlaylistLoader:oa,Playlist:Br,utils:_a,STANDARD_PLAYLIST_SELECTOR:co,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(Br.isEnabled);lo(e,(a,b)=>uo(a,b));return e.filter(e=>!!Jr(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:co,movingAverageBandwidthSelector:function(e){let t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&o.a.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),ho({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(oo(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(oo(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?oo(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:uo,comparePlaylistResolution:function(e,t){let n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||o.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||o.a.Number.MAX_VALUE,n===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:ua()};Object.keys(Aa).forEach(e=>{Object.defineProperty(Rl,e,{get:()=>(Zn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Aa[e]),set(t){Zn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?Zn.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Aa[e]=t}})});const Nl="videojs-vhs",Ml=function(e,t){const n=t.media();let r=-1;for(let i=0;i<e.length;i++)if(e[i].id===n.id){r=i;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};Rl.canPlaySource=function(){return Zn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Ul=({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const o=((e,t)=>e.reduce((e,n)=>{if(!n.contentProtection)return e;const r=t.reduce((e,t)=>{const r=n.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]))(n?r.concat([n]):r,Object.keys(t)),l=[],h=[];return o.forEach(t=>{h.push(new Promise((t,n)=>{e.tech_.one("keysessioncreated",t)})),l.push(new Promise((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):n()})}))}),Promise.race([Promise.all(l),Promise.race(h)])},Bl=({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{const o=((e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=Yr(Object(S.h)(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const o=Object(S.e)(r.video),l=Object(S.e)(r.audio),h={};for(const n in e)h[n]={},l&&(h[n].audioContentType=l),o&&(h[n].videoContentType=o),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(h[n].pssh=t.contentProtection[n].pssh),"string"==typeof e[n]&&(h[n].url=e[n]);return lr(e,h)})(t,n,r);return!!o&&(e.currentSource().keySystems=o,!(o&&!e.eme)||(Zn.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Fl=()=>{if(!o.a.localStorage)return null;const e=o.a.localStorage.getItem(Nl);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},jl=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},ql=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},$l=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Vl=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Rl.supportsNativeHls=function(){if(!h.a||!h.a.createElement)return!1;const video=h.a.createElement("video");if(!Zn.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(video.canPlayType(e))})}(),Rl.supportsNativeDash=!!(h.a&&h.a.createElement&&Zn.getTech("Html5").isSupported())&&/maybe|probably/i.test(h.a.createElement("video").canPlayType("application/d
2ash+xml")),Rl.supportsTypeNatively=e=>"hls"===e?Rl.supportsNativeHls:"dash"===e&&Rl.supportsNativeDash,Rl.isSupported=function(){return Zn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Rl.xhr.onRequest=function(e){jl(Rl.xhr,e)},Rl.xhr.onResponse=function(e){ql(Rl.xhr,e)},Rl.xhr.offRequest=function(e){$l(Rl.xhr,e)},Rl.xhr.offResponse=function(e){Vl(Rl.xhr,e)};const Hl=Zn.getComponent("Component");class zl extends Hl{constructor(source,e,t){if(super(e,t.vhs),"number"==typeof t.initialBandwidth&&(this.options_.bandwidth=t.initialBandwidth),this.logger_=or("VhsHandler"),e.options_&&e.options_.playerId){const t=Zn.getPlayer(e.options_.playerId);this.player_=t}if(this.tech_=e,this.source_=source,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);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(h.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=h.a.fullscreenElement||h.a.webkitFullscreenElement||h.a.mozFullScreenElement||h.a.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=lr(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=Fl();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Aa.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Aa.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(option=>{void 0!==this.source_[option]&&(this.options_[option]=this.source_[option])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var n;this.setOptions_(),this.options_.src=0===(n=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(n.substring(n.indexOf(",")+1)):n,this.options_.tech=this.tech_,this.options_.externVhs=Rl,this.options_.sourceType=Object(E.a)(t),this.options_.seekTo=time=>{this.tech_.setCurrentTime(time)},this.options_.player_=this.player_,this.playlistController_=new kl(this.options_);const r=lr({liveRangeSafeTimeDelta:cr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Al(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const e=Zn.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const l=this.options_.bufferBasedABR?Rl.movingAverageBandwidthSelector(.55):Rl.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.playlistController_.selectInitialPlaylist=Rl.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(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=o.a.navigator.connection||o.a.navigator.mozConnection||o.a.navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){const r=1e3*t.downlink*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;return Math.floor(1/(e+t))},set(){Zn.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>yr(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>yr(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!o.a.localStorage)return!1;let t=Fl();t=t?lr(t,e):e;try{o.a.localStorage.setItem(Nl,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{var e;(e=this).representations=()=>{const main=e.playlistController_.main(),t=Ur(main)?e.playlistController_.getAudioTrackPlaylists_():main.playlists;return t?t.filter(e=>!Or(e)).map((t,i)=>new xl(e,t,t.id)):[]}}),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_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=o.a.URL.createObjectURL(this.playlistController_.mediaSource),(Zn.browser.IS_ANY_SAFARI||Zn.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Ul({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media ke
2ys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Bl({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=Zn.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{!function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),Ml(e,t.playlists)}(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Ml(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ll,"mux.js":"7.1.0","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return Xo.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&o.a.URL.revokeObjectURL&&(o.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(time,e){return ba({playlist:this.playlistController_.media(),time:time,callback:e})}seekToProgramTime(e,t,n=!0,r=2){return va({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{jl(this.xhr,e)},this.xhr.onResponse=e=>{ql(this.xhr,e)},this.xhr.offRequest=e=>{$l(this.xhr,e)},this.xhr.offResponse=e=>{Vl(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(_()({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(_()({},e))})})}}const Wl={name:"videojs-http-streaming",VERSION:Ll,canHandleSource(e,t={}){const n=lr(Zn.options,t);return!(!n.vhs.experimentalUseMMS&&!Object(S.c)("avc1.4d400d,mp4a.40.2",!1))&&Wl.canPlayType(e.type,n)},handleSource(source,e,t={}){const n=lr(Zn.options,t);return e.vhs=new zl(source,e,n),e.vhs.xhr=ua(),e.vhs.setupXhrHooks_(),e.vhs.src(source.src,source.type),e.vhs},canPlayType(e,t){const n=Object(E.a)(e);if(!n)return"";const r=Wl.getOverrideNative(t);return!Rl.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,n=!(Zn.browser.IS_ANY_SAFARI||Zn.browser.IS_IOS),{overrideNative:r=n}=t;return r}};Object(S.c)("avc1.4d400d,mp4a.40.2",!0)&&Zn.getTech("Html5").registerSourceHandler(Wl,0),Zn.VhsHandler=zl,Zn.VhsSourceHandler=Wl,Zn.Vhs=Rl,Zn.use||Zn.registerComponent("Vhs",Rl),Zn.options.vhs=Zn.options.vhs||{},Zn.getPlugin&&Zn.getPlugin("reloadSourceOnError")||Zn.registerPlugin("reloadSourceOnError",Pl)}).call(this,n(29))},1009:function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(this,n(29))},1036:function(e,t,n){"use strict";n.d(t,"g",function(){return o}),n.d(t,"e",function(){return l}),n.d(t,"k",function(){return h}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return c}),n.d(t,"b",function(){return y}),n.d(t,"f",function(){return _}),n.d(t,"c",function(){return v}),n.d(t,"h",function(){return T}),n.d(t,"d",function(){return S}),n.d(t,"a",function(){return E});var a,b,r=n(1009),o=function(b,e,t){return void 0===t&&(t=" "),(function(e,t){for(var n="";t--;)n+=e;return n}(t,e)+b.toString()).slice(-e)},l=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},h=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||l(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},d=function(e){e=h(e);for(var t="",i=0;i<e.length;i++)t+=o(e[i].toString(16),2,"0");return t},c=function(e){e=h(e);for(var t="",i=0;i<e.length;i++)t+=o(e[i].toString(2),8,"0");return t},m=n.n(r).a.BigInt||Number,f=[m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000")],y=(a=new Uint16Array([65484]),255===(b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength))[0]||b[0],function(e,t){var n=void 0===t?{}:t,r=n.signed,o=void 0!==r&&r,l=n.le,d=void 0!==l&&l;e=h(e);var c=d?"reduce":"reduceRight",y=(e[c]?e[c]:Array.prototype[c]).call(e,function(t,n,i){var r=d?i:Math.abs(i+1-e.length);return t+m(n)*f[r]},m(0));if(o){var _=f[e.length]/m(2)-m(1);(y=m(y))>_&&(y-=_,y-=_,y-=m(2))}return Number(y)}),_=function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=m(e);for(var o,l=(o=e,Math.ceil(function(e){return e.toString(2).length}(o)/8)),h=new Uint8Array(new ArrayBuffer(l)),i=0;i<l;i++){var d=r?i:Math.abs(i+1-h.length);h[d]=Number(e/f[i]&m(255)),e<0&&(h[d]=Math.abs(~h[d]),h[d]-=0===i?1:2)}return h},v=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,h(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},T=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var view=new Uint8Array(e.length),i=0;i<e.length;i++)view[i]=e.charCodeAt(i);return view},S=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(b){return b&&(b.byteLength||b.length)&&"string"!=typeof b}),t.length<=1)return h(t[0]);var r=t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),o=new Uint8Array(r),l=0;return t.forEach(function(e){e=h(e),o.set(e,l),l+=e.byteLength}),o},E=function(a,b,e){var t=void 0===e?{}:e,n=t.offset,r=void 0===n?0:n,o=t.mask,mask=void 0===o?[]:o;a=h(a);var l=(b=h(b)).every?b.every:Array.prototype.every;return b.length&&a.length-r>=b.length&&l.call(b,function(e,i){return e===(mask[i]?mask[i]&a[r+i]:a[r+i])})}},1339:function(e,t,n){"use strict";function r(object,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(object):object}var o=r({HTML:"text/html",isHTML:function(e){return e===o.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),l=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===l.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,source){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var t in source)Object.prototype.hasOwnProperty.call(source,t)&&(e[t]=source[t]);return e},t.find=function(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var i=0;i<e.length;i++)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];if(t.call(void 0,r,i,e))return r}},t.freeze=r,t.MIME_TYPE=o,t.NAMESPACE=l},1350:function(e,t){function n(){return e.exports=n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(null,arguments)}
2e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},1716:function(e,t,n){(function(t){var r,o=void 0!==t?t:"undefined"!=typeof window?window:{},l=n(1035);"undefined"!=typeof document?r=document:(r=o["__GLOBAL_DOCUMENT_CACHE@4"])||(r=o["__GLOBAL_DOCUMENT_CACHE@4"]=l),e.exports=r}).call(this,n(29))},1717:function(e,t,n){"use strict";var r=n(1009),o=n.n(r),l="https://example.com";t.a=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=o.a.location&&o.a.location.href||"");var n=/^\/\//.test(e),r=!o.a.location&&!/\/\//i.test(e);e=new o.a.URL(e,o.a.location||l);var h=new URL(t,e);return r?h.href.slice(19):n?h.href.slice(h.protocol.length):h.href}},1718:function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return h});var r=n(1009),o=n.n(r),l=function(s){return o.a.atob?o.a.atob(s):e.from(s,"base64").toString("binary")};function h(e){for(var t=l(e),n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}}).call(this,n(543).Buffer)},1719:function(e,t,n){var r=n(1339),o=r.find,l=r.NAMESPACE;function h(input){return""!==input}function d(e,element){return e.hasOwnProperty(element)||(e[element]=!0),e}function c(input){if(!input)return[];var e=function(input){return input?input.split(/[\t\n\f\r ]+/).filter(h):[]}(input);return Object.keys(e.reduce(d,{}))}function m(e,t){for(var p in e)Object.prototype.hasOwnProperty.call(e,p)&&(t[p]=e[p])}function f(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,m(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var y={},_=y.ELEMENT_NODE=1,v=y.ATTRIBUTE_NODE=2,T=y.TEXT_NODE=3,S=y.CDATA_SECTION_NODE=4,E=y.ENTITY_REFERENCE_NODE=5,w=y.ENTITY_NODE=6,C=y.PROCESSING_INSTRUCTION_NODE=7,k=y.COMMENT_NODE=8,x=y.DOCUMENT_NODE=9,I=y.DOCUMENT_TYPE_NODE=10,A=y.DOCUMENT_FRAGMENT_NODE=11,D=y.NOTATION_NODE=12,O={},P={},L=(O.INDEX_SIZE_ERR=(P[1]="Index size error",1),O.DOMSTRING_SIZE_ERR=(P[2]="DOMString size error",2),O.HIERARCHY_REQUEST_ERR=(P[3]="Hierarchy request error",3)),R=(O.WRONG_DOCUMENT_ERR=(P[4]="Wrong document",4),O.INVALID_CHARACTER_ERR=(P[5]="Invalid character",5),O.NO_DATA_ALLOWED_ERR=(P[6]="No data allowed",6),O.NO_MODIFICATION_ALLOWED_ERR=(P[7]="No modification allowed",7),O.NOT_FOUND_ERR=(P[8]="Not found",8)),N=(O.NOT_SUPPORTED_ERR=(P[9]="Not supported",9),O.INUSE_ATTRIBUTE_ERR=(P[10]="Attribute in use",10));O.INVALID_STATE_ERR=(P[11]="Invalid state",11),O.SYNTAX_ERR=(P[12]="Syntax error",12),O.INVALID_MODIFICATION_ERR=(P[13]="Invalid modification",13),O.NAMESPACE_ERR=(P[14]="Invalid namespace",14),O.INVALID_ACCESS_ERR=(P[15]="Invalid access",15);function M(code,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,P[code]),this.message=P[code],Error.captureStackTrace&&Error.captureStackTrace(this,M);return t.code=code,e&&(this.message=this.message+": "+e),t}function U(){}function B(e,t){this._node=e,this._refresh=t,F(this)}function F(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ie(e,"length",n.length),!e.$$length||n.length<e.$$length)for(var i=n.length;i in e;i++)Object.prototype.hasOwnProperty.call(e,i)&&delete e[i];m(n,e),e._inc=t}}function j(){}function $(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function V(e,t,n,r){if(r?t[$(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var o=e.ownerDocument;o&&(r&&Y(o,e,r),function(e,t,n){e&&e._inc++;var r=n.namespaceURI;r===l.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(o,e,n))}}function H(e,t,n){var i=$(t,n);if(!(i>=0))throw new M(R,new Error(e.tagName+"@"+n));for(var r=t.length-1;i<r;)t[i]=t[++i];if(t.length=r,e){var o=e.ownerDocument;o&&(Y(o,e,n),n.ownerElement=null)}}function z(){}function W(){}function G(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function X(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(X(e,t))return!0}while(e=e.nextSibling)}function K(){this.ownerDocument=this}function Y(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function Q(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,i=0;o;)r[i++]=o,o=o.nextSibling;r.length=i,delete r[r.length]}}}function J(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.last
vendor: 1,127 bytes, line 2
2Child=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Q(e.ownerDocument,e),t}function Z(e){return e&&e.nodeType===W.DOCUMENT_TYPE_NODE}function ee(e){return e&&e.nodeType===W.ELEMENT_NODE}function te(e){return e&&e.nodeType===W.TEXT_NODE}function ie(e,t){var n=e.childNodes||[];if(o(n,ee)||Z(t))return!1;var r=o(n,Z);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function se(e,t){var n=e.childNodes||[];if(o(n,function(e){return ee(e)&&e!==t}))return!1;var r=o(n,Z);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function ne(e,t,n){if(!function(e){return e&&(e.nodeType===W.DOCUMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.ELEMENT_NODE)}(e))throw new M(L,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new M(R,"child not in parent");if(!function(e){return e&&(ee(e)||te(e)||Z(e)||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.COMMENT_NODE||e.nodeType===W.PROCESSING_INSTRUCTION_NODE)}(t)||Z(t)&&e.nodeType!==W.DOCUMENT_NODE)throw new M(L,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function re(e,t,n){var r=e.childNodes||[],l=t.childNodes||[];
vendor: 25,235 bytes, line 2
2if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var h=l.filter(ee);if(h.length>1||o(l,te))throw new M(L,"More than one element or text in fragment");if(1===h.length&&!ie(e,n))throw new M(L,"Element in fragment can not be inserted before doctype")}if(ee(t)&&!ie(e,n))throw new M(L,"Only one element can be added and only after doctype");if(Z(t)){if(o(r,Z))throw new M(L,"Only one doctype is allowed");var d=o(r,ee);if(n&&r.indexOf(d)<r.indexOf(n))throw new M(L,"Doctype can only be inserted before an element");if(!n&&d)throw new M(L,"Doctype can not be appended since element is present")}}function ae(e,t,n){var r=e.childNodes||[],l=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var h=l.filter(ee);if(h.length>1||o(l,te))throw new M(L,"More than one element or text in fragment");if(1===h.length&&!se(e,n))throw new M(L,"Element in fragment can not be inserted before doctype")}if(ee(t)&&!se(e,n))throw new M(L,"Only one element can be added and only after doctype");if(Z(t)){if(o(r,function(e){return Z(e)&&e!==n}))throw new M(L,"Only one doctype is allowed");var d=o(r,ee);if(n&&r.indexOf(d)<r.indexOf(n))throw new M(L,"Doctype can only be inserted before an element")}}function oe(e,t,n,r){ne(e,t,n),e.nodeType===W.DOCUMENT_NODE&&(r||re)(e,t,n);var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===A){var l=t.firstChild;if(null==l)return t;var h=t.lastChild}else l=h=t;var pre=n?n.previousSibling:e.lastChild;l.previousSibling=pre,h.nextSibling=n,pre?pre.nextSibling=l:e.firstChild=l,null==n?e.lastChild=h:n.previousSibling=h;do{l.parentNode=e,le(l,e.ownerDocument||e)}while(l!==h&&(l=l.nextSibling));return Q(e.ownerDocument||e,e),t.nodeType==A&&(t.firstChild=t.lastChild=null),t}function le(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===_&&e.attributes)for(var i=0;i<e.attributes.length;i++){var n=e.attributes.item(i);n&&(n.ownerDocument=t)}for(var r=e.firstChild;r;)le(r,t),r=r.nextSibling}}function ue(){this._nsMap={}}function he(){}function de(){}function ce(){}function pe(){}function me(){}function ge(){}function fe(){}function ye(){}function _e(){}function be(){}function ve(){}function Te(){}function Se(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,o=r.prefix,l=r.namespaceURI;if(l&&null==o&&null==(o=r.lookupPrefix(l)))var h=[{namespace:l,prefix:null}];return Ce(this,n,e,t,h),n.join("")}function Ee(e,t,n){var r=e.prefix||"",o=e.namespaceURI;if(!o)return!1;if("xml"===r&&o===l.XML||o===l.XMLNS)return!1;for(var i=n.length;i--;){var h=n[i];if(h.prefix===r)return h.namespace!==o}return!0}function we(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,G),'"')}function Ce(e,t,n,r,o){if(o||(o=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case _:var h=e.attributes,d=h.length,c=e.firstChild,m=e.tagName,f=m;if(!(n=l.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var y,w=0;w<h.length;w++)if("xmlns"===h.item(w).name){y=h.item(w).value;break}if(!y)for(var D=o.length-1;D>=0;D--){if(""===(O=o[D]).prefix&&O.namespace===e.namespaceURI){y=O.namespace;break}}if(y!==e.namespaceURI)for(D=o.length-1;D>=0;D--){var O;if((O=o[D]).namespace===e.namespaceURI){O.prefix&&(f=O.prefix+":"+m);break}}}t.push("<",f);for(var i=0;i<d;i++){"xmlns"==(P=h.item(i)).prefix?o.push({prefix:P.localName,namespace:P.value}):"xmlns"==P.nodeName&&o.push({prefix:"",namespace:P.value})}for(i=0;i<d;i++){var P,L,R;if(Ee(P=h.item(i),0,o))we(t,(L=P.prefix||"")?"xmlns:"+L:"xmlns",R=P.namespaceURI),o.push({prefix:L,namespace:R});Ce(P,t,n,r,o)}if(m===f&&Ee(e,0,o))we(t,(L=e.prefix||"")?"xmlns:"+L:"xmlns",R=e.namespaceURI),o.push({prefix:L,namespace:R});if(c||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(m)){if(t.push(">"),n&&/^script$/i.test(m))for(;c;)c.data?t.push(c.data):Ce(c,t,n,r,o.slice()),c=c.nextSibling;else for(;c;)Ce(c,t,n,r,o.slice()),c=c.nextSibling;t.push("</",f,">")}else t.push("/>");return;case x:case A:for(c=e.firstChild;c;)Ce(c,t,n,r,o.slice()),c=c.nextSibling;return;case v:return we(t,e.name,e.value);case T:return t.push(e.data.replace(/[<&>]/g,G));case S:return t.push("<![CDATA[",e.data,"]]>");case k:return t.push("\x3c!--",e.data,"--\x3e");case I:var N=e.publicId,M=e.systemId;if(t.push("<!DOCTYPE ",e.name),N)t.push(" PUBLIC ",N),M&&"."!=M&&t.push(" ",M),t.push(">");else if(M&&"."!=M)t.push(" SYSTEM ",M,">");else{var sub=e.internalSubset;sub&&t.push(" [",sub,"]"),t.push(">")}return;case C:return t.push("<?",e.target," ",e.data,"?>");case E:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ke(e,t,n){var r;switch(t.nodeType){case _:(r=t.cloneNode(!1)).ownerDocument=e;case A:break;case v:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(ke(e,o,n)),o=o.nextSibling;return r}function xe(e,t,n){var r=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var l=t[o];"object"!=typeof l&&l!=r[o]&&(r[o]=l)}switch(t.childNodes&&(r.childNodes=new U),r.ownerDocument=e,r.nodeType){case _:var h=t.attributes,d=r.attributes=new j,c=h.length;d._ownerElement=r;for(var i=0;i<c;i++)r.setAttributeNode(xe(e,h.item(i),!0));break;case v:n=!0}if(n)for(var m=t.firstChild;m;)r.appendChild(xe(e,m,n)),m=m.nextSibling;return r}function Ie(object,e,t){object[e]=t}M.prototype=Error.prototype,m(O,M),U.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var n=[],i=0;i<this.length;i++)Ce(this[i],n,e,t);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},B.prototype.item=function(i){return F(this),this[i]||null},f(B,U),j.prototype={length:0,item:U.prototype.item,getNamedItem:function(e){for(var i=this.length;i--;){var t=this[i];if(t.nodeName==e)return t}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new M(N);var n=this.getNamedItem(e.nodeName);return V(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new M(N);return t=this.getNamedItemNS(e.namespaceURI,e.localName),V(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return H(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return H(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},z.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new K;if(r.implementation=this,r.childNodes=new U,r.doctype=n||null,n&&r.appendChild(n),t){var o=r.createElementNS(e,t);r.appendChild(o)}return r},createDocumentType:function(e,t,n){var r=new ge;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=n||"",r}},W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return oe(this,e,t)},replaceChild:function(e,t){oe(this,e,t,ae),t&&this.removeChild(t)},removeChild:function(e){return J(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return xe(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==T&&e.nodeType==T?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var map=t._nsMap;if(map)for(var n in map)if(Object.prototype.hasOwnProperty.call(map,n)&&map[n]===e)return n;t=t.nodeType==v?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var map=t._nsMap;if(map&&Object.prototype.hasOwnProperty.call(map,e))return map[e];t=t.nodeType==v?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},m(y,W),m(y,W.prototype),K.prototype={nodeName:"#document",nodeType:x,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==A){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return oe(this,e,t),le(e,this),null===this.documentElement&&e.nodeType===_&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),J(this,e)},replaceChild:function(e,t){oe(this,e,t,ae),le(e,this),t&&this.removeChild(t),ee(e)&&(this.documentElement=e)},importNode:function(e,t){return ke(this,e,t)},getElementById:function(e){var t=null;return X(this.documentElement,function(n){if(n.nodeType==_&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=c(e);return new B(this,function(base){var n=[];return t.length>0&&X(base.documentElement,function(r){if(r!==base&&r.nodeType===_){var o=r.getAttribute("class");if(o){var l=e===o;if(!l){var h=c(o);l=t.every((d=h,function(element){return d&&-1!==d.indexOf(element)}))}l&&n.push(r)}}var d}),n})},createElement:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new U,(t.attributes=new j)._ownerElement=t,t},createDocumentFragment:function(){var e=new be;return e.ownerDocument=this,e.childNodes=new U,e},createTextNode:function(data){var e=new ce;return e.ownerDocument=this,e.appendData(data),e},createComment:function(data){var e=new pe;return e.ownerDocument=this,e.appendData(data),e},createCDATASection:function(data){var e=new me;return e.ownerDocument=this,e.appendData(data),e},createProcessingInstruction:function(e,data){var t=new ve;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=e,t.nodeValue=t.data=data,t},createAttribute:function(e){var t=new he;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new _e;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new ue,r=t.split(":"),o=n.attributes=new j;return n.childNodes=new U,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new he,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},f(K,W),ue.prototype={nodeType:_,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===A?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,Q(e.ownerDocument,e,t),le(t,e.ownerDocument||e),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new B(this,function(base){var t=[];return X(base,function(n){n===base||n.nodeType!=_||"*"!==e&&n.tagName!=e||t.push(n)}),t})},getElementsByTagNameNS:function(e,t){return new B(this,function(base){var n=[];return X(base,function(r){r===base||r.nodeType!==_||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)}),n})}},K.prototype.getElementsByTagName=ue.prototype.getElementsByTagName,K.prototype.getElementsByTagNameNS=ue.prototype.getElementsByTagNameNS,f(ue,W),he.prototype.nodeType=v,f(he,W),de.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(text){text=this.data+text,this.nodeValue=this.data=text,this.length=text.length},insertData:function(e,text){this.replaceData(e,0,text)},appendChild:function(e){throw new Error(P[L])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,text){text=this.data.substring(0,e)+text+this.data.substring(e+t),this.nodeValue=this.data=text,this.length=text.length}},f(de,W),ce.prototype={nodeName:"#text",nodeType:T,splitText:function(e){var text=this.data,t=text.substring(e);text=text.substring(0,e),this.data=this.nodeValue=text,this.length=text.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},f(ce,de),pe.prototype={nodeName:"#comment",nodeType:k},f(pe,de),me.prototype={nodeName:"#cdata-section",nodeType:S},f(me,de),ge.prototype.nodeType=I,f(ge,W),fe.prototype.nodeType=D,f(fe,W),ye.prototype.nodeType=w,f(ye,W),_e.prototype.nodeType=E,f(_e,W),be.prototype.nodeName="#document-fragment",be.prototype.nodeType=A,f(be,W),ve.prototype.nodeType=C,f(ve,W),Te.prototype.serializeToString=function(e,t,n){return Se.call(e,t,n)},W.prototype.toString=Se;try{if(Object.defineProperty){function Ae(e){switch(e.nodeType){case _:case A:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(Ae(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(B.prototype,"length",{get:function(){return F(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){return Ae(this)},set:function(data){switch(this.nodeType){case _:case A:for(;this.firstChild;)this.removeChild(this.firstChild);(data||String(data))&&this.appendChild(this.ownerDocument.createTextNode(data));break;default:this.data=data,this.value=data,this.nodeValue=data}}}),Ie=function(object,e,t){object["$$"+e]=t}}}catch(De){}t.DocumentType=ge,t.DOMException=M,t.DOMImplementation=z,t.Element=ue,t.Node=W,t.NodeList=U,t.XMLSerializer=Te},1720:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1036),o=Object(r.k)([73,68,51]),l=function e(t,n){return void 0===n&&(n=0),(t=Object(r.k)(t)).length-n<10||!Object(r.a)(t,o,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=Object(r.k)(e))[t+5],o=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?o+20:o+10}(t,n),e(t,n))}},1954:function(e,t,n){"use strict";var r=n(1009),o=n(1350),l=n(568),h=n(1955),d=n(1956);f.httpHandler=n(1957),f.requestInterceptorsStorage=new h,f.responseInterceptorsStorage=new h,f.retryManager=new d;var c=function(e){var t={};return e?(e.trim().split("\n").forEach(function(e){var n=e.indexOf(":"),r=e.slice(0,n).trim().toLowerCase(),o=e.slice(n+1).trim();void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]}),t):t};function m(e,t,n){var r=e;return l(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=o({},t,{uri:e}),r.callback=n,r}function f(e,t,n){return y(t=m(e,t,n))}function y(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},n=f.requestInterceptorsStorage.execute(e.requestType,t);e.uri=n.uri,e.headers=n.headers,e.body=n.body,e.metadata=n.metadata,e.retry=n.retry,e.timeout=n.timeout}var r=!1,o=function(t,n,body){r||(r=!0,e.callback(t,n,body))};function l(){var body=void 0;if(body=v.response?v.response:v.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(v),k)try{body=JSON.parse(body)}catch(e){}return body}function h(t){if(clearTimeout(T),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,_||!f.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var n={headers:x.headers||{},body:x.body,responseUrl:v.responseURL,responseType:v.responseType},r=f.responseInterceptorsStorage.execute(e.requestType,n);x.body=r.body,x.headers=r.headers}return o(t,x)}e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=v,y(e)},e.retry.getCurrentFuzzedDelay())}function d(){if(!_){var t;clearTimeout(T),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===v.status?200:1223===v.status?204:v.status;var n=x,r=null;if(0!==t?(n={body:l(),statusCode:t,method:E,headers:{},url:S,rawRequest:v},v.getAllResponseHeaders&&(n.headers=c(v.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),e.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var h={headers:n.headers||{},body:n.body,responseUrl:v.responseURL,responseType:v.responseType},d=f.responseInterceptorsStorage.execute(e.requestType,h);n.body=d.body,n.headers=d.headers}return o(r,n,n.body)}}var m,_,v=e.xhr||null;v||(v=e.cors||e.useXDR?new f.XDomainRequest:new f.XMLHttpRequest);var T,S=v.url=e.uri||e.url,E=v.method=e.method||"GET",body=e.body||e.data,w=v.headers=e.headers||{},C=!!e.sync,k=!1,x={body:void 0,headers:{},statusCode:0,method:E,url:S,rawRequest:v};if("json"in e&&!1!==e.json&&(k=!0,w.accept||w.Accept||(w.Accept="application/json"),"GET"!==E&&"HEAD"!==E&&(w["content-type"]||w["Content-Type"]||(w["Content-Type"]="application/json"),body=JSON.stringify(!0===e.json?body:e.json))),v.onreadystatechange=function(){4!==v.readyState||f.responseInterceptorsStorage.getIsEnabled()||setTimeout(d,0)},v.onload=d,v.onerror=h,v.onprogress=function(){},v.onabort=function(){_=!0,clearTimeout(e.retryTimeout)},v.ontimeout=h,v.open(E,S,!C,e.username,e.password),C||(v.withCredentials=!!e.withCredentials),!C&&e.timeout>0&&(T=setTimeout(function(){if(!_){_=!0,v.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",h(e)}},e.timeout)),v.setRequestHeader)for(m in w)w.hasOwnProperty(m)&&v.setRequestHeader(m,w[m]);else if(e.headers&&!function(e){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(v.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(v),v.send(body||null),v}e.exports=f,e.exports.default=f,f.XMLHttpRequest=r.XMLHttpRequest||function(){},f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){f["delete"===e?"del":e]=function(t,n,r){return(n=m(t,n,r)).method=e.toUpperCase(),y(n)}})},1955:function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var l=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var n=this.typeToInterceptorsMap_.get(e);return!n.has(t)&&(n.add(t),!0)},t.removeInterceptor=function(e,t){var n=this.typeToInterceptorsMap_.get(e);return!(!n||!n.has(t))&&(n.delete(t),!0)},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var n,o=r(this.getForType(e));!(n=o()).done;){var l=n.value;try{t=l(t)}catch(e){}}return t},e}();e.exports=l},1956:function(e,t,n){"use strict";var r=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,n=t.maxAttempts,r=t.delayFactor,l=t.fuzzFactor,h=t.initialDelay;return new o({maxAttempts:n||this.maxAttempts_,delayFactor:r||this.delayFactor_,fuzzFactor:l||this.fuzzFactor_,initialDelay:h||this.initialDelay_})},e}(),o=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();e.exports=r},1957:function(e,t,n){"use strict";var r=n(1009);e.exports=function(e,t){return void 0===t&&(t=!1),function(n,o,l){if(n)e(n);else if(o.statusCode>=400&&o.statusCode<=599){var h=l;if(t)if(r.TextDecoder){var d=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce(function(e,t){var n=t.split("="),r=n[0],o=n[1];return"charset"===r.trim()?o.trim():e},"utf-8")}(o.headers&&o.headers["content-type"]);try{h=new TextDecoder(d).decode(l)}catch(e){}}else h=String.fromCharCode.apply(null,new Uint8Array(l));e({cause:h})}else e(null,l)}}},1958:function(e,t,n){var r=n(1009),o=e.exports={WebVTT:n(1959),VTTCue:n(1960),VTTRegion:n(1961)};r.vttjs=o,r.WebVTT=o.WebVTT;var l=o.VTTCue,h=o.VTTRegion,d=r.VTTCue,c=r.VTTRegion;o.shim=function(){r.VTTCue=l,r.VTTRegion=h},o.restore=function(){r.VTTCue=d,r.VTTRegion=c},r.VTTCue||o.shim()},1959:function(e,t,n){var r=n(1716),o=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function l(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function h(input){function e(e,t,s,n){return 3600*(0|e)+60*(0|t)+(0|s)+(0|n)/1e3}var t=input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function d(){this.values=o(null)}function c(input,e,t,n){var r=n?input.split(n):[input];for(var i in r)if("string"==typeof r[i]){var o=r[i].split(t);if(2===o.length)e(o[0].trim(),o[1].trim())}}function m(input,e,t){var n=input;function r(){var e=h(input);if(null===e)throw new l(l.Errors.BadTimeStamp,"Malformed timestamp: "+n);return input=input.replace(/^[^\sa-zA-Z-]+/,""),e}function o(){input=input.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),"--\x3e"!==input.substr(0,3))throw new l(l.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);
vendor: 12,879 bytes, line 2
2input=input.substr(3),o(),e.endTime=r(),o(),function(input,e){var n=new d;c(input,function(e,r){switch(e){case"region":for(var i=t.length-1;i>=0;i--)if(t[i].id===r){n.set(e,t[i].region);break}break;case"vertical":n.alt(e,r,["rl","lr"]);break;case"line":var o=r.split(","),l=o[0];n.integer(e,l),n.percent(e,l)&&n.set("snapToLines",!1),n.alt(e,l,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=r.split(","),n.percent(e,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","center","end"]);break;case"size":n.percent(e,r);break;case"align":n.alt(e,r,["start","center","end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");try{e.line=n.get("line","auto")}catch(e){}e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100);try{e.align=n.get("align","center")}catch(t){e.align=n.get("align","middle")}try{e.position=n.get("position","auto")}catch(t){e.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}(input,e)}l.prototype=o(Error.prototype),l.prototype.constructor=l,l.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},d.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,a){for(var n=0;n<a.length;++n)if(t===a[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var f=r.createElement&&r.createElement("textarea"),y={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},_={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},v={v:"title",lang:"lang"},T={rt:"ruby"};function S(e,input){function t(){if(!input)return null;var e,t=input.match(/^([^<]*)(<[^>]*>?)?/);return e=t[1]?t[1]:t[2],input=input.substr(e.length),e}function n(s){return f.innerHTML=s,s=f.textContent,f.textContent="",s}function r(e,element){return!T[element.localName]||T[element.localName]===e.localName}function o(t,n){var r=y[t];if(!r)return null;var element=e.document.createElement(r),o=v[t];return o&&n&&(element[o]=n.trim()),element}for(var l,d=e.document.createElement("div"),c=d,m=[];null!==(l=t());)if("<"!==l[0])c.appendChild(e.document.createTextNode(n(l)));else{if("/"===l[1]){m.length&&m[m.length-1]===l.substr(2).replace(">","")&&(m.pop(),c=c.parentNode);continue}var S,E=h(l.substr(1,l.length-2));if(E){S=e.document.createProcessingInstruction("timestamp",E),c.appendChild(S);continue}var w=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!w)continue;if(!(S=o(w[1],w[3])))continue;if(!r(c,S))continue;if(w[2]){var C=w[2].split(".");C.forEach(function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(_.hasOwnProperty(n)){var r=t?"background-color":"color",o=_[n];S.style[r]=o}}),S.className=C.join(" ")}m.push(w[1]),c.appendChild(S),c=S}return d}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function w(e){for(var i=0;i<E.length;i++){var t=E[i];if(e>=t[0]&&e<=t[1])return!0}return!1}function C(e){var t=[],text="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),text=t.textContent||t.innerText;if(text){var o=text.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):text}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);text=r(t);)for(var i=0;i<text.length;i++)if(w(text.charCodeAt(i)))return"rtl";return"ltr"}function k(){}function x(e,t,n){k.call(this),this.cue=t,this.cueDiv=S(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:C(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var o=0;switch(t.positionAlign){case"start":case"line-left":o=t.position;break;case"center":o=t.position-t.size/2;break;case"end":case"line-right":o=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(o,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(o,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function I(e){var t,n,r,o;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,o=e.div.offsetTop;var l=(l=e.div.childNodes)&&(l=l[0])&&l.getClientRects&&l.getClientRects();e=e.div.getBoundingClientRect(),t=l?Math.max(l[0]&&l[0].height||0,e.height/l.length):0}this.left=e.left,this.right=e.right,this.top=e.top||o,this.height=e.height||n,this.bottom=e.bottom||o+(e.height||n),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function A(e,t,n,r){var o=new I(t),l=t.cue,h=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var track=e.track,t=track.textTrackList,n=0,i=0;i<t.length&&t[i]!==track;i++)"showing"===t[i].mode&&n++;return-1*++n}(l),d=[];if(l.snapToLines){var c;switch(l.vertical){case"":d=["+y","-y"],c="height";break;case"rl":d=["+x","-x"],c="width";break;case"lr":d=["-x","+x"],c="width"}var m=o.lineHeight,f=m*Math.round(h),y=n[c]+m,_=d[0];Math.abs(f)>y&&(f=f<0?-1:1,f*=Math.ceil(y/m)*m),h<0&&(f+=""===l.vertical?n.height:n.width,d=d.reverse()),o.move(_,f)}else{var v=o.lineHeight/n.height*100;switch(l.lineAlign){case"center":h-=v/2;break;case"end":h-=v}switch(l.vertical){case"":t.applyStyles({top:t.formatStyle(h,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(h,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(h,"%")})}d=["+y","-x","+x","-y"],o=new I(t)}var T=function(b,e){for(var t,o=new I(b),l=1,i=0;i<e.length;i++){for(;b.overlapsOppositeAxis(n,e[i])||b.within(n)&&b.overlapsAny(r);)b.move(e[i]);if(b.within(n))return b;var p=b.intersectPercentage(n);l>p&&(t=new I(b),l=p),b=new I(o)}return t||o}(o,d);t.move(T.toCSSCompatValues(n))}function D(){}k.prototype.applyStyles=function(e,div){for(var t in div=div||this.div,e)e.hasOwnProperty(t)&&(div.style[t]=e[t])},k.prototype.formatStyle=function(e,t){return 0===e?0:e+t},x.prototype=o(k.prototype),x.prototype.constructor=x,I.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},I.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},I.prototype.overlapsAny=function(e){for(var i=0;i<e.length;i++)if(this.overlaps(e[i]))return!0;return!1},I.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},I.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},I.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},I.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},I.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},D.StringDecoder=function(){return{decode:function(data){if(!data)return"";if("string"!=typeof data)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(data))}}},D.convertCueToDOMTree=function(e,t){return e&&t?S(e,t):null};D.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var i=0;i<e.length;i++)if(e[i].hasBeenReset||!e[i].displayState)return!0;return!1}(t)){var o=[],l=I.getSimpleBoxPosition(r),h={font:Math.round(.05*l.height*100)/100+"px sans-serif"};!function(){for(var n,d,i=0;i<t.length;i++)d=t[i],n=new x(e,d,h),r.appendChild(n.div),A(0,n,l,o),d.displayState=n.div,o.push(I.getSimpleBoxPosition(n))}()}else for(var i=0;i<t.length;i++)r.appendChild(t[i].displayState)},D.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},D.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof l))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(data){var e=this;function t(){for(var t=e.buffer,n=0;n<t.length&&"\r"!==t[n]&&"\n"!==t[n];)++n;var line=t.substr(0,n);return"\r"===t[n]&&++n,"\n"===t[n]&&++n,e.buffer=t.substr(n),line}function n(input){input.match(/X-TIMESTAMP-MAP/)?c(input,function(t,n){if("X-TIMESTAMP-MAP"===t)!function(input){var t=new d;c(input,function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",h(n))}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(n)},/=/):c(input,function(t,n){if("Region"===t)!function(input){var t=new d;if(c(input,function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var r=n.split(",");if(2!==r.length)break;var o=new d;if(o.percent("x",r[0]),o.percent("y",r[1]),!o.has("x")||!o.has("y"))break;t.set(e+"X",o.get("x")),t.set(e+"Y",o.get("y"));break;case"scroll":t.alt(e,n,["up"])}},/=/,/\s/),t.has("id")){var n=new(e.vttjs.VTTRegion||e.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),e.onregion&&e.onregion(n),e.regi
vendor: 10,172 bytes, line 2
2onList.push({id:t.get("id"),region:n})}}(n)},/:/)}data&&(e.buffer+=e.decoder.decode(data,{stream:!0}));try{var line;if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var r=(line=t()).match(/^WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new l(l.Errors.BadSignature);e.state="HEADER"}for(var o=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(o?o=!1:line=t(),e.state){case"HEADER":/:/.test(line)?n(line):line||(e.state="ID");continue;case"NOTE":line||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(line)){e.state="NOTE";break}if(!line)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch(t){e.cue.align="middle"}if(e.state="CUE",-1===line.indexOf("--\x3e")){e.cue.id=line;continue}case"CUE":try{m(line,e.cue,e.regionList)}catch(t){e.reportOrThrowError(t),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=-1!==line.indexOf("--\x3e");if(!line||f&&(o=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+="\n"),e.cue.text+=line.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":line||(e.state="ID");continue}}}catch(t){e.reportOrThrowError(t),"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new l(l.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=D},1960:function(e,t){var n={"":1,lr:1,rl:1},r={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function o(e){return"string"==typeof e&&(!!r[e.toLowerCase()]&&e.toLowerCase())}function l(e,t,text){this.hasBeenReset=!1;var r="",l=!1,h=e,d=t,c=text,m=null,f="",y=!0,_="auto",v="start",T="auto",S="auto",E=100,w="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return l},set:function(e){l=!!e}},startTime:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(e){c=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(e){var t=function(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return _},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");_=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return v},set:function(e){var t=o(e);t?(v=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return T},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");T=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return S},set:function(e){var t=o(e);t?(S=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return w},set:function(e){var t=o(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");w=t,this.hasBeenReset=!0}}}),this.displayState=void 0}l.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=l},1961:function(e,t){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,t=3,o=0,l=100,h=0,d=100,c="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");l=e}},regionAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");o=e}},viewportAnchorY:{enumerable:!0,get:function(){return d},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");d=e}},viewportAnchorX:{enumerable:!0,get:function(){return h},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");h=e}},scroll:{enumerable:!0,get:function(){return c},set:function(e){var t=function(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):c=t}}})}},1962:function(e,t,n){"use strict";n.d(t,"i",function(){return c}),n.d(t,"h",function(){return m}),n.d(t,"d",function(){return f}),n.d(t,"f",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return v}),n.d(t,"g",function(){return T}),n.d(t,"a",function(){return S}),n.d(t,"b",function(){return E});var r=n(1009),o=n.n(r),l={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},h=["video","audio","text"],d=["Video","Audio","Text"],c=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)}):e},m=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach(function(e){var t;e=e.trim(),h.forEach(function(r){var o=l[r].exec(e.toLowerCase());if(o&&!(o.length<=1)){t=r;var h=e.substring(0,o[1].length),details=e.replace(h,"");n.push({type:h,details:details,mediaType:r})}}),t||n.push({type:e,details:"",mediaType:"unknown"})}),n},f=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var o=n[r];if(o.default&&o.playlists)return m(o.playlists[0].attributes.CODECS)}return null},y=function(e){return void 0===e&&(e=""),l.audio.test(e.trim().toLowerCase())},_=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map(function(e){return c(e.trim())}),r="video";1===n.length&&y(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),l.text.test(t.trim().toLowerCase()))&&(r="application");var o="mp4";return n.every(function(e){return l.mp4.test(e)})?o="mp4":n.every(function(e){return l.webm.test(e)})?o="webm":n.every(function(e){return l.ogg.test(e)})&&(o="ogg"),r+"/"+o+';codecs="'+e+'"'}},v=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),o.a.MediaSource&&o.a.MediaSource.isTypeSupported&&o.a.MediaSource.isTypeSupported(_(e))||t&&o.a.ManagedMediaSource&&o.a.ManagedMediaSource.isTypeSupported&&o.a.ManagedMediaSource.isTypeSupported(_(e))||!1},T=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var i=0;i<d.length;i++){if(l["muxer"+d[i]].test(e))return!0}return!1})},S="mp4a.40.2",E="avc1.4d400d"},1963:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,o=/^application\/dash\+xml/i,l=function(e){return r.test(e)?"hls":o.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}},1964:function(e,t,n){var r=n(1719);t.DOMImplementation=r.DOMImplementation,t.XMLSerializer=r.XMLSerializer,t.DOMParser=n(1965).DOMParser},1965:function(e,t,n){var r=n(1339),o=n(1719),l=n(1966),h=n(1967),d=o.DOMImplementation,c=r.NAMESPACE,m=h.ParseError,f=h.XMLReader;function y(input){return input.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function _(e){this.options=e||{locator:{}}}function v(){this.cdata=!1}function T(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function S(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function E(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function w(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}_.prototype.parseFromString=function(source,e){var t=this.options,n=new f,r=t.domBuilder||new v,o=t.errorHandler,h=t.locator,d=t.xmlns||{},m=/\/x?html?$/.test(e),_=m?l.HTML_ENTITIES:l.XML_ENTITIES;h&&r.setDocumentLocator(h),n.errorHandler=function(e,t,n){if(!e){if(t instanceof v)return t;e=t}var r={},o=e instanceof Function;function l(t){var l=e[t];!l&&o&&(l=2==e.length?function(n){e(t,n)}:e),r[t]=l&&function(e){l("[xmldom "+t+"]\t"+e+S(n))}||function(){}}return n=n||{},l("warning"),l("error"),l("fatalError"),r}(o,r,h),n.domBuilder=t.domBuilder||r,m&&(d[""]=c.HTML),d.xml=d.xml||c.XML;var T=t.normalizeLineEndings||y;return source&&"string"==typeof source?n.parse(T(source),d,_):n.errorHandler.error("invalid doc source"),r.doc},v.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,l=o.createElementNS(e,n||t),h=r.length;w(this,l),this.currentElement=l,this.locator&&T(this.locator,l);for(var i=0;i<h;i++){e=r.getURI(i);var d=r.getValue(i),c=(n=r.getQName(i),o.createAttributeNS(e,n));
vendor: 1,828 bytes, line 2
2this.locator&&T(r.getLocator(i),c),c.value=c.nodeValue=d,l.setAttributeNode(c)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,data){var ins=this.doc.createProcessingInstruction(e,data);this.locator&&T(this.locator,ins),w(this,ins)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=E.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&T(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=E.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&T(this.locator,r),w(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var dt=r.createDocumentType(e,t,n);this.locator&&T(this.locator,dt),w(this,dt),this.doc.doctype=dt}},warning:function(e){console.warn("[xmldom warning]\t"+e,S(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,S(this.locator))},fatalError:function(e){throw new m(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){v.prototype[e]=function(){return null}}),t.__DOMHandler=v,t.normalizeLineEndings=y,t.DOMParser=_},1966:function(e,t,n){"use strict";var r=n(1339).freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r
vendor: 28,727 bytes, line 2
2({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),
vendor: 6,588 bytes, line 2
2t.entityMap=t.HTML_ENTITIES},1967:function(e,t,n){var r=n(1339).NAMESPACE,o=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,l=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),h=new RegExp("^"+o.source+l.source+"*(?::"+o.source+l.source+"*)?$");function d(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,d)}function c(){}function m(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function f(source,e,t,n,o,l){function h(e,n,r){t.attributeNames.hasOwnProperty(e)&&l.fatalError("Attribute "+e+" redefined"),t.addValue(e,n.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),r)}for(var d,p=++e,s=0;;){var c=source.charAt(p);switch(c){case"=":if(1===s)d=source.slice(e,p),s=3;else{if(2!==s)throw new Error("attribute equal must after attrName");s=3}break;case"'":case'"':if(3===s||1===s){if(1===s&&(l.warning('attribute value must after "="'),d=source.slice(e,p)),e=p+1,!((p=source.indexOf(c,e))>0))throw new Error("attribute value no end '"+c+"' match");h(d,m=source.slice(e,p),e-1),s=5}else{if(4!=s)throw new Error('attribute value must after "="');h(d,m=source.slice(e,p),e),l.warning('attribute "'+d+'" missed start quot('+c+")!!"),e=p+1,s=5}break;case"/":switch(s){case 0:t.setTagName(source.slice(e,p));case 5:case 6:case 7:s=7,t.closed=!0;case 4:case 1:break;case 2:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return l.error("unexpected end of input"),0==s&&t.setTagName(source.slice(e,p)),p;case">":switch(s){case 0:t.setTagName(source.slice(e,p));case 5:case 6:case 7:break;case 4:case 1:"/"===(m=source.slice(e,p)).slice(-1)&&(t.closed=!0,m=m.slice(0,-1));case 2:2===s&&(m=d),4==s?(l.warning('attribute "'+m+'" missed quot(")!'),h(d,m,e)):(r.isHTML(n[""])&&m.match(/^(?:disabled|checked|selected)$/i)||l.warning('attribute "'+m+'" missed value!! "'+m+'" instead!!'),h(m,m,e));break;case 3:throw new Error("attribute value missed!!")}return p;case"€":c=" ";default:if(c<=" ")switch(s){case 0:t.setTagName(source.slice(e,p)),s=6;break;case 1:d=source.slice(e,p),s=2;break;case 4:var m=source.slice(e,p);l.warning('attribute "'+m+'" missed quot(")!!'),h(d,m,e);case 5:s=6}else switch(s){case 2:t.tagName;r.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||l.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),h(d,d,e),e=p,s=1;break;case 5:l.warning('attribute space is required"'+d+'"!!');case 6:s=1,e=p;break;case 3:s=4,e=p;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}p++}}function y(e,t,n){for(var o=e.tagName,l=null,i=e.length;i--;){var a=e[i],h=a.qName,d=a.value;if((y=h.indexOf(":"))>0)var c=a.prefix=h.slice(0,y),m=h.slice(y+1),f="xmlns"===c&&m;else m=h,c=null,f="xmlns"===h&&"";a.localName=m,!1!==f&&(null==l&&(l={},T(n,n={})),n[f]=l[f]=d,a.uri=r.XMLNS,t.startPrefixMapping(f,d))}for(i=e.length;i--;){(c=(a=e[i]).prefix)&&("xml"===c&&(a.uri=r.XML),"xmlns"!==c&&(a.uri=n[c||""]))}var y;(y=o.indexOf(":"))>0?(c=e.prefix=o.slice(0,y),m=e.localName=o.slice(y+1)):(c=null,m=e.localName=o);var _=e.uri=n[c||""];if(t.startElement(_,m,o,e),!e.closed)return e.currentNSMap=n,e.localNSMap=l,!0;if(t.endElement(_,m,o),l)for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&t.endPrefixMapping(c)}function _(source,e,t,n,r){if(/^(?:script|textarea)$/i.test(t)){var o=source.indexOf("</"+t+">",e),text=source.substring(e+1,o);if(/[&<]/.test(text))return/^script$/i.test(t)?(r.characters(text,0,text.length),o):(text=text.replace(/&#?\w+;/g,n),r.characters(text,0,text.length),o)}return e+1}function v(source,e,t,n){var r=n[t];return null==r&&((r=source.lastIndexOf("</"+t+">"))<e&&(r=source.lastIndexOf("</"+t)),n[t]=r),r<e}function T(source,e){for(var t in source)Object.prototype.hasOwnProperty.call(source,t)&&(e[t]=source[t])}function S(source,e,t,n){if("-"===source.charAt(e+2))return"-"===source.charAt(e+3)?(r=source.indexOf("--\x3e",e+4))>e?(t.comment(source,e+4,r-e-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==source.substr(e+3,6)){var r=source.indexOf("]]>",e+9);return t.startCDATA(),t.characters(source,e+9,r-e-9),t.endCDATA(),r+3}var o=function(source,e){var t,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=e,r.exec(source);for(;t=r.exec(source);)if(n.push(t),t[1])return n}(source,e),l=o.length;if(l>1&&/!doctype/i.test(o[0][0])){var h=o[1][0],d=!1,c=!1;l>3&&(/^public$/i.test(o[2][0])?(d=o[3][0],c=l>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var m=o[l-1];return t.startDTD(h,d,c),t.endDTD(),m.index+m[0].length}return-1}function E(source,e,t){var n=source.indexOf("?>",e);if(n){var r=source.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return t.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function w(){this.attributeNames={}}d.prototype=new Error,d.prototype.name=d.name,c.prototype={parse:function(source,e,t){var n=this.domBuilder;n.startDocument(),T(e,e={}),function(source,e,t,n,o){function l(code){if(code>65535){var e=55296+((code-=65536)>>10),t=56320+(1023&code);return String.fromCharCode(e,t)}return String.fromCharCode(code)}function h(a){var e=a.slice(1,-1);return Object.hasOwnProperty.call(t,e)?t[e]:"#"===e.charAt(0)?l(parseInt(e.substr(1).replace("x","0x"))):(o.error("entity not found:"+a),a)}function c(e){if(e>O){var t=source.substring(O,e).replace(/&#?\w+;/g,h);I&&T(O),n.characters(t,0,e-O),O=e}}function T(p,e){for(;p>=k&&(e=x.exec(source));)C=e.index,k=C+e[0].length,I.lineNumber++;I.columnNumber=p-C+1}var C=0,k=0,x=/.*(?:\r\n?|\n)|.*$/g,I=n.locator,A=[{currentNSMap:e}],D={},O=0;for(;;){try{var P=source.indexOf("<",O);if(P<0){if(!source.substr(O).match(/^\s*$/)){var L=n.doc,text=L.createTextNode(source.substr(O));L.appendChild(text),n.currentElement=text}return}switch(P>O&&c(P),source.charAt(P+1)){case"/":var R=source.indexOf(">",P+3),N=source.substring(P+2,R).replace(/[ \t\n\r]+$/g,""),M=A.pop();R<0?(N=source.substring(P+2).replace(/[\s<].*/,""),o.error("end tag name: "+N+" is not complete:"+M.tagName),R=P+1+N.length):N.match(/\s</)&&(N=N.replace(/[\s<].*/,""),o.error("end tag name: "+N+" maybe not complete"),R=P+1+N.length);var U=M.localNSMap,B=M.tagName==N;if(B||M.tagName&&M.tagName.toLowerCase()==N.toLowerCase()){if(n.endElement(M.uri,M.localName,N),U)for(var F in U)Object.prototype.hasOwnProperty.call(U,F)&&n.endPrefixMapping(F);B||o.fatalError("end tag name: "+N+" is not match the current start tagName:"+M.tagName)}else A.push(M);R++;break;
vendor: 9,573 bytes, line 2
2case"?":I&&T(P),R=E(source,P,n);break;case"!":I&&T(P),R=S(source,P,n,o);break;default:I&&T(P);var j=new w,$=A[A.length-1].currentNSMap,V=(R=f(source,P,j,$,h,o),j.length);if(!j.closed&&v(source,R,j.tagName,D)&&(j.closed=!0,t.nbsp||o.warning("unclosed xml attribute")),I&&V){for(var H=m(I,{}),i=0;i<V;i++){var a=j[i];T(a.offset),a.locator=m(I,{})}n.locator=H,y(j,n,$)&&A.push(j),n.locator=I}else y(j,n,$)&&A.push(j);r.isHTML(j.uri)&&!j.closed?R=_(source,R,j.tagName,h,n):R++}}catch(e){if(e instanceof d)throw e;o.error("element parse error: "+e),R=-1}R>O?O=R:c(Math.max(P,O)+1)}}(source,e,t,n,this.errorHandler),n.endDocument()}},w.prototype={setTagName:function(e){if(!h.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!h.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}},t.XMLReader=c,t.ParseError=d},1968:function(e,t,n){var r=n(1969).getUint64;e.exports=function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),references:[],referenceId:view.getUint32(4),timescale:view.getUint32(8)},i=12;0===e.version?(e.earliestPresentationTime=view.getUint32(i),e.firstOffset=view.getUint32(i+4),i+=8):(e.earliestPresentationTime=r(data.subarray(i)),e.firstOffset=r(data.subarray(i+8)),i+=16),i+=2;var t=view.getUint16(i);for(i+=2;t>0;i+=12,t--)e.references.push({referenceType:(128&data[i])>>>7,referencedSize:2147483647&view.getUint32(i),subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(128&data[i+8]),sapType:(112&data[i+8])>>>4,sapDeltaTime:268435455&view.getUint32(i+8)});return e}},1969:function(e,t){var n=Math.pow(2,32);e.exports={getUint64:function(e){var t,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(t=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:r.getUint32(0)*n+r.getUint32(4)},MAX_UINT32:n}},1970:function(e,t){var n,r,o,l,h,d,c,m=9e4;n=function(e){return e*m},r=function(e,t){return e*t},o=function(e){return e/m},l=function(e,t){return e/t},h=function(e,t){return n(l(e,t))},d=function(e,t){return r(o(e),t)},c=function(e,t,n){return o(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:m,secondsToVideoTs:n,secondsToAudioTs:r,videoTsToSeconds:o,audioTsToSeconds:l,audioTsToVideoTs:h,videoTsToAudioTs:d,metadataTsToSeconds:c}},2116:function(e,t,n){"use strict";n.d(t,"a",function(){return O}),n.d(t,"b",function(){return P});var r,o=n(1036),l=(new Uint8Array([79,112,117,115,72,101,97,100]),function(path){return"string"==typeof path?Object(o.h)(path):path}),h=function(e){e=Object(o.k)(e);for(var t=[],i=0;e.length>i;){var n=e[i],l=0,h=0,d=e[++h];for(h++;128&d;)l=(127&d)<<7,d=e[h],h++;l+=127&d;for(var c=0;c<r.length;c++){var m=r[c],f=m.id,y=m.parser;if(n===f){t.push(y(e.subarray(h,h+l)));break}}i+=l+h}return t};r=[{id:3,parser:function(e){var desc={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&desc.flags&&(desc.dependsOnEsId=e[desc.size]<<8|e[desc.size+1],desc.size+=2),64&desc.flags){var t=e[desc.size];desc.url=Object(o.c)(e.subarray(desc.size+1,desc.size+1+t)),desc.size+=t}return 32&desc.flags&&(desc.ocrEsId=e[desc.size]<<8|e[desc.size+1],desc.size+=2),desc.descriptors=h(e.subarray(desc.size))||[],desc}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:h(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var d=function e(t,n,r){void 0===r&&(r=!1),n=function(e){return Array.isArray(e)?e.map(function(p){return l(p)}):[l(e)]}(n),t=Object(o.k)(t);var h=[];if(!n.length)return h;for(var i=0;i<t.length;){var d=(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0,c=t.subarray(i+4,i+8);if(0===d)break;var m=i+d;if(m>t.length){if(r)break;m=t.length}var data=t.subarray(i+8,m);Object(o.a)(c,n[0])&&(1===n.length?h.push(data):h.push.apply(h,e(data,n.slice(1),r))),i=m}return h},c={EBML:Object(o.k)([26,69,223,163]),DocType:Object(o.k)([66,130]),Segment:Object(o.k)([24,83,128,103]),SegmentInfo:Object(o.k)([21,73,169,102]),Tracks:Object(o.k)([22,84,174,107]),Track:Object(o.k)([174]),TrackNumber:Object(o.k)([215]),DefaultDuration:Object(o.k)([35,227,131]),TrackEntry:Object(o.k)([174]),TrackType:Object(o.k)([131]),FlagDefault:Object(o.k)([136]),CodecID:Object(o.k)([134]),CodecPrivate:Object(o.k)([99,162]),VideoTrack:Object(o.k)([224]),AudioTrack:Object(o.k)([225]),Cluster:Object(o.k)([31,67,182,117]),Timestamp:Object(o.k)([231]),TimestampScale:Object(o.k)([42,215,177]),BlockGroup:Object(o.k)([160]),BlockDuration:Object(o.k)([155]),Block:Object(o.k)([161]),SimpleBlock:Object(o.k)([163])},m=[128,64,32,16,8,4,2,1],f=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var l=function(e){for(var t=1,i=0;i<m.length&&!(e&m[i]);i++)t++;return t}(e[t]),h=e.subarray(t,t+l);return n&&((h=Array.prototype.slice.call(e,t,t+l))[0]^=m[l-1]),{length:l,value:Object(o.b)(h,{signed:r}),bytes:h}},y=function e(path){return"string"==typeof path?path.match(/.{1,2}/g).map(function(p){return e(p)}):"number"==typeof path?Object(o.f)(path):path},_=function e(t,n,r){if(r>=n.length)return n.length;var l=f(n,r,!1);if(Object(o.a)(t.bytes,l.bytes))return r;var h=f(n,r+l.length);return e(t,n,r+h.length+h.value+l.length)},v=function e(t,n){n=function(e){return Array.isArray(e)?e.map(function(p){return y(p)}):[y(e)]}(n),t=Object(o.k)(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var l=f(t,i,!1),h=f(t,i+l.length),d=i+l.length+h.length;127===h.value&&(h.value=_(l,t,d),h.value!==t.length&&(h.value-=d));var c=d+h.value>t.length?t.length:d+h.value,data=t.subarray(d,c);Object(o.a)(n[0],l.bytes)&&(1===n.length?r.push(data):r=r.concat(e(data,n.slice(1)))),i+=l.length+h.length+data.length}return r},T=n(1720),S=Object(o.k)([0,0,0,1]),E=Object(o.k)([0,0,1]),w=Object(o.k)([0,0,3]),C=function(e){for(var t=[],i=1;i<e.length-2;)Object(o.a)(e.subarray(i,i+3),w)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),l=0;for(i=0;i<n;l++,i++)l===t[0]&&(l++,t.shift()),r[i]=e[l];return r},k=function(e,t,n,r){void 0===r&&(r=1/0),e=Object(o.k)(e),n=[].concat(n);for(var l,i=0,h=0;i<e.length&&(h<r||l);){var d=void 0;if(Object(o.a)(e.subarray(i),S)?d=4:Object(o.a)(e.subarray(i),E)&&(d=3),d){if(h++,l)return C(e.subarray(l,i));var c=void 0;"h264"===t?c=31&e[i+d]:"h265"===t&&(c=e[i+d]>>1&63),-1!==n.indexOf(c)&&(l=i+d),i+=d+("h264"===t?1:2)}else i++}return e.subarray(0,0)},x={webm:Object(o.k)([119,101,98,109]),matroska:Object(o.k)([109,97,116,114,111,115,107,97]),flac:Object(o.k)([102,76,97,67]),ogg:Object(o.k)([79,103,103,83]),ac3:Object(o.k)([11,119]),riff:Object(o.k)([82,73,70,70]),avi:Object(o.k)([65,86,73]),wav:Object(o.k)([87,65,86,69]),"3gp":Object(o.k)([102,116,121,112,51,103]),mp4:Object(o.k)([102,116,121,112]),fmp4:Object(o.k)([115,116,121,112]),mov:Object(o.k)([102,116,121,112,113,116]),moov:Object(o.k)([109,111,111,118]),moof:Object(o.k)([109,111,111,102])},I={aac:function(e){var t=Object(T.a)(e);return Object(o.a)(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(T.a)(e);return Object(o.a)(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=v(e,[c.EBML,c.DocType])[0];return Object(o.a)(t,x.webm)},mkv:function(e){var t=v(e,[c.EBML,c.DocType])[0];return Object(o.a)(t,x.matroska)},mp4:function(e){return!I["3gp"](e)&&!I.mov(e)&&(!(!Object(o.a)(e,x.mp4,{offset:4})&&!Object(o.a)(e,x.fmp4,{offset:4}))||(!(!Object(o.a)(e,x.moof,{offset:4})&&!Object(o.a)(e,x.moov,{offset:4}))||void 0))},mov:function(e){return Object(o.a)(e,x.mov,{offset:4})},"3gp":function(e){return Object(o.a)(e,x["3gp"],{offset:4})},ac3:function(e){var t=Object(T.a)(e);return Object(o.a)(e,x.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var i=0;i+188<e.length&&i<188;){if(71===e[i]&&71===e[i+188])return!0;i+=1}return!1},flac:function(e){var t=Object(T.a)(e);return Object(o.a)(e,x.flac,{offset:t})},ogg:function(e){return Object(o.a)(e,x.ogg)},avi:function(e){return Object(o.a)(e,x.riff)&&Object(o.a)(e,x.avi,{offset:8})},wav:function(e){return Object(o.a)(e,x.riff)&&Object(o.a)(e,x.wav,{offset:8})},h264:function(e){return function(e,t,n){return k(e,"h264",t,n)}(e,7,3).length},h265:function(e){return function(e,t,n){return k(e,"h265",t,n)}(e,[32,33],3).length}},A=Object.keys(I).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);A.forEach(function(e){var t=I[e];I[e]=function(e){return t(Object(o.k)(e))}});var D=I,O=function(e){e=Object(o.k)(e);for(var i=0;i<A.length;i++){var t=A[i];if(D[t](e))return t}return""},P=function(e){return d(e,["moof"]).length>0}},2117:function(e,t,n){"use strict";n.d(t,"a",function(){return S});var r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);
vendor: 20,546 bytes, line 2
2else for(var r=Array.prototype.slice.call(arguments,1),o=t.length,l=0;l<o;++l)t[l].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(data){e.push(data)})},e}(),o=n(1350),l=n.n(o),h=n(1718);class d extends r{constructor(){super(),this.buffer=""}push(data){let e;for(this.buffer+=data,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)}}const c=String.fromCharCode(9),m=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},f=function(e){const t={};if(!e)return t;const n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r,i=n.length;for(;i--;)""!==n[i]&&(r=/([^=]*)=(.*)/.exec(n[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),t[r[0]]=r[1]);return t},y=e=>{const t=e.split("x"),n={};return t[0]&&(n.width=parseInt(t[0],10)),t[1]&&(n.height=parseInt(t[1],10)),n};class _ extends r{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(line){let e,t;if(0===(line=line.trim()).length)return;if("#"!==line[0])return void this.trigger("data",{type:"uri",uri:line});this.tagMappers.reduce((e,t)=>{const n=t(line);return n===line?e:e.concat([n])},[line]).forEach(n=>{for(let i=0;i<this.customParsers.length;i++)if(this.customParsers[i].call(this,n))return;if(0===n.indexOf("#EXT"))if(n=n.replace("\r",""),e=/^#EXTM3U/.exec(n),e)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),e)return t={type:"tag",tagType:"inf"},e[1]&&(t.duration=parseFloat(e[1])),e[2]&&(t.title=e[2]),void this.trigger("data",t);if(e=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),e)return t={type:"tag",tagType:"targetduration"},e[1]&&(t.duration=parseInt(e[1],10)),void this.trigger("data",t);if(e=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),e)return t={type:"tag",tagType:"version"},e[1]&&(t.version=parseInt(e[1],10)),void this.trigger("data",t);if(e=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),e)return t={type:"tag",tagType:"media-sequence"},e[1]&&(t.number=parseInt(e[1],10)),void this.trigger("data",t);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),e)return t={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(t.number=parseInt(e[1],10)),void this.trigger("data",t);if(e=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),e)return t={type:"tag",tagType:"playlist-type"},e[1]&&(t.playlistType=e[1]),void this.trigger("data",t);if(e=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),e)return t=l()(m(e[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",t);if(e=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),e)return t={type:"tag",tagType:"allow-cache"},e[1]&&(t.allowed=!/NO/.test(e[1])),void this.trigger("data",t);if(e=/^#EXT-X-MAP:(.*)$/.exec(n),e){if(t={type:"tag",tagType:"map"},e[1]){const n=f(e[1]);n.URI&&(t.uri=n.URI),n.BYTERANGE&&(t.byterange=m(n.BYTERANGE))}this.trigger("data",t)}else{if(e=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),e)return t={type:"tag",tagType:"stream-inf"},e[1]&&(t.attributes=f(e[1]),t.attributes.RESOLUTION&&(t.attributes.RESOLUTION=y(t.attributes.RESOLUTION)),t.attributes.BANDWIDTH&&(t.attributes.BANDWIDTH=parseInt(t.attributes.BANDWIDTH,10)),t.attributes["FRAME-RATE"]&&(t.attributes["FRAME-RATE"]=parseFloat(t.attributes["FRAME-RATE"])),t.attributes["PROGRAM-ID"]&&(t.attributes["PROGRAM-ID"]=parseInt(t.attributes["PROGRAM-ID"],10))),void this.trigger("data",t);if(e=/^#EXT-X-MEDIA:(.*)$/.exec(n),e)return t={type:"tag",tagType:"media"},e[1]&&(t.attributes=f(e[1])),void this.trigger("data",t);if(e=/^#EXT-X-ENDLIST/.exec(n),e)this.trigger("data",{type:"tag",tagType:"endlist"});else if(e=/^#EXT-X-DISCONTINUITY/.exec(n),e)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(e=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),e)return t={type:"tag",tagType:"program-date-time"},e[1]&&(t.dateTimeString=e[1],t.dateTimeObject=new Date(e[1])),void this.trigger("data",t);if(e=/^#EXT-X-KEY:(.*)$/.exec(n),e)return t={type:"tag",tagType:"key"},e[1]&&(t.attributes=f(e[1]),t.attributes.IV&&("0x"===t.attributes.IV.substring(0,2).toLowerCase()&&(t.attributes.IV=t.attributes.IV.substring(2)),t.attributes.IV=t.attributes.IV.match(/.{8}/g),t.attributes.IV[0]=parseInt(t.attributes.IV[0],16),t.attributes.IV[1]=parseInt(t.attributes.IV[1],16),t.attributes.IV[2]=parseInt(t.attributes.IV[2],16),t.attributes.IV[3]=parseInt(t.attributes.IV[3],16),t.attributes.IV=new Uint32Array(t.attributes.IV))),void this.trigger("data",t);if(e=/^#EXT-X-START:(.*)$/.exec(n),e)return t={type:"tag",tagType:"start"},e[1]&&(t.attributes=f(e[1]),t.attributes["TIME-OFFSET"]=parseFloat(t.attributes["TIME-OFFSET"]),t.attributes.PRECISE=/YES/.test(t.attributes.PRECISE)),void this.trigger("data",t);if(e=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),e)return t={type:"tag",tagType:"cue-out-cont"},e[1]?t.data=e[1]:t.data="",void this.trigger("data",t);if(e=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),e)return t={type:"tag",tagType:"cue-out"},e[1]?t.data=e[1]:t.data="",void this.trigger("data",t);if(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),e)return t={type:"tag",tagType:"cue-in"},e[1]?t.data=e[1]:t.data="",void this.trigger("data",t);if(e=/^#EXT-X-SKIP:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"skip"},t.attributes=f(e[1]),t.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(t.attributes["SKIPPED-SEGMENTS"]=parseInt(t.attributes["SKIPPED-SEGMENTS"],10)),t.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(t.attributes["RECENTLY-REMOVED-DATERANGES"]=t.attributes["RECENTLY-REMOVED-DATERANGES"].split(c)),void this.trigger("data",t);if(e=/^#EXT-X-PART:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"part"},t.attributes=f(e[1]),["DURATION"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=parseFloat(t.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=/YES/.test(t.attributes[e]))}),t.attributes.hasOwnProperty("BYTERANGE")&&(t.attributes.byterange=m(t.attributes.BYTERANGE)),void this.trigger("data",t);if(e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"server-control"},t.attributes=f(e[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=parseFloat(t.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=/YES/.test(t.attributes[e]))}),void this.trigger("data",t);if(e=/^#EXT-X-PART-INF:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"part-inf"},t.attributes=f(e[1]),["PART-TARGET"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=parseFloat(t.attributes[e]))}),void this.trigger("data",t);if(e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"preload-hint"},t.attributes=f(e[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(t.attributes.hasOwnProperty(e)){t.attributes[e]=parseInt(t.attributes[e],10);const n="BYTERANGE-LENGTH"===e?"length":"offset";t.attributes.byterange=t.attributes.byterange||{},t.attributes.byterange[n]=t.attributes[e],delete t.attributes[e]}}),void this.trigger("data",t);if(e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),e&&e[1])return t={type:"tag",tagType:"rendition-report"},t.attributes=f(e[1]),["LAST-MSN","LAST-PART"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=parseInt(t.attributes[e],10))}),void this.trigger("data",t);if(e=/^#EXT-X-DATERANGE:(.*)$/.exec(n),e&&e[1]){t={type:"tag",tagType:"daterange"},t.attributes=f(e[1]),["ID","CLASS"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=String(t.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=new Date(t.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=parseFloat(t.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=/YES/i.test(t.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){t.attributes.hasOwnProperty(e)&&(t.attributes[e]=t.attributes[e].toString(16))});const n=/^X-([A-Z]+-)+[A-Z]+$/;for(const e in t.attributes){if(!n.test(e))continue;const r=/[0-9A-Fa-f]{6}/g.test(t.attributes[e]),o=/^\d+(\.\d+)?$/.test(t.attributes[e]);t.attributes[e]=r?t.attributes[e].toString(16):o?parseFloat(t.attributes[e]):String(t.attributes[e])}return void this.trigger("data",t)}if(e=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),e)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(e=/^#EXT-X-I-FRAMES-ONLY/.exec(n),e)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(e=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),e)return t={type:"tag",tagType:"content-steering"},t.attributes=f(e[1]),void this.trigger("data",t);if(e=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),e)return t={type:"tag",tagType:"i-frame-playlist"},t.attributes=f(e[1]),t.attributes.URI&&(t.uri=t.attributes.URI),t.attributes.BANDWIDTH&&(t.attributes.BANDWIDTH=parseInt(t.attributes.BANDWIDTH,10)),t.attributes.RESOLUTION&&(t.attributes.RESOLUTION=y(t.attributes.RESOLUTION)),t.attributes["AVERAGE-BANDWIDTH"]&&(t.attributes["AVERAGE-BANDWIDTH"]=parseInt(t.attributes["AVERAGE-BANDWIDTH"],10)),t.attributes["FRAME-RATE"]&&(t.attributes["FRAME-RATE"]=parseFloat(t.attributes["FRAME-RATE"])),void this.trigger("data",t);if(e=/^#EXT-X-DEFINE:(.*)$/.exec(n),e)return t={type:"tag",tagType:"define"},t.attributes=f(e[1]),void this.trigger("data",t);this.trigger("data",{type:"tag",data:n.slice(4)})}}}}else this.trigger("data",{type:"comment",text:n.slice(1)})})}addParser({expression:e,customType:t,dataParser:n,segment:r}){"function"!=typeof n&&(n=line=>line),this.customParsers.push(line=>{if(e.exec(line))return this.trigger("data",{type:"custom",data:n(line),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:map}){this.tagMappers.push(line=>e.test(line)?map(line):line)}}const v=function(e){const t={};return Object.keys(e).forEach(function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,a=>a[1].toUpperCase()))]=e[n]}),t},T=function(e){const{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;const o="#EXT-X-SERVER-CONTROL",l="holdBack",h="partHoldBack",d=n&&3*n,c=r&&2*r;n&&!t.hasOwnProperty(l)&&(t[l]=d,this.trigger("info",{message:`${o} defaulting HOLD-BACK to targetDuration * 3 (${d}).`})),d&&t[l]<d&&(this.trigger("warn",{message:`${o} clamping HOLD-BACK (${t[l]}) to targetDuration * 3 (${d})`}),t[l]=d),r&&!t.hasOwnProperty(h)&&(t[h]=3*r,this.trigger("info",{message:`${o} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[h]}).`})),r&&t[h]<c&&(this.trigger("warn",{message:`${o} clamping PART-HOLD-BACK (${t[h]}) to partTargetDuration * 2 (${c}).`}),t[h]=c)};class S extends r{constructor(e={}){super(),this.lineStream=new d,this.parseStream=new _,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,n=[];let r,o,c={},m=!1;const f=function(){},y={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let S=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let E=0,w=0;const C={};this.on("end",()=>{c.uri||!c.parts&&!c.preloadHints||(!c.map&&r&&(c.map=r),!c.key&&o&&(c.key=o),c.timeline||"number"!=typeof S||(c.timeline=S),this.manifest.preloadSegment=c)}),this.parseStream.on("data",function(e){let d,_;if(t.manifest.definitions)for(const n in t.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${n}}`,t.manifest.definitions[n])),e.attributes)for(const r in e.attributes)"string"==typeof e.attributes[r]&&(e.attributes[r]=e.attributes[r].replace(`{$${n}}`,t.manifest.definitions[n]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in e&&(c.byterange=t,t.length=e.length,"offset"in e||(e.offset=E)),"offset"in e&&(c.byterange=t,t.offset=e.offset),E=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(c.title=e.title),e.duration>0&&(c.duration=e.duration),0===e.duration&&(c.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(h.a)(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(o.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else o=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,S=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){r={},e.uri&&(r.uri=e.uri),e.byterange&&(r.byterange=e.byterange),o&&(r.key=o)},"stream-inf"(){this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||y,e.attributes?(c.attributes||(c.attributes={}),l()(c.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||y,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},d=t[e.attributes["GROUP-ID"]],_={default:/yes/i.test(e.attributes.DEFAULT)},_.default?_.autoselect=!0:_.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(_.language=e.attributes.LANGUAGE),e.attributes.URI&&(_.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(_.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(_.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(_.forced=/yes/i.test(e.attributes.FORCED)),d[e.attributes.NAME]=_},discontinuity(){S+=1,c.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),c.dateTimeString=e.dateTimeString,c.dateTimeObject=e.dateTimeObject;const{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,T.call(this,this.manifest))},start(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){c.cueOut=e.data},"cue-out-cont"(){c.cueOutCont=e.data},"cue-in"(){c.cueIn=e.data},skip(){this.manifest.skip=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){m=!0;const t=this.manifest.segments.length,n=v(e.attributes);c.parts=c.parts||[],c.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=w),w=n.byterange.offset+n.byterange.length);const r=c.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${r} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,i)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${i} lacks required attribute(s): LAST-PART`})})},"server-control"(){const t=this.manifest.serverControl=v(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),T.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,n=v(e.attributes),r=n.type&&"PART"===n.type;c.preloadHints=c.preloadHints||[],c.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=r?w:0,r&&(w=n.byterange.offset+n.byterange.length)));const o=c.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${o} for segment #${t}`,e.attributes,["TYPE","URI"]),n.type)for(let i=0;i<c.preloadHints.length-1;i++){const e=c.preloadHints[i];e.type&&(e.type===n.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${o} for segment #${t} has the same TYPE ${n.type} as preload hint #${i}`}))}},"rendition-report"(){const t=v(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const n=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];m&&r.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${n}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),T.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(v(e.attributes));const t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);const n=this.manifest.dateRanges[t];n.endDate&&n.startDate&&new Date(n.endDate)<new Date(n.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),n.duration&&n.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),n.plannedDuration&&n.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const r=!!n.endOnNext;if(r&&!n.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
2=YES attribute must have a CLASS attribute"}),r&&(n.duration||n.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),n.duration&&n.endDate){const e=n.startDate.getTime()+1e3*n.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(C[n.id]){for(const e in C[n.id])if(n[e]&&JSON.stringify(C[n.id][e])!==JSON.stringify(n[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex(e=>e.id===n.id);this.manifest.dateRanges[e]=l()(this.manifest.dateRanges[e],n),C[n.id]=l()(C[n.id],n),this.manifest.dateRanges.pop()}else C[n.id]=n},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=v(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const n=this.params.get(e.attributes.QUERYPARAM);return n?void t(e.attributes.QUERYPARAM,decodeURIComponent(n)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:S}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||f).call(t)},uri(){c.uri=e.uri,n.push(c),this.manifest.targetDuration&&!("duration"in c)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),c.duration=this.manifest.targetDuration),o&&(c.key=o),c.timeline=S,r&&(c.map=r),w=0,null!==this.lastProgramDateTime&&(c.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*c.duration),c={}},comment(){},custom(){e.segment?(c.custom=c.custom||{},c.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,n){const r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}},2118:function(e,t,n){"use strict";n.d(t,"a",function(){return O}),n.d(t,"b",function(){return B}),n.d(t,"c",function(){return ge}),n.d(t,"d",function(){return fe});var r=n(1717),o=n(1009),l=n.n(o),h=n(1718),d=n(1964);const c=e=>!!e&&"object"==typeof e,m=(...e)=>e.reduce((e,source)=>("object"!=typeof source||Object.keys(source).forEach(t=>{Array.isArray(e[t])&&Array.isArray(source[t])?e[t]=e[t].concat(source[t]):c(e[t])&&c(source[t])?e[t]=m(e[t],source[t]):e[t]=source[t]}),e),{}),f=e=>Object.keys(e).map(t=>e[t]),y=e=>e.reduce((e,t)=>
vendor: 16,666 bytes, line 2
2e.concat(t),[]),_=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var v="INVALID_NUMBER_OF_PERIOD",T="DASH_EMPTY_MANIFEST",S="DASH_INVALID_XML",E="NO_BASE_URL",w="SEGMENT_TIME_UNSPECIFIED",C="UNSUPPORTED_UTC_TIMING_SCHEME";const k=({baseUrl:e="",source:source="",range:t="",indexRange:n=""})=>{const o={uri:source,resolvedUri:Object(r.a)(e||"",source)};if(t||n){const e=(t||n).split("-");let r,h=l.a.BigInt?l.a.BigInt(e[0]):parseInt(e[0],10),d=l.a.BigInt?l.a.BigInt(e[1]):parseInt(e[1],10);h<Number.MAX_SAFE_INTEGER&&"bigint"==typeof h&&(h=Number(h)),d<Number.MAX_SAFE_INTEGER&&"bigint"==typeof d&&(d=Number(d)),r="bigint"==typeof d||"bigint"==typeof h?l.a.BigInt(d)-l.a.BigInt(h)+l.a.BigInt(1):d-h+1,"bigint"==typeof r&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),o.byterange={length:r,offset:h}}return o},x=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),I={static(e){const{duration:t,timescale:n=1,sourceDuration:r,periodDuration:o}=e,l=x(e.endNumber),h=t/n;return"number"==typeof l?{start:0,end:l}:"number"==typeof o?{start:0,end:o/h}:{start:0,end:r/h}},dynamic(e){const{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:o=1,duration:l,periodStart:h=0,minimumUpdatePeriod:d=0,timeShiftBufferDepth:c=1/0}=e,m=x(e.endNumber),f=(t+n)/1e3,y=r+h,_=f+d-y,v=Math.ceil(_*o/l),T=Math.floor((f-y-c)*o/l),S=Math.floor((f-y)*o/l);return{start:Math.max(0,T),end:"number"==typeof m?m:Math.min(v,S)}}},A=e=>{const{type:t,duration:n,timescale:r=1,periodDuration:o,sourceDuration:l}=e,{start:h,end:d}=I[t](e),c=((e,t)=>{const n=[];for(let i=e;i<t;i++)n.push(i);return n})(h,d).map((e=>t=>{const{duration:n,timescale:r=1,periodStart:o,startNumber:l=1}=e;return{number:l+t,duration:n/r,timeline:o,time:t*n}})(e));if("static"===t){const e=c.length-1,t="number"==typeof o?o:l;c[e].duration=t-n/r*e}return c},D=e=>{const{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:o="",periodStart:l,presentationTime:h,number:d=0,duration:c}=e;if(!t)throw new Error(E);const m=k({baseUrl:t,source:n.sourceURL,range:n.range}),f=k({baseUrl:t,source:t,indexRange:o});if(f.map=m,c){const t=A(e);t.length&&(f.duration=t[0].duration,f.timeline=t[0].timeline)}else r&&(f.duration=r,f.timeline=l);return f.presentationTime=h||l,f.number=d,[f]},O=(e,t,n)=>{const r=e.sidx.map?e.sidx.map:null,o=e.sidx.duration,h=e.timeline||0,d=e.sidx.byterange,c=d.offset+d.length,m=t.timescale,f=t.references.filter(e=>1!==e.referenceType),y=[],_=e.endList?"static":"dynamic",v=e.sidx.timeline;let T,S=v,E=e.mediaSequence||0;T="bigint"==typeof t.firstOffset?l.a.BigInt(c)+t.firstOffset:c+t.firstOffset;for(let i=0;i<f.length;i++){const e=t.references[i],d=e.referencedSize,c=e.subsegmentDuration;let f;f="bigint"==typeof T?T+l.a.BigInt(d)-l.a.BigInt(1):T+d-1;const w=D({baseUrl:n,timescale:m,timeline:h,periodStart:v,presentationTime:S,number:E,duration:c,sourceDuration:o,indexRange:`${T}-${f}`,type:_})[0];r&&(w.map=r),y.push(w),T+="bigint"==typeof T?l.a.BigInt(d):d,S+=c/m,E++}return e.segments=y,e},P=["AUDIO","SUBTITLES"],L=1/60,R=e=>{return(t=e,n=({timeline:e})=>e,f(t.reduce((e,t)=>(t.forEach(t=>{e[n(t)]=t}),e),{}))).sort((a,b)=>a.timeline>b.timeline?1:-1);var t,n},N=e=>{let t=[];var n,r;return n=e,r=(e,n,r,label)=>{t=t.concat(e.playlists||[])},P.forEach(function(e){for(var t in n.mediaGroups[e])for(var o in n.mediaGroups[e][t]){var l=n.mediaGroups[e][t][o];r(l,e,t,o)}}),t},M=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,n)=>{t.number=e.mediaSequence+n})},U=({oldManifest:e,newManifest:t})=>{const n=e.playlists.concat(N(e)),r=t.playlists.concat(N(t));return t.timelineStarts=R([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach(t=>{t.discontinuitySequence=n.findIndex(function({timeline:e}){return e===t.timeline});const r=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!r)return;if(t.sidx)return;const o=t.segments[0],l=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-o.presentationTime)<L});if(-1===l)return M({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--);r.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),M({playlist:t,mediaSequence:r.segments[l].number})})})({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t},B=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?l.a.BigInt(e.offset)+l.a.BigInt(e.length)-l.a.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),F=e=>{const t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{});let n=[];return Object.values(t).forEach(e=>{const t=f(e.reduce((e,t)=>{const n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));n=n.concat(t)}),n.map(e=>{var t,n;return e.discontinuityStarts=(t=e.segments||[],n="discontinuity",t.reduce((a,e,i)=>(e[n]&&a.push(i),a),[])),e})},j=(e,t)=>{const n=B(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&O(e,r,e.sidx.resolvedUri),e},$=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=j(e[i],t);return e},V=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{const o={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(o.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),n&&(o.sidx=n),o},H=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,z=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,W=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,G=e=>e?Object.keys(e).reduce((t,label)=>{const n=e[label];return t.concat(n.playlists)},[]):[],X=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:o,eventStream:l})=>{if(!e.length)return{};const{sourceDuration:h,type:d,suggestedPresentationDelay:c,minimumUpdatePeriod:m}=e[0].attributes,f=F(e.filter(H)).map(V),y=F(e.filter(z)),_=F(e.filter(W)),v=e.map(e=>e.attributes.captionServices).filter(Boolean),T={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:h,playlists:$(f,r)};m>=0&&(T.minimumUpdatePeriod=1e3*m),t&&(T.locations=t),n&&(T.contentSteering=n),"dynamic"===d&&(T.suggestedPresentationDelay=c),l&&l.length>0&&(T.eventStream=l);const S=0===T.playlists.length,E=y.length?((e,t={},n=!1)=>{let r;const o=e.reduce((a,e)=>{const o=e.attributes.role&&e.attributes.role.value||"",l=e.attributes.lang||"";let label=e.attributes.label||"main";if(l&&!e.attributes.label){const t=o?` (${o})`:"";label=`${e.attributes.lang}${t}`}a[label]||(a[label]={language:l,autoselect:!0,default:"main"===o,playlists:[],uri:""});const h=j((({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:o,discontinuityStarts:l},h)=>{const d={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:o,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(d.contentProtection=e.contentProtection),e.serviceLocation&&(d.attributes.serviceLocation=e.serviceLocation),n&&(d.sidx=n),h&&(d.attributes.AUDIO="audio",d.attributes.SUBTITLES="subs"),d})(e,n),t);return a[label].playlists.push(h),void 0===r&&"main"===o&&(r=e,r.default=!0),a},{});r||(o[Object.keys(o)[0]].default=!0);return o})(y,r,S):null,w=_.length?((e,t={})=>e.reduce((a,e)=>{const label=e.attributes.label||e.attributes.lang||"text",n=e.attributes.lang||"und";return a[label]||(a[label]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),a[label].playlists.push(j((({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:o})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const l={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(l.CODECS=e.codecs);const h={attributes:l,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:o,mediaSequence:n,segments:t};return e.serviceLocation&&(h.attributes.serviceLocation=e.serviceLocation),h})(e),t)),a},{}))(_,r):null,C=f.concat(G(E),G(w)),k=C.map(({timelineStarts:e})=>e);var x,I;return T.timelineStarts=R(k),x=C,I=T.timelineStarts,x.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=I.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),E&&(T.mediaGroups.AUDIO.audio=E),w&&(T.mediaGroups.SUBTITLES.subs=w),v.length&&(T.mediaGroups["CLOSED-CAPTIONS"].cc=v.reduce((e,t)=>t?(t.forEach(t=>{const{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])}),e):e,{})),o?U({oldManifest:o,newManifest:T}):T},K=(e,time,t)=>{const{NOW:n,clientOffset:r,availabilityStartTime:o,timescale:l=1,periodStart:h=0,minimumUpdatePeriod:d=0}=e,c=(n+r)/1e3+d-(o+h);return Math.ceil((c*l-time)/t)},Y=(e,t)=>{const{type:n,minimumUpdatePeriod:r=0,media:o="",sourceDuration:l,timescale:h=1,startNumber:d=1,periodStart:c}=e,m=[];let time=-1;for(let f=0;f<t.length;f++){const y=t[f],_=y.d,v=y.r||0,T=y.t||0;let S;if(time<0&&(time=T),T&&T>time&&(time=T),v<0){const d=f+1;S=d===t.length?"dynamic"===n&&r>0&&o.indexOf("$Number$")>0?K(e,time,_):(l*h-time)/_:(t[d].t-time)/_}else S=v+1;const E=d+m.length+S;let w=d+m.length;for(;w<E;)m.push({number:w,duration:_/h,time:time,timeline:c}),time+=_,w++}return m},Q=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,J=(e,t)=>e.replace(Q,(e=>(t,n,r,o)=>{if("$$"===t)return"$";if(void 0===e[n])return t;const l=""+e[n];return"RepresentationID"===n?l:(o=r?parseInt(o,10):1,l.length>=o?l:`${new Array(o-l.length+1).join("0")}${l}`)})(t)),Z=(e,t)=>{const n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:o={sourceURL:"",range:""}}=e,l=k({baseUrl:e.baseUrl,source:J(o.sourceURL,n),range:o.range}),h=((e,t)=>e.duration||t?e.duration?A(e):Y(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return h.map(t=>{n.Number=t.number,n.Time=t.time;const o=J(e.media||"",n),h=e.timescale||1,d=e.presentationTimeOffset||0,c=e.periodStart+(t.time-d)/h;return{uri:o,timeline:t.timeline,duration:t.duration,resolvedUri:Object(r.a)(e.baseUrl||"",o),map:l,number:t.number,presentationTime:c}})},ee=(e,t)=>{const{duration:n,segmentUrls:r=[],periodStart:o}=e;if(!n&&!t||n&&t)throw new Error(w);const l=r.map(t=>((e,t)=>{const{baseUrl:n,initialization:r={}}=e,o=k({baseUrl:n,source:r.sourceURL,range:r.range}),l=k({baseUrl:n,source:t.media,range:t.mediaRange});return l.map=o,l})(e,t));let h;n&&(h=A(e)),t&&(h=Y(e,t));return h.map((t,n)=>{if(l[n]){const r=l[n],h=e.timescale||1,d=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=o+(t.time-d)/h,r}}).filter(e=>e)},te=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=Z,n=m(e,t.template)):t.base?(r=D,n=m(e,t.base)):t.list&&(r=ee,n=m(e,t.list));const o={attributes:e};if(!r)return o;const l=r(n,t.segmentTimeline);if(n.duration){const{duration:e,timescale:t=1}=n;n.duration=e/t}else l.length?n.duration=l.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):n.duration=0;return o.attributes=n,o.segments=l,t.base&&n.indexRange&&(o.sidx=l[0],o.segments=[]),o},ie=(element,e)=>_(element.childNodes).filter(({tagName:t})=>t===e),se=element=>element.textContent.trim(),ne=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[n,r,o,l,h,d]=t.slice(1);return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(o||0)+3600*parseFloat(l||0)+60*parseFloat(h||0)+parseFloat(d||0)},re={mediaPresentationDuration:e=>ne(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>ne(e),suggestedPresentationDelay:e=>ne(e),type:e=>e,timeShiftBufferDepth:e=>ne(e),start:e=>ne(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce((e,t)=>e/t)))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?ne(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},ae=e=>e&&e.attributes?_(e.attributes).reduce((a,e)=>{const t=re[e.name]||re.DEFAULT;return a[e.name]=t(e.value),a},{}):{},oe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},le=(e,t)=>t.length?y(e.map(function(e){return t.map(function(t){const n=se(t),o=Object(r.a)(e.baseUrl,n),l=m(ae(t),{baseUrl:o});return o!==n&&!l.serviceLocation&&e.serviceLocation&&(l.serviceLocation=e.serviceLocation),l})})):e,ue=e=>{const t=ie(e,"SegmentTemplate")[0],n=ie(e,"SegmentList")[0],r=n&&ie(n,"SegmentURL").map(s=>m({tag:"SegmentURL"},ae(s))),o=ie(e,"SegmentBase")[0],l=n||t,h=l&&ie(l,"SegmentTimeline")[0],d=n||o||t,c=d&&ie(d,"Initialization")[0],template=t&&ae(t);template&&c?template.initialization=c&&ae(c):template&&template.initialization&&(template.initialization={sourceURL:template.initialization});const f={template:template,segmentTimeline:h&&ie(h,"S").map(s=>ae(s)),list:n&&m(ae(n),{segmentUrls:r,initialization:ae(c)}),base:o&&m(ae(o),{initialization:ae(c)})};return Object.keys(f).forEach(e=>{f[e]||delete f[e]}),f},he=e=>y(ie(e.node,"EventStream").map(t=>{const n=ae(t),r=n.schemeIdUri;return ie(t,"Event").map(t=>{const o=ae(t),l=o.presentationTime||0,h=n.timescale||1,d=o.duration||0,c=l/h+e.attributes.start;return{schemeIdUri:r,value:n.value,id:o.id,start:c,end:c+d/h,messageData:se(t)||o.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})})),de=(e,t,n)=>r=>{const o=ae(r),l=le(t,ie(r,"BaseURL")),d=ie(r,"Role")[0],c={role:ae(d)};let f=m(e,o,c);const _=ie(r,"Accessibility")[0],v=(e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map(e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}});if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri)return("string"!=typeof e.value?[]:e.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[n,r=""]=e.split("=");t.channel=n,t.language=e,r.split(",").forEach(e=>{const[n,r]=e.split(":");"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})})(ae(_));v&&(f=m(f,{captionServices:v}));const label=ie(r,"Label")[0];if(label&&label.childNodes.length){const e=label.childNodes[0].nodeValue.trim();f=m(f,{label:e})}const T=ie(r,"ContentProtection").reduce((e,t)=>{const n=ae(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=oe[n.schemeIdUri];if(r){e[r]={attributes:n};
vendor: 2,779 bytes, line 2
2const o=ie(t,"cenc:pssh")[0];if(o){const t=se(o);e[r].pssh=t&&Object(h.a)(t)}}return e},{});Object.keys(T).length&&(f=m(f,{contentProtection:T}));const S=ue(r),E=ie(r,"Representation"),w=m(n,S);return y(E.map(((e,t,n)=>r=>{const o=ie(r,"BaseURL"),l=le(t,o),h=m(e,ae(r)),d=ue(r);return l.map(e=>({segmentInfo:m(n,d),attributes:m(h,e)}))})(f,l,w)))},ce=(e,t)=>(n,r)=>{const o=le(t,ie(n.node,"BaseURL")),l=m(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(l.periodDuration=n.attributes.duration);const h=ie(n.node,"AdaptationSet"),d=ue(n.node);return y(h.map(de(l,o,d)))},pe=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const n=m({serverURL:se(e[0])},ae(e[0]));return n.queryBeforeStart="true"===n.queryBeforeStart,n},me=e=>{if(""===e)throw new Error(T);const t=new d.DOMParser;let n,r;try{n=t.parseFromString(e,"application/xml"),r=n&&"MPD"===n.documentElement.tagName?n.documentElement:null}catch(e){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(S);return r},ge=(e,t={})=>{const n=((e,t={})=>{const{manifestUri:n="",NOW:r=Date.now(),clientOffset:o=0,eventHandler:l=function(){}}=t,h=ie(e,"Period");if(!h.length)throw new Error(v);const d=ie(e,"Location"),c=ae(e),m=le([{baseUrl:n}],ie(e,"BaseURL")),f=ie(e,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=r,c.clientOffset=o,d.length&&(c.locations=d.map(se));const _=[];return h.forEach((e,t)=>{const n=ae(e),r=_[t-1];n.start=(({attributes:e,priorPeriodAttributes:t,mpdType:n})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==n?null:0)({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:c.type}),_.push({node:e,attributes:n})}),{locations:c.locations,contentSteeringInfo:pe(f,l),representationInfo:y(_.map(ce(c,m))),eventStream:y(_.map(he))}})(me(e),t),r=n.representationInfo.map(te);return X({dashPlaylists:r,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})},fe=e=>(e=>{const t=ie(e,"UTCTiming")[0];if(!t)return null;const n=ae(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;default:throw new Error(C)}return n})(me(e))},878:function(e,t,n){e.exports={}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.