filesbox/web/dist/design/designstatic/chatroom/video/video.min.7.js
2024-07-26 14:10:54 +08:00

69 lines
469 KiB
JavaScript

/**
* @license
* Video.js 7.6.5 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
*/(function(k,U){typeof exports=="object"&&typeof module!="undefined"?module.exports=U(require("global/window"),require("global/document")):typeof define=="function"&&define.amd?define(["global/window","global/document"],U):(k=k||self).videojs=U(k.window,k.document)})(this,function(k,U){k=k&&k.hasOwnProperty("default")?k.default:k,U=U&&U.hasOwnProperty("default")?U.default:U;var as="7.6.5",zt=[],vc=function(t,i){return function(n,e,r){var a=i.levels[e],s=new RegExp("^("+a+")$");if(n!=="log"&&r.unshift(n.toUpperCase()+":"),r.unshift(t+":"),zt&&zt.push([].concat(r)),k.console){var o=k.console[n];o||n!=="debug"||(o=k.console.info||k.console.log),o&&a&&s.test(n)&&o[Array.isArray(r)?"apply":"call"](k.console,r)}}},Z=function t(i){function n(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];e("log",r,s)}var e,r="info";return e=vc(i,n),n.createLogger=function(a){return t(i+": "+a)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=function(a){if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error('"'+a+'" in not a valid log level');r=a}return r},(n.history=function(){return zt?[].concat(zt):[]}).filter=function(a){return(zt||[]).filter(function(s){return new RegExp(".*"+a+".*").test(s[0])})},n.history.clear=function(){zt&&(zt.length=0)},n.history.disable=function(){zt!==null&&(zt.length=0,zt=null)},n.history.enable=function(){zt===null&&(zt=[])},n.error=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("error",r,s)},n.warn=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("warn",r,s)},n.debug=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("debug",r,s)},n}("VIDEOJS"),ss=Z.createLogger,_c=Object.prototype.toString,os=function(t){return de(t)?Object.keys(t):[]};function We(t,i){os(t).forEach(function(n){return i(t[n],n)})}function lt(t){for(var i=arguments.length,n=new Array(1<i?i-1:0),e=1;e<i;e++)n[e-1]=arguments[e];return Object.assign?Object.assign.apply(Object,[t].concat(n)):(n.forEach(function(r){r&&We(r,function(a,s){t[s]=a})}),t)}function de(t){return!!t&&typeof t=="object"}function bi(t){return de(t)&&_c.call(t)==="[object Object]"&&t.constructor===Object}function Zi(t,i){if(!t||!i||typeof k.getComputedStyle!="function")return"";var n=k.getComputedStyle(t);return n?n.getPropertyValue(i)||n[i]:""}function us(t){return typeof t=="string"&&/\S/.test(t)}function ls(t){if(/\s/.test(t))throw new Error("class has illegal whitespace characters")}function ze(){return U===k.document}function Ti(t){return de(t)&&t.nodeType===1}function cs(){try{return k.parent!==k.self}catch(t){return!0}}function hs(t){return function(i,n){if(!us(i))return U[t](null);us(n)&&(n=U.querySelector(n));var e=Ti(n)?n:U;return e[t]&&e[t](i)}}function vt(t,i,n,e){t===void 0&&(t="div"),i===void 0&&(i={}),n===void 0&&(n={});var r=U.createElement(t);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(Z.warn(`Setting attributes in the second argument of createEl()
has been deprecated. Use the third argument instead.
createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),r.setAttribute(a,s)):a==="textContent"?$e(r,s):r[a]=s}),Object.getOwnPropertyNames(n).forEach(function(a){r.setAttribute(a,n[a])}),e&&Jn(r,e),r}function $e(t,i){return typeof t.textContent=="undefined"?t.innerText=i:t.textContent=i,t}function Kn(t,i){i.firstChild?i.insertBefore(t,i.firstChild):i.appendChild(t)}function Te(t,i){return ls(i),t.classList?t.classList.contains(i):function(n){return new RegExp("(^|\\s)"+n+"($|\\s)")}(i).test(t.className)}function oe(t,i){return t.classList?t.classList.add(i):Te(t,i)||(t.className=(t.className+" "+i).trim()),t}function Si(t,i){return t.classList?t.classList.remove(i):(ls(i),t.className=t.className.split(/\s+/).filter(function(n){return n!==i}).join(" ")),t}function ds(t,i,n){var e=Te(t,i);if(typeof n=="function"&&(n=n(t,i)),typeof n!="boolean"&&(n=!e),n!==e)return n?oe(t,i):Si(t,i),t}function ps(t,i){Object.getOwnPropertyNames(i).forEach(function(n){var e=i[n];e===null||typeof e=="undefined"||e===!1?t.removeAttribute(n):t.setAttribute(n,e===!0?"":e)})}function ue(t){var i={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&0<t.attributes.length)for(var e=t.attributes,r=e.length-1;0<=r;r--){var a=e[r].name,s=e[r].value;typeof t[a]!="boolean"&&n.indexOf(","+a+",")===-1||(s=s!==null),i[a]=s}return i}function fs(t,i){return t.getAttribute(i)}function ki(t,i,n){t.setAttribute(i,n)}function tn(t,i){t.removeAttribute(i)}function ms(){U.body.focus(),U.onselectstart=function(){return!1}}function gs(){U.onselectstart=function(){return!0}}function Ci(t){if(t&&t.getBoundingClientRect&&t.parentNode){var i=t.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){i[e]!==void 0&&(n[e]=i[e])}),n.height||(n.height=parseFloat(Zi(t,"height"))),n.width||(n.width=parseFloat(Zi(t,"width"))),n}}function ys(t){var i;if(t.getBoundingClientRect&&t.parentNode&&(i=t.getBoundingClientRect()),!i)return{left:0,top:0};var n=U.documentElement,e=U.body,r=n.clientLeft||e.clientLeft||0,a=k.pageXOffset||e.scrollLeft,s=i.left+a-r,o=n.clientTop||e.clientTop||0,u=k.pageYOffset||e.scrollTop,c=i.top+u-o;return{left:Math.round(s),top:Math.round(c)}}function Yn(t,i){var n={},e=ys(t),r=t.offsetWidth,a=t.offsetHeight,s=e.top,o=e.left,u=i.pageY,c=i.pageX;return i.changedTouches&&(c=i.changedTouches[0].pageX,u=i.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(c-o)/r)),n}function vs(t){return de(t)&&t.nodeType===3}function Qn(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function _s(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(function(i){return typeof i=="function"&&(i=i()),Ti(i)||vs(i)?i:typeof i=="string"&&/\S/.test(i)?U.createTextNode(i):void 0}).filter(function(i){return i})}function Jn(t,i){return _s(i).forEach(function(n){return t.appendChild(n)}),t}function bs(t,i){return Jn(Qn(t),i)}function Ge(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||t.button===0&&t.buttons===1}var Zn,pe=hs("querySelector"),Ts=hs("querySelectorAll"),Ss=Object.freeze({isReal:ze,isEl:Ti,isInFrame:cs,createEl:vt,textContent:$e,prependTo:Kn,hasClass:Te,addClass:oe,removeClass:Si,toggleClass:ds,setAttributes:ps,getAttributes:ue,getAttribute:fs,setAttribute:ki,removeAttribute:tn,blockTextSelection:ms,unblockTextSelection:gs,getBoundingClientRect:Ci,findPosition:ys,getPointerPosition:Yn,isTextNode:vs,emptyEl:Qn,normalizeContent:_s,appendContent:Jn,insertContent:bs,isSingleLeftClick:Ge,$:pe,$$:Ts}),ks=!1,bc=function(){if(ze()&&Zn.options.autoSetup!==!1){var t=Array.prototype.slice.call(U.getElementsByTagName("video")),i=Array.prototype.slice.call(U.getElementsByTagName("audio")),n=Array.prototype.slice.call(U.getElementsByTagName("video-js")),e=t.concat(i,n);if(e&&0<e.length)for(var r=0,a=e.length;r<a;r++){var s=e[r];if(!s||!s.getAttribute){tr(1);break}s.player===void 0&&s.getAttribute("data-setup")!==null&&Zn(s)}else ks||tr(1)}};function tr(t,i){i&&(Zn=i),k.setTimeout(bc,t)}function er(){ks=!0,k.removeEventListener("load",er)}ze()&&(U.readyState==="complete"?er():k.addEventListener("load",er));function Cs(t){var i=U.createElement("style");return i.className=t,i}function Es(t,i){t.styleSheet?t.styleSheet.cssText=i:t.textContent=i}var At=new WeakMap,Tc=3;function Se(){return Tc++}function ws(t,i){if(At.has(t)){var n=At.get(t);n.handlers[i].length===0&&(delete n.handlers[i],t.removeEventListener?t.removeEventListener(i,n.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+i,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),Object.getOwnPropertyNames(n).length===0&&At.delete(t)}}function ir(t,i,n,e){n.forEach(function(r){t(i,r,e)})}function en(t){function i(){return!0}function n(){return!1}if(!t||!t.isPropagationStopped){var e=t||k.event;for(var r in t={},e)r!=="layerX"&&r!=="layerY"&&r!=="keyLocation"&&r!=="webkitMovementX"&&r!=="webkitMovementY"&&(r==="returnValue"&&e.preventDefault||(t[r]=e[r]));if(t.target||(t.target=t.srcElement||U),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){e.preventDefault&&e.preventDefault(),t.returnValue=!1,e.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){e.stopPropagation&&e.stopPropagation(),t.cancelBubble=!0,e.cancelBubble=!0,t.isPropagationStopped=i},t.isPropagationStopped=n,t.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation(),t.isImmediatePropagationStopped=i,t.stopPropagation()},t.isImmediatePropagationStopped=n,t.clientX!==null&&t.clientX!==void 0){var a=U.documentElement,s=U.body;t.pageX=t.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),t.pageY=t.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}t.which=t.charCode||t.keyCode,t.button!==null&&t.button!==void 0&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}var As=!1;(function(){try{var t=Object.defineProperty({},"passive",{get:function(){As=!0}});k.addEventListener("test",null,t),k.removeEventListener("test",null,t)}catch(i){}})();var Sc=["touchstart","touchmove"];function Ht(t,i,n){if(Array.isArray(i))return ir(Ht,t,i,n);At.has(t)||At.set(t,{});var e=At.get(t);if(e.handlers||(e.handlers={}),e.handlers[i]||(e.handlers[i]=[]),n.guid||(n.guid=Se()),e.handlers[i].push(n),e.dispatcher||(e.disabled=!1,e.dispatcher=function(a,s){if(!e.disabled){a=en(a);var o=e.handlers[a.type];if(o)for(var u=o.slice(0),c=0,d=u.length;c<d&&!a.isImmediatePropagationStopped();c++)try{u[c].call(t,a,s)}catch(h){Z.error(h)}}}),e.handlers[i].length===1)if(t.addEventListener){var r=!1;As&&-1<Sc.indexOf(i)&&(r={passive:!0}),t.addEventListener(i,e.dispatcher,r)}else t.attachEvent&&t.attachEvent("on"+i,e.dispatcher)}function Ct(t,i,n){if(At.has(t)){var e=At.get(t);if(e.handlers){let u=function(c,d){e.handlers[d]=[],ws(c,d)};var o=u;if(Array.isArray(i))return ir(Ct,t,i,n);if(i!==void 0){var r=e.handlers[i];if(r)if(n){if(n.guid)for(var a=0;a<r.length;a++)r[a].guid===n.guid&&r.splice(a--,1);ws(t,i)}else u(t,i)}else for(var s in e.handlers)Object.prototype.hasOwnProperty.call(e.handlers||{},s)&&u(t,s)}}}function Xe(t,i,n){var e=At.has(t)?At.get(t):{},r=t.parentNode||t.ownerDocument;if(typeof i=="string"?i={type:i,target:t}:i.target||(i.target=t),i=en(i),e.dispatcher&&e.dispatcher.call(t,i,n),r&&!i.isPropagationStopped()&&i.bubbles===!0)Xe.call(null,r,i,n);else if(!r&&!i.defaultPrevented&&i.target&&i.target[i.type]){At.has(i.target)||At.set(i.target,{});var a=At.get(i.target);i.target[i.type]&&(a.disabled=!0,typeof i.target[i.type]=="function"&&i.target[i.type](),a.disabled=!1)}return!i.defaultPrevented}function nn(t,i,n){if(Array.isArray(i))return ir(nn,t,i,n);function e(){Ct(t,i,e),n.apply(this,arguments)}e.guid=n.guid=n.guid||Se(),Ht(t,i,e)}function Ps(t,i,n){function e(){Ct(t,i,e),n.apply(this,arguments)}e.guid=n.guid=n.guid||Se(),Ht(t,i,e)}function J(t,i,n){i.guid||(i.guid=Se());var e=i.bind(t);return e.guid=n?n+"_"+i.guid:i.guid,e}function fe(t,i){var n=k.performance.now();return function(){var e=k.performance.now();i<=e-n&&(t.apply(void 0,arguments),n=e)}}function Pt(){}var Ei,kc=Object.freeze({fixEvent:en,on:Ht,off:Ct,trigger:Xe,one:nn,any:Ps});Pt.prototype.allowedEvents_={},Pt.prototype.addEventListener=Pt.prototype.on=function(t,i){var n=this.addEventListener;this.addEventListener=function(){},Ht(this,t,i),this.addEventListener=n},Pt.prototype.removeEventListener=Pt.prototype.off=function(t,i){Ct(this,t,i)},Pt.prototype.one=function(t,i){var n=this.addEventListener;this.addEventListener=function(){},nn(this,t,i),this.addEventListener=n},Pt.prototype.any=function(t,i){var n=this.addEventListener;this.addEventListener=function(){},Ps(this,t,i),this.addEventListener=n},Pt.prototype.dispatchEvent=Pt.prototype.trigger=function(t){var i=t.type||t;typeof t=="string"&&(t={type:i}),t=en(t),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](t),Xe(this,t)},Pt.prototype.queueTrigger=function(t){var i=this;Ei=Ei||new Map;var n=t.type||t,e=Ei.get(this);e||(e=new Map,Ei.set(this,e));var r=e.get(n);e.delete(n),k.clearTimeout(r);var a=k.setTimeout(function(){e.size===0&&(e=null,Ei.delete(i)),i.trigger(t)},0);e.set(n,a)};function Is(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length}function nr(t){if(!t.nodeName&&!Ce(t))throw new Error("Invalid target; must be a DOM node or evented object.")}function Ls(t){if(!Is(t))throw new Error("Invalid event type; must be a non-empty string or array.")}function Os(t){if(typeof t!="function")throw new Error("Invalid listener; must be a function.")}function rr(t,i){var n,e,r,a=i.length<3||i[0]===t||i[0]===t.eventBusEl_;return r=a?(n=t.eventBusEl_,3<=i.length&&i.shift(),e=i[0],i[1]):(n=i[0],e=i[1],i[2]),nr(n),Ls(e),Os(r),{isTargetingSelf:a,target:n,type:e,listener:r=J(t,r)}}function ke(t,i,n,e){nr(t),t.nodeName?kc[i](t,n,e):t[i](n,e)}var Ce=function(t){return t instanceof Pt||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof t[i]=="function"})},Cc={on:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=rr(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(ke(s,"on",o,u),!a){let h=function(){return t.off(s,o,u)},f=function(){return t.off("dispose",h)};var c=h,d=f;h.guid=u.guid,f.guid=u.guid,ke(this,"on","dispose",h),ke(s,"on","dispose",f)}},one:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=rr(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ke(s,"one",o,u);else{let d=function(){t.off(s,o,d);for(var h=arguments.length,f=new Array(h),y=0;y<h;y++)f[y]=arguments[y];u.apply(null,f)};var c=d;d.guid=u.guid,ke(s,"one",o,d)}},any:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=rr(this,n),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ke(s,"any",o,u);else{let d=function(){t.off(s,o,d);for(var h=arguments.length,f=new Array(h),y=0;y<h;y++)f[y]=arguments[y];u.apply(null,f)};var c=d;d.guid=u.guid,ke(s,"any",o,d)}},off:function(t,i,n){if(!t||Is(t))Ct(this.eventBusEl_,t,i);else{var e=t,r=i;nr(e),Ls(r),Os(n),n=J(this,n),this.off("dispose",n),e.nodeName?(Ct(e,r,n),Ct(e,"dispose",n)):Ce(e)&&(e.off(r,n),e.off("dispose",n))}},trigger:function(t,i){return Xe(this.eventBusEl_,t,i)}};function ar(t,i){i===void 0&&(i={});var n=i.eventBusKey;if(n){if(!t[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');t.eventBusEl_=t[n]}else t.eventBusEl_=vt("span",{className:"vjs-event-bus"});return lt(t,Cc),t.eventedCallbacks&&t.eventedCallbacks.forEach(function(e){e()}),t.on("dispose",function(){t.off(),k.setTimeout(function(){t.eventBusEl_=null},0)}),t}var Ec={state:{},setState:function(t){var i,n=this;return typeof t=="function"&&(t=t()),We(t,function(e,r){n.state[r]!==e&&((i=i||{})[r]={from:n.state[r],to:e}),n.state[r]=e}),i&&Ce(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function xs(t,i){return lt(t,Ec),t.state=lt({},t.state,i),typeof t.handleStateChanged=="function"&&Ce(t)&&t.on("statechanged",t.handleStateChanged),t}function rn(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toLowerCase()})}function ft(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toUpperCase()})}function at(){for(var t={},i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];return n.forEach(function(r){r&&We(r,function(a,s){bi(a)?(bi(t[s])||(t[s]={}),t[s]=at(t[s],a)):t[s]=a})}),t}var x=function(){function t(n,e,r){if(!n&&this.play?this.player_=n=this:this.player_=n,this.parentComponent_=null,this.options_=at({},this.options_),e=this.options_=at(this.options_,e),this.id_=e.id||e.el&&e.el.id,!this.id_){var a=n&&n.id&&n.id()||"no_player";this.id_=a+"_component_"+Se()}this.name_=e.name||null,e.el?this.el_=e.el:e.createEl!==!1&&(this.el_=this.createEl()),e.evented!==!1&&ar(this,{eventBusKey:this.el_?"el_":null}),xs(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,(this.clearingTimersOnDispose_=!1)!==e.initChildren&&this.initChildren(),this.ready(r),e.reportTouchActivity!==!1&&this.enableTouchActivity()}var i=t.prototype;return i.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var n=this.children_.length-1;0<=n;n--)this.children_[n].dispose&&this.children_[n].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),At.has(this.el_)&&At.delete(this.el_),this.el_=null),this.player_=null},i.player=function(){return this.player_},i.options=function(n){return n&&(this.options_=at(this.options_,n)),this.options_},i.el=function(){return this.el_},i.createEl=function(n,e,r){return vt(n,e,r)},i.localize=function(n,e,r){r===void 0&&(r=n);var a=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[a],u=a&&a.split("-")[0],c=s&&s[u],d=r;return o&&o[n]?d=o[n]:c&&c[n]&&(d=c[n]),e&&(d=d.replace(/\{(\d+)\}/g,function(h,f){var y=e[f-1],b=y;return typeof y=="undefined"&&(b=h),b})),d},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(n){return this.childIndex_[n]},i.getChild=function(n){if(n)return this.childNameIndex_[n]},i.addChild=function(n,e,r){var a,s;if(e===void 0&&(e={}),r===void 0&&(r=this.children_.length),typeof n=="string"){s=ft(n);var o=e.componentClass||s;e.name=s;var u=t.getComponent(o);if(!u)throw new Error("Component "+o+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,e)}else a=n;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(r,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),(s=s||a.name&&ft(a.name()))&&(this.childNameIndex_[s]=a,this.childNameIndex_[rn(s)]=a),typeof a.el=="function"&&a.el()){var c=this.contentEl().children[r]||null;this.contentEl().insertBefore(a.el(),c)}return a},i.removeChild=function(n){if(typeof n=="string"&&(n=this.getChild(n)),n&&this.children_){for(var e=!1,r=this.children_.length-1;0<=r;r--)if(this.children_[r]===n){e=!0,this.children_.splice(r,1);break}if(e){n.parentComponent_=null,this.childIndex_[n.id()]=null,this.childNameIndex_[ft(n.name())]=null,this.childNameIndex_[rn(n.name())]=null;var a=n.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(n.el())}}},i.initChildren=function(){var n=this,e=this.options_.children;if(e){var r,a=this.options_,s=t.getComponent("Tech");(r=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(o){return!r.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(function(o){var u,c;return c=typeof o=="string"?e[u=o]||n.options_[u]||{}:(u=o.name,o),{name:u,opts:c}}).filter(function(o){var u=t.getComponent(o.opts.componentClass||ft(o.name));return u&&!s.isTech(u)}).forEach(function(o){var u=o.name,c=o.opts;if(a[u]!==void 0&&(c=a[u]),c!==!1){c===!0&&(c={}),c.playerOptions=n.options_.playerOptions;var d=n.addChild(u,c);d&&(n[u]=d)}})}},i.buildCSSClass=function(){return""},i.ready=function(n,e){if(e===void 0&&(e=!1),n)return this.isReady_?void(e?n.call(this):this.setTimeout(n,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(n))},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var n=this.readyQueue_;this.readyQueue_=[],n&&0<n.length&&n.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},i.$=function(n,e){return pe(n,e||this.contentEl())},i.$$=function(n,e){return Ts(n,e||this.contentEl())},i.hasClass=function(n){return Te(this.el_,n)},i.addClass=function(n){oe(this.el_,n)},i.removeClass=function(n){Si(this.el_,n)},i.toggleClass=function(n,e){ds(this.el_,n,e)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(n){return fs(this.el_,n)},i.setAttribute=function(n,e){ki(this.el_,n,e)},i.removeAttribute=function(n){tn(this.el_,n)},i.width=function(n,e){return this.dimension("width",n,e)},i.height=function(n,e){return this.dimension("height",n,e)},i.dimensions=function(n,e){this.width(n,!0),this.height(e)},i.dimension=function(n,e,r){if(e!==void 0)return e!==null&&e==e||(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[n]=e:this.el_.style[n]=e==="auto"?"":e+"px",void(r||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[n],s=a.indexOf("px");return parseInt(s!==-1?a.slice(0,s):this.el_["offset"+ft(n)],10)},i.currentDimension=function(n){var e=0;if(n!=="width"&&n!=="height")throw new Error("currentDimension only accepts width or height value");if(e=Zi(this.el_,n),(e=parseFloat(e))===0||isNaN(e)){var r="offset"+ft(n);e=this.el_[r]}return e},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(n){this.player_&&(n.stopPropagation(),this.player_.handleKeyDown(n))},i.handleKeyPress=function(n){this.handleKeyDown(n)},i.emitTapEvents=function(){var n,e=0,r=null;this.on("touchstart",function(s){s.touches.length===1&&(r={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},e=k.performance.now(),n=!0)}),this.on("touchmove",function(s){if(1<s.touches.length)n=!1;else if(r){var o=s.touches[0].pageX-r.pageX,u=s.touches[0].pageY-r.pageY;10<Math.sqrt(o*o+u*u)&&(n=!1)}});function a(){n=!1}this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(s){!(r=null)===n&&k.performance.now()-e<200&&(s.preventDefault(),this.trigger("tap"))})},i.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){let a=function(s){e(),this.clearInterval(n)};var r=a,n,e=J(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){e(),this.clearInterval(n),n=this.setInterval(e,250)}),this.on("touchmove",e),this.on("touchend",a),this.on("touchcancel",a)}},i.setTimeout=function(n,e){var r,a=this;return n=J(this,n),this.clearTimersOnDispose_(),r=k.setTimeout(function(){a.setTimeoutIds_.has(r)&&a.setTimeoutIds_.delete(r),n()},e),this.setTimeoutIds_.add(r),r},i.clearTimeout=function(n){return this.setTimeoutIds_.has(n)&&(this.setTimeoutIds_.delete(n),k.clearTimeout(n)),n},i.setInterval=function(n,e){n=J(this,n),this.clearTimersOnDispose_();var r=k.setInterval(n,e);return this.setIntervalIds_.add(r),r},i.clearInterval=function(n){return this.setIntervalIds_.has(n)&&(this.setIntervalIds_.delete(n),k.clearInterval(n)),n},i.requestAnimationFrame=function(n){var e,r=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),n=J(this,n),e=k.requestAnimationFrame(function(){r.rafIds_.has(e)&&r.rafIds_.delete(e),n()}),this.rafIds_.add(e),e):this.setTimeout(n,1e3/60)},i.cancelAnimationFrame=function(n){return this.supportsRaf_?(this.rafIds_.has(n)&&(this.rafIds_.delete(n),k.cancelAnimationFrame(n)),n):this.clearTimeout(n)},i.clearTimersOnDispose_=function(){var n=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var r=e[0],a=e[1];n[r].forEach(n[a],n)}),n.clearingTimersOnDispose_=!1}))},t.registerComponent=function(n,e){if(typeof n!="string"||!n)throw new Error('Illegal component name, "'+n+'"; must be a non-empty string.');var r,a=t.getComponent("Tech"),s=a&&a.isTech(e),o=t===e||t.prototype.isPrototypeOf(e.prototype);if(s||!o)throw r=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+n+'"; '+r+".");n=ft(n),t.components_||(t.components_={});var u=t.getComponent("Player");if(n==="Player"&&u&&u.players){var c=u.players,d=Object.keys(c);if(c&&0<d.length&&d.map(function(h){return c[h]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[n]=e,t.components_[rn(n)]=e},t.getComponent=function(n){if(n&&t.components_)return t.components_[n]},t}();function j(t,i){t.prototype=Object.create(i.prototype),(t.prototype.constructor=t).__proto__=i}function Ds(t,i){return(Ds=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(t,i)}function Us(t,i,n){return(Us=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,r,a){var s=[null];s.push.apply(s,r);var o=new(Function.bind.apply(e,s));return a&&Ds(o,a.prototype),o}).apply(null,arguments)}function K(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}x.prototype.supportsRaf_=typeof k.requestAnimationFrame=="function"&&typeof k.cancelAnimationFrame=="function",x.registerComponent("Component",x);var sr,or,ur,lr,Et=k.navigator&&k.navigator.userAgent||"",Rs=/AppleWebKit\/([\d.]+)/i.exec(Et),wc=Rs?parseFloat(Rs.pop()):null,cr=/iPad/i.test(Et),hr=/iPhone/i.test(Et)&&!cr,Ms=/iPod/i.test(Et),Zt=hr||cr||Ms,Ac=(sr=Et.match(/OS (\d+)_/i))&&sr[1]?sr[1]:null,me=/Android/i.test(Et),dr=function(){var t=Et.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var i=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return i&&n?parseFloat(t[1]+"."+t[2]):i||null}(),Ns=me&&dr<5&&wc<537,Bs=/Firefox/i.test(Et),pr=/Edge/i.test(Et),le=!pr&&(/Chrome/i.test(Et)||/CriOS/i.test(Et)),js=(or=Et.match(/(Chrome|CriOS)\/(\d+)/))&&or[2]?parseFloat(or[2]):null,fr=(ur=/MSIE\s(\d+)\.\d/.exec(Et),!(lr=ur&&parseFloat(ur[1]))&&/Trident\/7.0/i.test(Et)&&/rv:11.0/.test(Et)&&(lr=11),lr),Fs=/Safari/i.test(Et)&&!le&&!me&&!pr,mr=(Fs||Zt)&&!le,Hs=/Windows/i.test(Et),wi=ze()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch),Pc=Object.freeze({IS_IPAD:cr,IS_IPHONE:hr,IS_IPOD:Ms,IS_IOS:Zt,IOS_VERSION:Ac,IS_ANDROID:me,ANDROID_VERSION:dr,IS_NATIVE_ANDROID:Ns,IS_FIREFOX:Bs,IS_EDGE:pr,IS_CHROME:le,CHROME_VERSION:js,IE_VERSION:fr,IS_SAFARI:Fs,IS_ANY_SAFARI:mr,IS_WINDOWS:Hs,TOUCH_ENABLED:wi});function Vs(t,i,n,e){return function(r,a,s){if(typeof a!="number"||a<0||s<a)throw new Error("Failed to execute '"+r+"' on 'TimeRanges': The index provided ("+a+") is non-numeric or out of bounds (0-"+s+").")}(t,e,n.length-1),n[e][i]}function gr(t){return t===void 0||t.length===0?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:Vs.bind(null,"start",0,t),end:Vs.bind(null,"end",1,t)}}function Ee(t,i){return Array.isArray(t)?gr(t):t===void 0||i===void 0?gr():gr([[t,i]])}function qs(t,i){var n,e,r=0;if(!i)return 0;t&&t.length||(t=Ee(0,0));for(var a=0;a<t.length;a++)n=t.start(a),i<(e=t.end(a))&&(e=i),r+=e-n;return r/i}for(var Ai,yr={prefixed:!0},an=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Ws=an[0],sn=0;sn<an.length;sn++)if(an[sn][1]in U){Ai=an[sn];break}if(Ai){for(var on=0;on<Ai.length;on++)yr[Ws[on]]=Ai[on];yr.prefixed=Ai[0]!==Ws[0]}function It(t){if(t instanceof It)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:de(t)&&(typeof t.code=="number"&&(this.code=t.code),lt(this,t)),this.message||(this.message=It.defaultMessages[this.code]||"")}It.prototype.code=0,It.prototype.message="",It.prototype.status=null,It.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],It.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."};for(var Ke=0;Ke<It.errorTypes.length;Ke++)It[It.errorTypes[Ke]]=Ke,It.prototype[It.errorTypes[Ke]]=Ke;var Ic=function(t,i){var n,e=null;try{n=JSON.parse(t,i)}catch(r){e=r}return[e,n]};function Pi(t){return t!=null&&typeof t.then=="function"}function ge(t){Pi(t)&&t.then(null,function(i){})}function zs(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(i,n,e){return t[n]&&(i[n]=t[n]),i},{cues:t.cues&&Array.prototype.map.call(t.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})})}var Lc=function(t){var i=t.$$("track"),n=Array.prototype.map.call(i,function(e){return e.track});return Array.prototype.map.call(i,function(e){var r=zs(e.track);return e.src&&(r.src=e.src),r}).concat(Array.prototype.filter.call(t.textTracks(),function(e){return n.indexOf(e)===-1}).map(zs))},Oc=function(t,i){return t.forEach(function(n){var e=i.addRemoteTextTrack(n).track;!n.src&&n.cues&&n.cues.forEach(function(r){return e.addCue(r)})}),i.textTracks()};function vr(t,i){return t(i={exports:{}},i.exports),i.exports}var z=vr(function(t,i){function n(u){if(u&&typeof u=="object"){var c=u.which||u.keyCode||u.charCode;c&&(u=c)}if(typeof u=="number")return s[u];var d,h=String(u);return(d=e[h.toLowerCase()])?d:(d=r[h.toLowerCase()])||(h.length===1?h.charCodeAt(0):void 0)}n.isEventKey=function(u,c){if(u&&typeof u=="object"){var d=u.which||u.keyCode||u.charCode;if(d==null)return!1;if(typeof c=="string"){var h;if((h=e[c.toLowerCase()])||(h=r[c.toLowerCase()]))return h===d}else if(typeof c=="number")return c===d;return!1}};var e=(i=t.exports=n).code=i.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=i.aliases={windows:91,"\u21E7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)e[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)e[a-48]=a;for(a=1;a<13;a++)e["f"+a]=a+111;for(a=0;a<10;a++)e["numpad "+a]=a+96;var s=i.names=i.title={};for(a in e)s[e[a]]=a;for(var o in r)e[o]=r[o]}),_r=(z.code,z.codes,z.aliases,z.names,z.title,"vjs-modal-dialog"),Ye=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).opened_=a.hasBeenOpened_=a.hasBeenFilled_=!1,a.closeable(!a.options_.uncloseable),a.content(a.options_.content),a.contentEl_=vt("div",{className:_r+"-content"},{role:"document"}),a.descEl_=vt("p",{className:_r+"-description vjs-control-text",id:a.el().getAttribute("aria-describedby")}),$e(a.descEl_,a.description()),a.el_.appendChild(a.descEl_),a.el_.appendChild(a.contentEl_),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,t.prototype.dispose.call(this)},n.buildCSSClass=function(){return _r+" vjs-hidden "+t.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},n.open=function(){if(!this.opened_){var 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}},n.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},n.close=function(){if(this.opened_){var 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("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},n.closeable=function(e){if(typeof e=="boolean"){var r=this.closeable_=!!e,a=this.getChild("closeButton");if(r&&!a){var s=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(a,"close",this.close)}!r&&a&&(this.off(a,"close",this.close),this.removeChild(a),a.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var r=this.contentEl(),a=r.parentNode,s=r.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(r),this.empty(),bs(r,e),this.trigger("modalfill"),s?a.insertBefore(r,s):a.appendChild(r);var o=this.getChild("closeButton");o&&a.appendChild(o.el_)},n.empty=function(){this.trigger("beforemodalempty"),Qn(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return typeof e!="undefined"&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=U.activeElement,r=this.player_.el_;this.previouslyActiveEl_=null,!r.contains(e)&&r!==e||(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),z.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(z.isEventKey(e,"Tab")){for(var r,a=this.focusableEls_(),s=this.el_.querySelector(":focus"),o=0;o<a.length;o++)if(s===a[o]){r=o;break}U.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(a[a.length-1].focus(),e.preventDefault()):e.shiftKey||r!==a.length-1||(a[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(r){return(r instanceof k.HTMLAnchorElement||r instanceof k.HTMLAreaElement)&&r.hasAttribute("href")||(r instanceof k.HTMLInputElement||r instanceof k.HTMLSelectElement||r instanceof k.HTMLTextAreaElement||r instanceof k.HTMLButtonElement)&&!r.hasAttribute("disabled")||r instanceof k.HTMLIFrameElement||r instanceof k.HTMLObjectElement||r instanceof k.HTMLEmbedElement||r.hasAttribute("tabindex")&&r.getAttribute("tabindex")!==-1||r.hasAttribute("contenteditable")})},i}(x);Ye.prototype.options_={pauseOnOpen:!0,temporary:!0},x.registerComponent("ModalDialog",Ye);var Qe=function(t){function i(e){var r;e===void 0&&(e=[]),(r=t.call(this)||this).tracks_=[],Object.defineProperty(K(r),"length",{get:function(){return this.tracks_.length}});for(var a=0;a<e.length;a++)r.addTrack(e[a]);return r}j(i,t);var n=i.prototype;return n.addTrack=function(e){var r=this.tracks_.length;""+r in this||Object.defineProperty(this,r,{get:function(){return this.tracks_[r]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this}))},n.removeTrack=function(e){for(var r,a=0,s=this.length;a<s;a++)if(this[a]===e){(r=this[a]).off&&r.off(),this.tracks_.splice(a,1);break}r&&this.trigger({track:r,type:"removetrack",target:this})},n.getTrackById=function(e){for(var r=null,a=0,s=this.length;a<s;a++){var o=this[a];if(o.id===e){r=o;break}}return r},i}(Pt);for(var xc in Qe.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Qe.prototype.allowedEvents_)Qe.prototype["on"+xc]=null;function br(t,i){for(var n=0;n<t.length;n++)Object.keys(t[n]).length&&i.id!==t[n].id&&(t[n].enabled=!1)}function Tr(t,i){for(var n=0;n<t.length;n++)Object.keys(t[n]).length&&i.id!==t[n].id&&(t[n].selected=!1)}function Sr(t){var i=["protocol","hostname","port","pathname","search","hash","host"],n=U.createElement("a");n.href=t;var e,r=n.host===""&&n.protocol!=="file:";r&&((e=U.createElement("div")).innerHTML='<a href="'+t+'"></a>',n=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),U.body.appendChild(e));for(var a={},s=0;s<i.length;s++)a[i[s]]=n[i[s]];return a.protocol==="http:"&&(a.host=a.host.replace(/:80$/,"")),a.protocol==="https:"&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=k.location.protocol),r&&U.body.removeChild(e),a}function $s(t){if(!t.match(/^https?:\/\//)){var i=U.createElement("div");i.innerHTML='<a href="'+t+'">x</a>',t=i.firstChild.href}return t}function kr(t){if(typeof t=="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(t);if(i)return i.pop().toLowerCase()}return""}function un(t){var i=k.location,n=Sr(t);return(n.protocol===":"?i.protocol:n.protocol)+n.host!==i.protocol+i.host}var Dc=function(t){function i(e){var r;e===void 0&&(e=[]);for(var a=e.length-1;0<=a;a--)if(e[a].enabled){br(e,e[a]);break}return(r=t.call(this,e)||this).changing_=!1,r}j(i,t);var n=i.prototype;return n.addTrack=function(e){var r=this;e.enabled&&br(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,br(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},n.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},i}(Qe),Uc=function(t){function i(e){var r;e===void 0&&(e=[]);for(var a=e.length-1;0<=a;a--)if(e[a].selected){Tr(e,e[a]);break}return(r=t.call(this,e)||this).changing_=!1,Object.defineProperty(K(r),"selectedIndex",{get:function(){for(var s=0;s<this.length;s++)if(this[s].selected)return s;return-1},set:function(){}}),r}j(i,t);var n=i.prototype;return n.addTrack=function(e){var r=this;e.selected&&Tr(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){r.changing_||(r.changing_=!0,Tr(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},n.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},i}(Qe),Gs=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.addTrack=function(e){var r=this;t.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return r.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return r.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},i}(Qe),Rc=function(){function t(n){n===void 0&&(n=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var e=0,r=n.length;e<r;e++)this.addTrackElement_(n[e])}var i=t.prototype;return i.addTrackElement_=function(n){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),this.trackElements_.indexOf(n)===-1&&this.trackElements_.push(n)},i.getTrackElementByTrack_=function(n){for(var e,r=0,a=this.trackElements_.length;r<a;r++)if(n===this.trackElements_[r].track){e=this.trackElements_[r];break}return e},i.removeTrackElement_=function(n){for(var e=0,r=this.trackElements_.length;e<r;e++)if(n===this.trackElements_[e]){this.trackElements_[e].track&&typeof this.trackElements_[e].track.off=="function"&&this.trackElements_[e].track.off(),typeof this.trackElements_[e].off=="function"&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},t}(),Xs=function(){function t(n){t.prototype.setCues_.call(this,n),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var i=t.prototype;return i.setCues_=function(n){var e=this.length||0,r=0,a=n.length;this.cues_=n,this.length_=n.length;function s(o){""+o in this||Object.defineProperty(this,""+o,{get:function(){return this.cues_[o]}})}if(e<a)for(r=e;r<a;r++)s.call(this,r)},i.getCueById=function(n){for(var e=null,r=0,a=this.length;r<a;r++){var s=this[r];if(s.id===n){e=s;break}}return e},t}(),Mc={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Nc={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Bc={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ks={disabled:"disabled",hidden:"hidden",showing:"showing"},Cr=function(t){function i(n){var e;n===void 0&&(n={}),e=t.call(this)||this;function r(o){Object.defineProperty(K(e),o,{get:function(){return a[o]},set:function(){}})}var a={id:n.id||"vjs_track_"+Se(),kind:n.kind||"",label:n.label||"",language:n.language||""};for(var s in a)r(s);return e}return j(i,t),i}(Pt),jc=Object.freeze({parseUrl:Sr,getAbsoluteURL:$s,getFileExtension:kr,isCrossOrigin:un}),Fc=function(t){var i=Hc.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window!="undefined"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},Hc=Object.prototype.toString;function Ys(t){var i=Js.call(t),n=i==="[object Arguments]";return n=n||i!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&0<=t.length&&Js.call(t.callee)==="[object Function]"}var Qs,Er=Array.prototype.slice,Vc=Object.prototype.toString,wr=Function.prototype.bind||function(t){var i=this;if(typeof i!="function"||Vc.call(i)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var n,e=Er.call(arguments,1),r=Math.max(0,i.length-e.length),a=[],s=0;s<r;s++)a.push("$"+s);if(n=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var u=i.apply(this,e.concat(Er.call(arguments)));return Object(u)===u?u:this}return i.apply(t,e.concat(Er.call(arguments)))}),i.prototype){let u=function(){};var o=u;u.prototype=i.prototype,n.prototype=new u,u.prototype=null}return n},Js=Object.prototype.toString;if(!Object.keys){let t=function(i){var n=i.constructor;return n&&n.prototype===i};var mf=t,ln=Object.prototype.hasOwnProperty,Zs=Object.prototype.toString,qc=Ys,to=Object.prototype.propertyIsEnumerable,Wc=!to.call({toString:null},"toString"),zc=to.call(function(){},"prototype"),cn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Gc=function(){if(typeof window=="undefined")return!1;for(var i in window)try{if(!$c["$"+i]&&ln.call(window,i)&&window[i]!==null&&typeof window[i]=="object")try{t(window[i])}catch(n){return!0}}catch(n){return!0}return!1}();Qs=function(i){var n=i!==null&&typeof i=="object",e=Zs.call(i)==="[object Function]",r=qc(i),a=n&&Zs.call(i)==="[object String]",s=[];if(!n&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var o=zc&&e;if(a&&0<i.length&&!ln.call(i,0))for(var u=0;u<i.length;++u)s.push(String(u));if(r&&0<i.length)for(var c=0;c<i.length;++c)s.push(String(c));else for(var d in i)o&&d==="prototype"||!ln.call(i,d)||s.push(String(d));if(Wc)for(var h=function(y){if(typeof window=="undefined"||!Gc)return t(y);try{return t(y)}catch(b){return!1}}(i),f=0;f<cn.length;++f)h&&cn[f]==="constructor"||!ln.call(i,cn[f])||s.push(cn[f]);return s}}var Xc=Qs,Kc=Array.prototype.slice,eo=Object.keys,hn=eo?function(t){return eo(t)}:Xc,io=Object.keys;hn.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return Ys(t)?io(Kc.call(t)):io(t)}):Object.keys=hn,Object.keys||hn};function Yc(t,i,n,e){i in t&&(!function(r){return typeof r=="function"&&Zc.call(r)==="[object Function]"}(e)||!e())||(ro?Ar(t,i,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[i]=n)}function no(t,i,n){var e=2<arguments.length?n:{},r=Qc(i);Jc&&(r=th.call(r,Object.getOwnPropertySymbols(i)));for(var a=0;a<r.length;a+=1)Yc(t,r[a],i[r[a]],e[r[a]])}var Qc=hn,Jc=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Zc=Object.prototype.toString,th=Array.prototype.concat,Ar=Object.defineProperty,ro=Ar&&function(){var t={};try{for(var i in Ar(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(n){return!1}}();no.supportsDescriptors=!!ro;function Ii(t,i){if(1<arguments.length&&typeof i!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+t;if(!(n in Or))throw new SyntaxError("intrinsic "+t+" does not exist!");if(typeof Or[n]=="undefined"&&!i)throw new TypeError("intrinsic "+t+" exists, but is not available. Please file an issue!");return Or[n]}function dn(t,i,n,e){var r=nh[i];if(typeof r!="function")throw new ih("unknown record type: "+i);if(!r(t,e))throw new co(n+" must be a "+i)}function ao(t){return 0<=t?1:-1}function so(t){try{var i=po.call(t);return ah.test(i)}catch(n){return!1}}function Pr(t){if(!t||typeof t!="function"&&typeof t!="object")return!1;if(typeof t=="function"&&!t.prototype)return!0;if(oh)return function(n){try{return!so(n)&&(po.call(n),!0)}catch(e){return!1}}(t);if(so(t))return!1;var i=sh.call(t);return i==="[object Function]"||i==="[object GeneratorFunction]"}function oo(t){return t===null||typeof t!="function"&&typeof t!="object"}function uo(){var t=mo.ToString(mo.CheckObjectCoercible(this));return go(go(t,hh,""),dh,"")}function Ir(){return String.prototype.trim&&"\u200B".trim()==="\u200B"?String.prototype.trim:uo}var q,lo=no,eh=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",Ae=Object.getPrototypeOf||function(t){return t.__proto__},Lr=typeof Uint8Array=="undefined"?q:Ae(Uint8Array),Or={"$ %Array%":Array,"$ %ArrayBuffer%":typeof ArrayBuffer=="undefined"?q:ArrayBuffer,"$ %ArrayBufferPrototype%":typeof ArrayBuffer=="undefined"?q:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":we?Ae([][Symbol.iterator]()):q,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":q,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":q,"$ %AsyncGenerator%":q,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":q,"$ %AsyncIteratorPrototype%":q,"$ %Atomics%":typeof Atomics=="undefined"?q:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":typeof DataView=="undefined"?q:DataView,"$ %DataViewPrototype%":typeof DataView=="undefined"?q:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":typeof Float32Array=="undefined"?q:Float32Array,"$ %Float32ArrayPrototype%":typeof Float32Array=="undefined"?q:Float32Array.prototype,"$ %Float64Array%":typeof Float64Array=="undefined"?q:Float64Array,"$ %Float64ArrayPrototype%":typeof Float64Array=="undefined"?q:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":q,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":q,"$ %Int8Array%":typeof Int8Array=="undefined"?q:Int8Array,"$ %Int8ArrayPrototype%":typeof Int8Array=="undefined"?q:Int8Array.prototype,"$ %Int16Array%":typeof Int16Array=="undefined"?q:Int16Array,"$ %Int16ArrayPrototype%":typeof Int16Array=="undefined"?q:Int8Array.prototype,"$ %Int32Array%":typeof Int32Array=="undefined"?q:Int32Array,"$ %Int32ArrayPrototype%":typeof Int32Array=="undefined"?q:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":we?Ae(Ae([][Symbol.iterator]())):q,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":typeof Map=="undefined"?q:Map,"$ %MapIteratorPrototype%":typeof Map!="undefined"&&we?Ae(new Map()[Symbol.iterator]()):q,"$ %MapPrototype%":typeof Map=="undefined"?q:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":typeof Promise=="undefined"?q:Promise,"$ %PromisePrototype%":typeof Promise=="undefined"?q:Promise.prototype,"$ %PromiseProto_then%":typeof Promise=="undefined"?q:Promise.prototype.then,"$ %Promise_all%":typeof Promise=="undefined"?q:Promise.all,"$ %Promise_reject%":typeof Promise=="undefined"?q:Promise.reject,"$ %Promise_resolve%":typeof Promise=="undefined"?q:Promise.resolve,"$ %Proxy%":typeof Proxy=="undefined"?q:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":typeof Reflect=="undefined"?q:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":typeof Set=="undefined"?q:Set,"$ %SetIteratorPrototype%":typeof Set!="undefined"&&we?Ae(new Set()[Symbol.iterator]()):q,"$ %SetPrototype%":typeof Set=="undefined"?q:Set.prototype,"$ %SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?q:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":typeof SharedArrayBuffer=="undefined"?q:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":we?Ae(""[Symbol.iterator]()):q,"$ %StringPrototype%":String.prototype,"$ %Symbol%":we?Symbol:q,"$ %SymbolPrototype%":we?Symbol.prototype:q,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":eh,"$ %TypedArray%":Lr,"$ %TypedArrayPrototype%":Lr?Lr.prototype:q,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":typeof Uint8Array=="undefined"?q:Uint8Array,"$ %Uint8ArrayPrototype%":typeof Uint8Array=="undefined"?q:Uint8Array.prototype,"$ %Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?q:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray=="undefined"?q:Uint8ClampedArray.prototype,"$ %Uint16Array%":typeof Uint16Array=="undefined"?q:Uint16Array,"$ %Uint16ArrayPrototype%":typeof Uint16Array=="undefined"?q:Uint16Array.prototype,"$ %Uint32Array%":typeof Uint32Array=="undefined"?q:Uint32Array,"$ %Uint32ArrayPrototype%":typeof Uint32Array=="undefined"?q:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":typeof WeakMap=="undefined"?q:WeakMap,"$ %WeakMapPrototype%":typeof WeakMap=="undefined"?q:WeakMap.prototype,"$ %WeakSet%":typeof WeakSet=="undefined"?q:WeakSet,"$ %WeakSetPrototype%":typeof WeakSet=="undefined"?q:WeakSet.prototype},dt=wr.call(Function.call,Object.prototype.hasOwnProperty),co=Ii("%TypeError%"),ih=Ii("%SyntaxError%"),nh={"Property Descriptor":function(t,i){if(t.Type(i)!=="Object")return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var e in i)if(dt(i,e)&&!n[e])return!1;var r=dt(i,"[[Value]]"),a=dt(i,"[[Get]]")||dt(i,"[[Set]]");if(r&&a)throw new co("Property Descriptors may not be both accessor and data descriptors");return!0}},pn=Number.isNaN||function(t){return t!=t},rh=Number.isNaN||function(t){return t!=t},ho=Number.isFinite||function(t){return typeof t=="number"&&!rh(t)&&t!==1/0&&t!==-1/0},po=Function.prototype.toString,ah=/^\s*class\b/,sh=Object.prototype.toString,oh=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",uh=Object.prototype.toString,fo=function(t,i){var n;if((n=1<arguments.length?i:uh.call(t)==="[object Date]"?String:Number)!==String&&n!==Number)throw new TypeError("invalid [[DefaultValue]] hint supplied");var e,r,a=n===String?["toString","valueOf"]:["valueOf","toString"];for(r=0;r<a.length;++r)if(Pr(t[a[r]])&&(e=t[a[r]](),oo(e)))return e;throw new TypeError("No default value")},lh=Ii("%Object%"),Je=Ii("%TypeError%"),ch=Ii("%String%"),mo={ToPrimitive:function(t,i){return oo(t)?t:1<arguments.length?fo(t,i):fo(t)},ToBoolean:function(t){return!!t},ToNumber:function(t){return+t},ToInteger:function(t){var i=this.ToNumber(t);return pn(i)?0:i!==0&&ho(i)?ao(i)*Math.floor(Math.abs(i)):i},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var i=this.ToNumber(t);return pn(i)||i===0||!ho(i)?0:function(n,e){var r=n%e;return Math.floor(0<=r?r:r+e)}(ao(i)*Math.floor(Math.abs(i)),65536)},ToString:function(t){return ch(t)},ToObject:function(t){return this.CheckObjectCoercible(t),lh(t)},CheckObjectCoercible:function(t,i){if(t==null)throw new Je(i||"Cannot call method on "+t);return t},IsCallable:Pr,SameValue:function(t,i){return t===i?t!==0||1/t==1/i:pn(t)&&pn(i)},Type:function(t){return t===null?"Null":typeof t=="undefined"?"Undefined":typeof t=="function"||typeof t=="object"?"Object":typeof t=="number"?"Number":typeof t=="boolean"?"Boolean":typeof t=="string"?"String":void 0},IsPropertyDescriptor:function(t){if(this.Type(t)!=="Object")return!1;var i={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(dt(t,n)&&!i[n])return!1;var e=dt(t,"[[Value]]"),r=dt(t,"[[Get]]")||dt(t,"[[Set]]");if(e&&r)throw new Je("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!(!dt(t,"[[Get]]")&&!dt(t,"[[Set]]")))},IsDataDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!(!dt(t,"[[Value]]")&&!dt(t,"[[Writable]]")))},IsGenericDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t))},FromPropertyDescriptor:function(t){if(typeof t=="undefined")return t;if(dn(this,"Property Descriptor","Desc",t),this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new Je("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if(this.Type(t)!=="Object")throw new Je("ToPropertyDescriptor requires an object");var i={};if(dt(t,"enumerable")&&(i["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),dt(t,"configurable")&&(i["[[Configurable]]"]=this.ToBoolean(t.configurable)),dt(t,"value")&&(i["[[Value]]"]=t.value),dt(t,"writable")&&(i["[[Writable]]"]=this.ToBoolean(t.writable)),dt(t,"get")){var n=t.get;if(typeof n!="undefined"&&!this.IsCallable(n))throw new TypeError("getter must be a function");i["[[Get]]"]=n}if(dt(t,"set")){var e=t.set;if(typeof e!="undefined"&&!this.IsCallable(e))throw new Je("setter must be a function");i["[[Set]]"]=e}if((dt(i,"[[Get]]")||dt(i,"[[Set]]"))&&(dt(i,"[[Value]]")||dt(i,"[[Writable]]")))throw new Je("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return i}},go=wr.call(Function.call,String.prototype.replace),hh=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,dh=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,yo=wr.call(Function.call,Ir());lo(yo,{getPolyfill:Ir,implementation:uo,shim:function(){var t=Ir();return lo(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}});var xr=yo,ph=Object.prototype.toString,vo=Object.prototype.hasOwnProperty,fh=function(t,i,n){if(!Pr(i))throw new TypeError("iterator must be a function");var e;3<=arguments.length&&(e=n),ph.call(t)==="[object Array]"?function(r,a,s){for(var o=0,u=r.length;o<u;o++)vo.call(r,o)&&(s==null?a(r[o],o,r):a.call(s,r[o],o,r))}(t,i,e):typeof t=="string"?function(r,a,s){for(var o=0,u=r.length;o<u;o++)s==null?a(r.charAt(o),o,r):a.call(s,r.charAt(o),o,r)}(t,i,e):function(r,a,s){for(var o in r)vo.call(r,o)&&(s==null?a(r[o],o,r):a.call(s,r[o],o,r))}(t,i,e)},mh=function(t){if(!t)return{};var i={};return fh(xr(t).split(`
`),function(n){var e=n.indexOf(":"),r=xr(n.slice(0,e)).toLowerCase(),a=xr(n.slice(e+1));typeof i[r]=="undefined"?i[r]=a:function(s){return Object.prototype.toString.call(s)==="[object Array]"}(i[r])?i[r].push(a):i[r]=[i[r],a]}),i},gh=function(){for(var t={},i=0;i<arguments.length;i++){var n=arguments[i];for(var e in n)yh.call(n,e)&&(t[e]=n[e])}return t},yh=Object.prototype.hasOwnProperty,_o=ye;function bo(t,i,n){var e=t;return Fc(i)?(n=i,typeof t=="string"&&(e={uri:t})):e=gh(i,{uri:t}),e.callback=n,e}function ye(t,i,n){return To(i=bo(t,i,n))}function To(t){if(typeof t.callback=="undefined")throw new Error("callback argument missing");var i=!1,n=function(E,S,C){i||(i=!0,t.callback(E,S,C))};function e(E){return clearTimeout(o),E instanceof Error||(E=new Error(""+(E||"Unknown XMLHttpRequest Error"))),E.statusCode=0,n(E,_)}function r(){if(!s){var E;clearTimeout(o),E=t.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var S=_,C=null;return E!==0?(S={body:function(){var L=void 0;if(L=u.response?u.response:u.responseText||function(D){if(D.responseType==="document")return D.responseXML;var F=D.responseXML&&D.responseXML.documentElement.nodeName==="parsererror";return D.responseType!==""||F?null:D.responseXML}(u),b)try{L=JSON.parse(L)}catch(D){}return L}(),statusCode:E,method:d,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(S.headers=mh(u.getAllResponseHeaders()))):C=new Error("Internal XMLHttpRequest Error"),n(C,S,S.body)}}var a,s,o,u=t.xhr||null,c=(u=u||(t.cors||t.useXDR?new ye.XDomainRequest:new ye.XMLHttpRequest)).url=t.uri||t.url,d=u.method=t.method||"GET",h=t.body||t.data,f=u.headers=t.headers||{},y=!!t.sync,b=!1,_={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:u};if("json"in t&&t.json!==!1&&(b=!0,f.accept||f.Accept||(f.Accept="application/json"),d!=="GET"&&d!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),h=JSON.stringify(t.json===!0?h:t.json))),u.onreadystatechange=function(){u.readyState===4&&setTimeout(r,0)},u.onload=r,u.onerror=e,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=e,u.open(d,c,!y,t.username,t.password),y||(u.withCredentials=!!t.withCredentials),!y&&0<t.timeout&&(o=setTimeout(function(){if(!s){s=!0,u.abort("timeout");var E=new Error("XMLHttpRequest timeout");E.code="ETIMEDOUT",e(E)}},t.timeout)),u.setRequestHeader)for(a in f)f.hasOwnProperty(a)&&u.setRequestHeader(a,f[a]);else if(t.headers&&!function(E){for(var S in E)if(E.hasOwnProperty(S))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(u),u.send(h||null),u}ye.XMLHttpRequest=k.XMLHttpRequest||function(){},ye.XDomainRequest="withCredentials"in new ye.XMLHttpRequest?ye.XMLHttpRequest:k.XDomainRequest,function(t,i){for(var n=0;n<t.length;n++)i(t[n])}(["get","put","post","patch","head","delete"],function(t){ye[t==="delete"?"del":t]=function(i,n,e){return(n=bo(i,n,e)).method=t.toUpperCase(),To(n)}});function So(t,i){var n=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),e=[];n.oncue=function(r){i.addCue(r)},n.onparsingerror=function(r){e.push(r)},n.onflush=function(){i.trigger({type:"loadeddata",target:i})},n.parse(t),0<e.length&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed("Text Track parsing errors for "+i.src),e.forEach(function(r){return Z.error(r)}),k.console&&k.console.groupEnd&&k.console.groupEnd()),n.flush()}var Li=function(t){function i(e){var r;if(e===void 0&&(e={}),!e.tech)throw new Error("A tech was not provided.");var a=at(e,{kind:Bc[e.kind]||"subtitles",language:e.language||e.srclang||""}),s=Ks[a.mode]||"disabled",o=a.default;a.kind!=="metadata"&&a.kind!=="chapters"||(s="hidden"),(r=t.call(this,a)||this).tech_=a.tech,r.cues_=[],r.activeCues_=[];var u=new Xs(r.cues_),c=new Xs(r.activeCues_),d=!1,h=J(K(r),function(){this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1)});return s!=="disabled"&&r.tech_.ready(function(){r.tech_.on("timeupdate",h)},!0),Object.defineProperties(K(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(f){var y=this;Ks[f]&&((s=f)!=="disabled"?this.tech_.ready(function(){y.tech_.on("timeupdate",h)},!0):this.tech_.off("timeupdate",h),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return c;for(var f=this.tech_.currentTime(),y=[],b=0,_=this.cues.length;b<_;b++){var E=this.cues[b];(E.startTime<=f&&E.endTime>=f||E.startTime===E.endTime&&E.startTime<=f&&E.startTime+.5>=f)&&y.push(E)}if(d=!1,y.length!==this.activeCues_.length)d=!0;else for(var S=0;S<y.length;S++)this.activeCues_.indexOf(y[S])===-1&&(d=!0);return this.activeCues_=y,c.setCues_(this.activeCues_),c},set:function(){}}}),a.src?(r.src=a.src,function(f,y){var b={uri:f},_=un(f);_&&(b.cors=_),_o(b,J(this,function(E,S,C){if(E)return Z.error(E,S);y.loaded_=!0,typeof k.WebVTT!="function"?y.tech_&&y.tech_.any(["vttjsloaded","vttjserror"],function(L){if(L.type!=="vttjserror")return So(C,y);Z.error("vttjs failed to load, stopping trying to process "+y.src)}):So(C,y)}))}(a.src,K(r))):r.loaded_=!0,r}j(i,t);var n=i.prototype;return n.addCue=function(e){var r=e;if(k.vttjs&&!(e instanceof k.vttjs.VTTCue)){for(var a in r=new k.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)a in r||(r[a]=e[a]);r.id=e.id,r.originalCue_=e}for(var s=this.tech_.textTracks(),o=0;o<s.length;o++)s[o]!==this&&s[o].removeCue(r);this.cues_.push(r),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var r=this.cues_.length;r--;){var a=this.cues_[r];if(a===e||a.originalCue_&&a.originalCue_===e){this.cues_.splice(r,1),this.cues.setCues_(this.cues_);break}}},i}(Cr);Li.prototype.allowedEvents_={cuechange:"cuechange"};var ko=function(t){function i(n){var e;n===void 0&&(n={});var r=at(n,{kind:Nc[n.kind]||""});e=t.call(this,r)||this;var a=!1;return Object.defineProperty(K(e),"enabled",{get:function(){return a},set:function(s){typeof s=="boolean"&&s!==a&&(a=s,this.trigger("enabledchange"))}}),r.enabled&&(e.enabled=r.enabled),e.loaded_=!0,e}return j(i,t),i}(Cr),Co=function(t){function i(n){var e;n===void 0&&(n={});var r=at(n,{kind:Mc[n.kind]||""});e=t.call(this,r)||this;var a=!1;return Object.defineProperty(K(e),"selected",{get:function(){return a},set:function(s){typeof s=="boolean"&&s!==a&&(a=s,this.trigger("selectedchange"))}}),r.selected&&(e.selected=r.selected),e}return j(i,t),i}(Cr),Ze=function(t){function i(n){var e,r;n===void 0&&(n={}),e=t.call(this)||this;var a=new Li(n);return e.kind=a.kind,e.src=a.src,e.srclang=a.language,e.label=a.label,e.default=a.default,Object.defineProperties(K(e),{readyState:{get:function(){return r}},track:{get:function(){return a}}}),r=0,a.addEventListener("loadeddata",function(){r=2,e.trigger({type:"load",target:K(e)})}),e}return j(i,t),i}(Pt);Ze.prototype.allowedEvents_={load:"load"},Ze.NONE=0,Ze.LOADING=1,Ze.LOADED=2,Ze.ERROR=3;var $t={audio:{ListClass:Dc,TrackClass:ko,capitalName:"Audio"},video:{ListClass:Uc,TrackClass:Co,capitalName:"Video"},text:{ListClass:Gs,TrackClass:Li,capitalName:"Text"}};Object.keys($t).forEach(function(t){$t[t].getterName=t+"Tracks",$t[t].privateName=t+"Tracks_"});var Oi={remoteText:{ListClass:Gs,TrackClass:Li,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Rc,TrackClass:Ze,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Lt=at($t,Oi);Oi.names=Object.keys(Oi),$t.names=Object.keys($t),Lt.names=[].concat(Oi.names).concat($t.names);var Dr=Object.create||function(t){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return Eo.prototype=t,new Eo};function Eo(){}function te(t,i){this.name="ParsingError",this.code=t.code,this.message=i||t.message}function Ur(t){function i(e,r,a,s){return 3600*(0|e)+60*(0|r)+(0|a)+(0|s)/1e3}var n=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?i(n[1],n[2],n[3].replace(":",""),n[4]):59<n[1]?i(n[1],n[2],0,n[4]):i(0,n[1],n[2],n[4]):null}function xi(){this.values=Dr(null)}function Di(t,i,n,e){var r=e?t.split(e):[t];for(var a in r)if(typeof r[a]=="string"){var s=r[a].split(n);s.length===2&&i(s[0],s[1])}}function vh(t,i,n){var e,r,a,s=t;function o(){var c=Ur(t);if(c===null)throw new te(te.Errors.BadTimeStamp,"Malformed timestamp: "+s);return t=t.replace(/^[^\sa-zA-Z-]+/,""),c}function u(){t=t.replace(/^\s+/,"")}if(u(),i.startTime=o(),u(),t.substr(0,3)!=="-->")throw new te(te.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);t=t.substr(3),u(),i.endTime=o(),u(),e=t,r=i,a=new xi,Di(e,function(c,d){switch(c){case"region":for(var h=n.length-1;0<=h;h--)if(n[h].id===d){a.set(c,n[h].region);break}break;case"vertical":a.alt(c,d,["rl","lr"]);break;case"line":var f=d.split(","),y=f[0];a.integer(c,y),a.percent(c,y)&&a.set("snapToLines",!1),a.alt(c,y,["auto"]),f.length===2&&a.alt("lineAlign",f[1],["start","middle","end"]);break;case"position":f=d.split(","),a.percent(c,f[0]),f.length===2&&a.alt("positionAlign",f[1],["start","middle","end"]);break;case"size":a.percent(c,d);break;case"align":a.alt(c,d,["start","middle","end","left","right"])}},/:/,/\s/),r.region=a.get("region",null),r.vertical=a.get("vertical",""),r.line=a.get("line","auto"),r.lineAlign=a.get("lineAlign","start"),r.snapToLines=a.get("snapToLines",!0),r.size=a.get("size",100),r.align=a.get("align","middle"),r.position=a.get("position",{start:0,left:0,middle:50,end:100,right:100},r.align),r.positionAlign=a.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},r.align)}((te.prototype=Dr(Error.prototype)).constructor=te).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},xi.prototype={set:function(t,i){this.get(t)||i===""||(this.values[t]=i)},get:function(t,i,n){return n?this.has(t)?this.values[t]:i[n]:this.has(t)?this.values[t]:i},has:function(t){return t in this.values},alt:function(t,i,n){for(var e=0;e<n.length;++e)if(i===n[e]){this.set(t,i);break}},integer:function(t,i){/^-?\d+$/.test(i)&&this.set(t,parseInt(i,10))},percent:function(t,i){return!!(i.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(i=parseFloat(i))&&i<=100)&&(this.set(t,i),!0)}};var _h={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"\u200E","&rlm;":"\u200F","&nbsp;":"\xA0"},bh={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Th={v:"title",lang:"lang"},wo={rt:"ruby"};function Ao(t,i){function n(){if(!i)return null;var _,E=i.match(/^([^<]*)(<[^>]*>?)?/);return _=E[1]?E[1]:E[2],i=i.substr(_.length),_}function e(_){return _h[_]}function r(_){for(;b=_.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)_=_.replace(b[0],e);return _}function a(_,E){var S=bh[_];if(!S)return null;var C=t.document.createElement(S);C.localName=S;var L=Th[_];return L&&E&&(C[L]=E.trim()),C}for(var s,o,u,c=t.document.createElement("div"),d=c,h=[];(s=n())!==null;)if(s[0]!=="<")d.appendChild(t.document.createTextNode(r(s)));else{if(s[1]==="/"){h.length&&h[h.length-1]===s.substr(2).replace(">","")&&(h.pop(),d=d.parentNode);continue}var f,y=Ur(s.substr(1,s.length-2));if(y){f=t.document.createProcessingInstruction("timestamp",y),d.appendChild(f);continue}var b=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!b||!(f=a(b[1],b[3]))||(o=d,wo[(u=f).localName]&&wo[u.localName]!==o.localName))continue;b[2]&&(f.className=b[2].substr(1).replace("."," ")),h.push(b[1]),d.appendChild(f),d=f}return c}var Po=[[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 Sh(t){for(var i=0;i<Po.length;i++){var n=Po[i];if(t>=n[0]&&t<=n[1])return!0}return!1}function fn(){}function Rr(t,i,n){fn.call(this),this.cue=i,this.cueDiv=Ao(t,i.text);var e={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:i.vertical===""?"horizontal-tb":i.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(e,this.cueDiv),this.div=t.document.createElement("div"),e={direction:function(a){var s=[],o="";if(!a||!a.childNodes)return"ltr";function u(h,f){for(var y=f.childNodes.length-1;0<=y;y--)h.push(f.childNodes[y])}function c(h){if(!h||!h.length)return null;var f=h.pop(),y=f.textContent||f.innerText;if(y){var b=y.match(/^.*(\n|\r)/);return b?b[h.length=0]:y}return f.tagName==="ruby"?c(h):f.childNodes?(u(h,f),c(h)):void 0}for(u(s,a);o=c(s);)for(var d=0;d<o.length;d++)if(Sh(o.charCodeAt(d)))return"rtl";return"ltr"}(this.cueDiv),writingMode:i.vertical===""?"horizontal-tb":i.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:i.align==="middle"?"center":i.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(e),this.div.appendChild(this.cueDiv);var r=0;switch(i.positionAlign){case"start":r=i.position;break;case"middle":r=i.position-i.size/2;break;case"end":r=i.position-i.size}i.vertical===""?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(i.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(i.size,"%")}),this.move=function(a){this.applyStyles({top:this.formatStyle(a.top,"px"),bottom:this.formatStyle(a.bottom,"px"),left:this.formatStyle(a.left,"px"),right:this.formatStyle(a.right,"px"),height:this.formatStyle(a.height,"px"),width:this.formatStyle(a.width,"px")})}}function Ot(t){var i,n,e,r;if(t.div){n=t.div.offsetHeight,e=t.div.offsetWidth,r=t.div.offsetTop;var a=(a=t.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();t=t.div.getBoundingClientRect(),i=a?Math.max(a[0]&&a[0].height||0,t.height/a.length):0}this.left=t.left,this.right=t.right,this.top=t.top||r,this.height=t.height||n,this.bottom=t.bottom||r+(t.height||n),this.width=t.width||e,this.lineHeight=i!==void 0?i:t.lineHeight}function kh(t,i,n,e){var r=new Ot(i),a=i.cue,s=function(_){if(typeof _.line=="number"&&(_.snapToLines||0<=_.line&&_.line<=100))return _.line;if(!_.track||!_.track.textTrackList||!_.track.textTrackList.mediaElement)return-1;for(var E=_.track,S=E.textTrackList,C=0,L=0;L<S.length&&S[L]!==E;L++)S[L].mode==="showing"&&C++;return-1*++C}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var c=r.lineHeight,d=c*Math.round(s),h=n[u]+c,f=o[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/c)*c),s<0&&(d+=a.vertical===""?n.height:n.width,o=o.reverse()),r.move(f,d)}else{var y=r.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=y/2;break;case"end":s-=y}switch(a.vertical){case"":i.applyStyles({top:i.formatStyle(s,"%")});break;case"rl":i.applyStyles({left:i.formatStyle(s,"%")});break;case"lr":i.applyStyles({right:i.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new Ot(i)}var b=function(_,E){for(var S,C=new Ot(_),L=1,D=0;D<E.length;D++){for(;_.overlapsOppositeAxis(n,E[D])||_.within(n)&&_.overlapsAny(e);)_.move(E[D]);if(_.within(n))return _;var F=_.intersectPercentage(n);F<L&&(S=new Ot(_),L=F),_=new Ot(C)}return S||C}(r,o);i.move(b.toCSSCompatValues(n))}function Ui(){}fn.prototype.applyStyles=function(t,i){for(var n in i=i||this.div,t)t.hasOwnProperty(n)&&(i.style[n]=t[n])},fn.prototype.formatStyle=function(t,i){return t===0?0:t+i},(Rr.prototype=Dr(fn.prototype)).constructor=Rr,Ot.prototype.move=function(t,i){switch(i=i!==void 0?i:this.lineHeight,t){case"+x":this.left+=i,this.right+=i;break;case"-x":this.left-=i,this.right-=i;break;case"+y":this.top+=i,this.bottom+=i;break;case"-y":this.top-=i,this.bottom-=i}},Ot.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},Ot.prototype.overlapsAny=function(t){for(var i=0;i<t.length;i++)if(this.overlaps(t[i]))return!0;return!1},Ot.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},Ot.prototype.overlapsOppositeAxis=function(t,i){switch(i){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},Ot.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},Ot.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},Ot.getSimpleBoxPosition=function(t){var i=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,n=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,e=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||e,height:t.height||i,bottom:t.bottom||e+(t.height||i),width:t.width||n}},Ui.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Ui.convertCueToDOMTree=function(t,i){return t&&i?Ao(t,i):null},Ui.processCues=function(t,i,n){if(!t||!i||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var e=t.document.createElement("div");if(e.style.position="absolute",e.style.left="0",e.style.right="0",e.style.top="0",e.style.bottom="0",e.style.margin="1.5%",n.appendChild(e),function(u){for(var c=0;c<u.length;c++)if(u[c].hasBeenReset||!u[c].displayState)return!0;return!1}(i)){var r=[],a=Ot.getSimpleBoxPosition(e),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};(function(){for(var u,c,d=0;d<i.length;d++)c=i[d],u=new Rr(t,c,s),e.appendChild(u.div),kh(0,u,a,r),c.displayState=u.div,r.push(Ot.getSimpleBoxPosition(u))})()}else for(var o=0;o<i.length;o++)e.appendChild(i[o].displayState)},(Ui.Parser=function(t,i,n){n||(n=i,i={}),i=i||{},this.window=t,this.vttjs=i,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(t){if(!(t instanceof te))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var i=this;function n(){for(var u=i.buffer,c=0;c<u.length&&u[c]!=="\r"&&u[c]!==`
`;)++c;var d=u.substr(0,c);return u[c]==="\r"&&++c,u[c]===`
`&&++c,i.buffer=u.substr(c),d}function e(u){u.match(/X-TIMESTAMP-MAP/)?Di(u,function(c,d){switch(c){case"X-TIMESTAMP-MAP":(function(h){var f=new xi;Di(h,function(y,b){switch(y){case"MPEGT":f.integer(y+"S",b);break;case"LOCA":f.set(y+"L",Ur(b))}},/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:f.get("MPEGTS"),LOCAL:f.get("LOCAL")})})(d)}},/=/):Di(u,function(c,d){switch(c){case"Region":(function(h){var f=new xi;if(Di(h,function(b,_){switch(b){case"id":f.set(b,_);break;case"width":f.percent(b,_);break;case"lines":f.integer(b,_);break;case"regionanchor":case"viewportanchor":var E=_.split(",");if(E.length!==2)break;var S=new xi;if(S.percent("x",E[0]),S.percent("y",E[1]),!S.has("x")||!S.has("y"))break;f.set(b+"X",S.get("x")),f.set(b+"Y",S.get("y"));break;case"scroll":f.alt(b,_,["up"])}},/=/,/\s/),f.has("id")){var y=new(i.vttjs.VTTRegion||i.window.VTTRegion);y.width=f.get("width",100),y.lines=f.get("lines",3),y.regionAnchorX=f.get("regionanchorX",0),y.regionAnchorY=f.get("regionanchorY",100),y.viewportAnchorX=f.get("viewportanchorX",0),y.viewportAnchorY=f.get("viewportanchorY",100),y.scroll=f.get("scroll",""),i.onregion&&i.onregion(y),i.regionList.push({id:f.get("id"),region:y})}})(d)}},/:/)}t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));try{var r;if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;var a=(r=n()).match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new te(te.Errors.BadSignature);i.state="HEADER"}for(var s=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(s?s=!1:r=n(),i.state){case"HEADER":/:/.test(r)?e(r):r||(i.state="ID");continue;case"NOTE":r||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){i.state="NOTE";break}if(!r)continue;if(i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,""),i.state="CUE",r.indexOf("-->")===-1){i.cue.id=r;continue}case"CUE":try{vh(r,i.cue,i.regionList)}catch(u){i.reportOrThrowError(u),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=`
`),i.cue.text+=r;continue;case"BADCUE":r||(i.state="ID");continue}}}catch(u){i.reportOrThrowError(u),i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),!t.cue&&t.state!=="HEADER"||(t.buffer+=`
`,t.parse()),t.state==="INITIAL")throw new te(te.Errors.BadSignature)}catch(i){t.reportOrThrowError(i)}return t.onflush&&t.onflush(),this}};var Ch=Ui,Eh={"":1,lr:1,rl:1},wh={start:1,middle:1,end:1,left:1,right:1};function Mr(t){return typeof t=="string"&&!!wh[t.toLowerCase()]&&t.toLowerCase()}function Io(t,i,n){this.hasBeenReset=!1;var e="",r=!1,a=t,s=i,o=n,u=null,c="",d=!0,h="auto",f="start",y=50,b="middle",_=50,E="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return e},set:function(S){e=""+S}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(S){r=!!S}},startTime:{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number")throw new TypeError("Start time must be set to a number.");a=S,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(S){if(typeof S!="number")throw new TypeError("End time must be set to a number.");s=S,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(S){o=""+S,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(S){u=S,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(S){var C=function(L){return typeof L=="string"&&!!Eh[L.toLowerCase()]&&L.toLowerCase()}(S);if(C===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=C,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(S){d=!!S,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(S){if(typeof S!="number"&&S!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");h=S,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");f=C,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return y},set:function(S){if(S<0||100<S)throw new Error("Position must be between 0 and 100.");y=S,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");b=C,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return _},set:function(S){if(S<0||100<S)throw new Error("Size must be between 0 and 100.");_=S,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return E},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");E=C,this.hasBeenReset=!0}}}),this.displayState=void 0}Io.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Ah=Io,Ph={"":!0,up:!0};function Ri(t){return typeof t=="number"&&0<=t&&t<=100}function Ih(){var t=100,i=3,n=0,e=100,r=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(o){if(!Ri(o))throw new Error("Width must be between 0 and 100.");t=o}},lines:{enumerable:!0,get:function(){return i},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");i=o}},regionAnchorY:{enumerable:!0,get:function(){return e},set:function(o){if(!Ri(o))throw new Error("RegionAnchorX must be between 0 and 100.");e=o}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(o){if(!Ri(o))throw new Error("RegionAnchorY must be between 0 and 100.");n=o}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(o){if(!Ri(o))throw new Error("ViewportAnchorY must be between 0 and 100.");a=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Ri(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=function(c){return typeof c=="string"&&!!Ph[c.toLowerCase()]&&c.toLowerCase()}(o);if(u===!1)throw new SyntaxError("An invalid or illegal string was specified.");s=u}}})}var Mi=vr(function(t){var i=t.exports={WebVTT:Ch,VTTCue:Ah,VTTRegion:Ih};k.vttjs=i,k.WebVTT=i.WebVTT;var n=i.VTTCue,e=i.VTTRegion,r=k.VTTCue,a=k.VTTRegion;i.shim=function(){k.VTTCue=n,k.VTTRegion=e},i.restore=function(){k.VTTCue=r,k.VTTRegion=a},k.VTTCue||i.shim()});Mi.WebVTT,Mi.VTTCue,Mi.VTTRegion;var st=function(t){function i(e,r){var a;return e===void 0&&(e={}),r===void 0&&(r=function(){}),e.reportTouchActivity=!1,(a=t.call(this,null,e,r)||this).hasStarted_=!1,a.on("playing",function(){this.hasStarted_=!0}),a.on("loadstart",function(){this.hasStarted_=!1}),Lt.names.forEach(function(s){var o=Lt[s];e&&e[o.getterName]&&(a[o.privateName]=e[o.getterName])}),a.featuresProgressEvents||a.manualProgressOn(),a.featuresTimeupdateEvents||a.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){e["native"+s+"Tracks"]===!1&&(a["featuresNative"+s+"Tracks"]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?a.featuresNativeTextTracks=!1:e.nativeCaptions!==!0&&e.nativeTextTracks!==!0||(a.featuresNativeTextTracks=!0),a.featuresNativeTextTracks||a.emulateTextTracks(),a.autoRemoteTextTracks_=new Lt.text.ListClass,a.initTrackListeners(),e.nativeControlsForTouch||a.emitTapEvents(),a.constructor&&(a.name_=a.constructor.name||"Unknown Tech"),a}j(i,t);var n=i.prototype;return n.triggerSourceset=function(e){var r=this;this.isReady_||this.one("ready",function(){return r.setTimeout(function(){return r.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},n.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(J(this,function(){var r=this.bufferedPercent();this.bufferedPercent_!==r&&this.trigger("progress"),(this.bufferedPercent_=r)===1&&this.stopTrackingProgress()}),500)},n.onDurationChange=function(e){this.duration_=this.duration()},n.buffered=function(){return Ee(0,0)},n.bufferedPercent=function(){return qs(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks($t.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},n.clearTracks=function(e){var r=this;(e=[].concat(e)).forEach(function(a){for(var s=r[a+"Tracks"]()||[],o=s.length;o--;){var u=s[o];a==="text"&&r.removeRemoteTextTrack(u),s.removeTrack(u)}})},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],r=e.length;r--;){var a=e[r];this.removeRemoteTextTrack(a)}},n.reset=function(){},n.error=function(e){return e!==void 0&&(this.error_=new It(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?Ee(0,0):Ee()},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var e=this;$t.names.forEach(function(r){function a(){e.trigger(r+"trackchange")}var s=$t[r],o=e[s.getterName]();o.addEventListener("removetrack",a),o.addEventListener("addtrack",a),e.on("dispose",function(){o.removeEventListener("removetrack",a),o.removeEventListener("addtrack",a)})})},n.addWebVttScript_=function(){var e=this;if(!k.WebVTT)if(U.body.contains(this.el())){if(!this.options_["vtt.js"]&&bi(Mi)&&0<Object.keys(Mi).length)return void this.trigger("vttjsloaded");var r=U.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){e.trigger("vttjsloaded")},r.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){r.onload=null,r.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){function e(d){return s.addTrack(d.track)}function r(d){return s.removeTrack(d.track)}var a=this,s=this.textTracks(),o=this.remoteTextTracks();o.on("addtrack",e),o.on("removetrack",r),this.addWebVttScript_();function u(){return a.trigger("texttrackchange")}function c(){u();for(var d=0;d<s.length;d++){var h=s[d];h.removeEventListener("cuechange",u),h.mode==="showing"&&h.addEventListener("cuechange",u)}}c(),s.addEventListener("change",c),s.addEventListener("addtrack",c),s.addEventListener("removetrack",c),this.on("dispose",function(){o.off("addtrack",e),o.off("removetrack",r),s.removeEventListener("change",c),s.removeEventListener("addtrack",c),s.removeEventListener("removetrack",c);for(var d=0;d<s.length;d++)s[d].removeEventListener("cuechange",u)})},n.addTextTrack=function(e,r,a){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(s,o,u,c,d){d===void 0&&(d={});var h=s.textTracks();d.kind=o,u&&(d.label=u),c&&(d.language=c),d.tech=s;var f=new Lt.text.TrackClass(d);return h.addTrack(f),f}(this,e,r,a)},n.createRemoteTextTrack=function(e){var r=at(e,{tech:this});return new Oi.remoteTextEl.TrackClass(r)},n.addRemoteTextTrack=function(e,r){var a=this;e===void 0&&(e={});var s=this.createRemoteTextTrack(e);return r!==!0&&r!==!1&&(Z.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),r=!0),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),r!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(s.track)}),s},n.removeRemoteTextTrack=function(e){var r=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(r),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var e=this.options_.Promise||k.Promise;if(e)return e.reject()},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(e,r){return i.canPlayType(e.type)},i.isTech=function(e){return e.prototype instanceof i||e instanceof i||e===i},i.registerTech=function(e,r){if(i.techs_||(i.techs_={}),!i.isTech(r))throw new Error("Tech "+e+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ft(e),i.techs_[e]=r,i.techs_[rn(e)]=r,e!=="Tech"&&i.defaultTechOrder_.push(e),r},i.getTech=function(e){if(e)return i.techs_&&i.techs_[e]?i.techs_[e]:(e=ft(e),k&&k.videojs&&k.videojs[e]?(Z.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),k.videojs[e]):void 0)},i}(x);Lt.names.forEach(function(t){var i=Lt[t];st.prototype[i.getterName]=function(){return this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName]}}),st.prototype.featuresVolumeControl=!0,st.prototype.featuresMuteControl=!0,st.prototype.featuresFullscreenResize=!1,st.prototype.featuresPlaybackRate=!1,st.prototype.featuresProgressEvents=!1,st.prototype.featuresSourceset=!1,st.prototype.featuresTimeupdateEvents=!1,st.prototype.featuresNativeTextTracks=!1,st.withSourceHandlers=function(t){t.registerSourceHandler=function(i,n){var e=t.sourceHandlers;e=e||(t.sourceHandlers=[]),n===void 0&&(n=e.length),e.splice(n,0,i)},t.canPlayType=function(i){for(var n,e=t.sourceHandlers||[],r=0;r<e.length;r++)if(n=e[r].canPlayType(i))return n;return""},t.selectSourceHandler=function(i,n){for(var e=t.sourceHandlers||[],r=0;r<e.length;r++)if(e[r].canHandleSource(i,n))return e[r];return null},t.canPlaySource=function(i,n){var e=t.selectSourceHandler(i,n);return e?e.canHandleSource(i,n):""},["seekable","seeking","duration"].forEach(function(i){var n=this[i];typeof n=="function"&&(this[i]=function(){return this.sourceHandler_&&this.sourceHandler_[i]?this.sourceHandler_[i].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},t.prototype),t.prototype.setSource=function(i){var n=t.selectSourceHandler(i,this.options_);n||(t.nativeSourceHandler?n=t.nativeSourceHandler:Z.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),n!==t.nativeSourceHandler&&(this.currentSource_=i),this.sourceHandler_=n.handleSource(i,this,this.options_),this.one("dispose",this.disposeSourceHandler)},t.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)}},x.registerComponent("Tech",st),st.registerTech("Tech",st),st.defaultTechOrder_=[];var Pe={},Nr={},mn={};function Lh(t,i,n){t.setTimeout(function(){return function e(r,a,s,o,u,c){r===void 0&&(r={}),a===void 0&&(a=[]),u===void 0&&(u=[]),c===void 0&&(c=!1);var d=a,h=d[0],f=d.slice(1);if(typeof h=="string")e(r,Pe[h],s,o,u,c);else if(h){var y=Dh(o,h);if(!y.setSource)return u.push(y),e(r,f,s,o,u,c);y.setSource(lt({},r),function(b,_){if(b)return e(r,f,s,o,u,c);u.push(y),e(_,r.type===_.type?f:Pe[_.type],s,o,u,c)})}else f.length?e(r,f,s,o,u,c):c?s(r,u):e(r,Pe["*"],s,o,u,!0)}(i,Pe[i.type],n,t)},1)}function Lo(t,i,n,e){e===void 0&&(e=null);var r="call"+ft(n),a=t.reduce(Br(r),e),s=a===mn,o=s?null:i[n](a);return function(u,c,d,h){for(var f=u.length-1;0<=f;f--){var y=u[f];y[c]&&y[c](h,d)}}(t,n,o,s),o}var Oh={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1,volume:1},xh={setCurrentTime:1,setVolume:1},Oo={play:1,pause:1};function Br(t){return function(i,n){return i===mn?mn:n[t]?n[t](i):i}}function Dh(t,i){var n=Nr[t.id()],e=null;if(n==null)return e=i(t),Nr[t.id()]=[[i,e]],e;for(var r=0;r<n.length;r++){var a=n[r],s=a[0],o=a[1];s===i&&(e=o)}return e===null&&(e=i(t),n.push([i,e])),e}function gn(t){t===void 0&&(t="");var i=kr(t);return Uh[i.toLowerCase()]||""}var Uh={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",oga:"audio/ogg",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};function xo(t){if(!t.type){var i=gn(t.src);i&&(t.type=i)}return t}var Rh=function(t){function i(n,e,r){var a,s=at({createEl:!1},e);if(a=t.call(this,n,s,r)||this,e.playerOptions.sources&&e.playerOptions.sources.length!==0)n.src(e.playerOptions.sources);else for(var o=0,u=e.playerOptions.techOrder;o<u.length;o++){var c=ft(u[o]),d=st.getTech(c);if(c||(d=x.getComponent(c)),d&&d.isSupported()){n.loadTech_(c);break}}return a}return j(i,t),i}(x);x.registerComponent("MediaLoader",Rh);var yn=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).emitTapEvents(),a.enable(),a}j(i,t);var n=i.prototype;return n.createEl=function(e,r,a){e===void 0&&(e="div"),r===void 0&&(r={}),a===void 0&&(a={}),r=lt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},r),e==="button"&&Z.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),a=lt({role:"button"},a),this.tabIndex_=r.tabIndex;var s=t.prototype.createEl.call(this,e,r,a);return this.createControlTextEl(s),s},n.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=vt("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,r){if(r===void 0&&(r=this.el()),e===void 0)return this.controlText_||"Need Text";var a=this.localize(e);this.controlText_=e,$e(this.controlTextEl_,a),this.nonIconControl||r.setAttribute("title",a)},n.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_!="undefined"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_!="undefined"&&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)},n.handleClick=function(e){},n.handleKeyDown=function(e){z.isEventKey(e,"Space")||z.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},i}(x);x.registerComponent("ClickableComponent",yn);var Mh=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).update(),e.on("posterchange",J(K(a),a.update)),a}j(i,t);var n=i.prototype;return n.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},n.createEl=function(){return vt("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var r=this.player().poster();this.setSrc(r),r?this.show():this.hide()},n.setSrc=function(e){var r="";e&&(r='url("'+e+'")'),this.el_.style.backgroundImage=r},n.handleClick=function(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?ge(this.player_.play()):this.player_.pause())},i}(yn);x.registerComponent("PosterImage",Mh);var vn="#222",Nh={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',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function jr(t,i){var n;if(t.length===4)n=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(t.length!==7)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");n=t.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+i+")"}function Fr(t,i,n){try{t.style[i]=n}catch(e){return}}var Bh=function(t){function i(e,r,a){var s;s=t.call(this,e,r,a)||this;var o=J(K(s),s.updateDisplay);return e.on("loadstart",J(K(s),s.toggleDisplay)),e.on("texttrackchange",o),e.on("loadedmetadata",J(K(s),s.preselectTrack)),e.ready(J(K(s),function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",o),e.on("playerresize",o),k.addEventListener("orientationchange",o),e.on("dispose",function(){return k.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],c=0;c<u.length;c++)this.player_.addRemoteTextTrack(u[c],!0);this.preselectTrack()}})),s}j(i,t);var n=i.prototype;return n.preselectTrack=function(){for(var e,r,a,s={captions:1,subtitles:1},o=this.player_.textTracks(),u=this.player_.cache_.selectedLanguage,c=0;c<o.length;c++){var d=o[c];u&&u.enabled&&u.language&&u.language===d.language&&d.kind in s?a=d.kind===u.kind?d:a||d:u&&!u.enabled?r=e=a=null:d.default&&(d.kind!=="descriptions"||e?d.kind in s&&!r&&(r=d):e=d)}a?a.mode="showing":r?r.mode="showing":e&&(e.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){typeof k.WebVTT=="function"&&k.WebVTT.processCues(k,[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),r=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),r){for(var a=[],s=0;s<e.length;++s){var o=e[s];o.mode==="showing"&&a.push(o)}this.updateForTrack(a)}else{for(var u=null,c=null,d=e.length;d--;){var h=e[d];h.mode==="showing"&&(h.kind==="descriptions"?u=h:c=h)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))}},n.updateDisplayState=function(e){for(var r=this.player_.textTrackSettings.getValues(),a=e.activeCues,s=a.length;s--;){var o=a[s];if(o){var u=o.displayState;if(r.color&&(u.firstChild.style.color=r.color),r.textOpacity&&Fr(u.firstChild,"color",jr(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(u.firstChild.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&Fr(u.firstChild,"backgroundColor",jr(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?Fr(u,"backgroundColor",jr(r.windowColor,r.windowOpacity)):u.style.backgroundColor=r.windowColor),r.edgeStyle&&(r.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+vn:r.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+vn:r.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+vn:r.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+vn)),r.fontPercent&&r.fontPercent!==1){var c=k.parseFloat(u.style.fontSize);u.style.fontSize=c*r.fontPercent+"px",u.style.height="auto",u.style.top="auto",u.style.bottom="2px"}r.fontFamily&&r.fontFamily!=="default"&&(r.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=Nh[r.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),typeof k.WebVTT=="function"&&!e.every(function(f){return!f.activeCues})){for(var r=[],a=0;a<e.length;++a)for(var s=e[a],o=0;o<s.activeCues.length;++o)r.push(s.activeCues[o]);k.WebVTT.processCues(k,r,this.el_);for(var u=0;u<e.length;++u){for(var c=e[u],d=0;d<c.activeCues.length;++d){var h=c.activeCues[d].displayState;oe(h,"vjs-text-track-cue"),oe(h,"vjs-text-track-cue-"+(c.language?c.language:u))}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},i}(x);x.registerComponent("TextTrackDisplay",Bh);var jh=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(){var n=this.player_.isAudio(),e=this.localize(n?"Audio Player":"Video Player"),r=vt("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[e])}),a=t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return a.appendChild(r),a},i}(x);x.registerComponent("LoadingSpinner",jh);var ee=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.createEl=function(e,r,a){r===void 0&&(r={}),a===void 0&&(a={}),r=lt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},r),a=lt({type:"button"},a);var s=x.prototype.createEl.call(this,"button",r,a);return this.createControlTextEl(s),s},n.addChild=function(e,r){r===void 0&&(r={});var a=this.constructor.name;return Z.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),x.prototype.addChild.call(this,e,r)},n.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(e){z.isEventKey(e,"Space")||z.isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},i}(yn);x.registerComponent("Button",ee);var Do=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).mouseused_=!1,a.on("mousedown",a.handleMouseDown),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var r=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return ge(r),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());var a=this.player_.getChild("controlBar"),s=a&&a.getChild("playToggle");if(s){let u=function(){return s.focus()};var o=u;Pi(r)?r.then(u,function(){}):this.setTimeout(u,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(e){this.mouseused_=!1,t.prototype.handleKeyDown.call(this,e)},n.handleMouseDown=function(e){this.mouseused_=!0},i}(ee);Do.prototype.controlText_="Play Video",x.registerComponent("BigPlayButton",Do);var Fh=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).controlText(r&&r.controlText||a.localize("Close")),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(e){z.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},i}(ee);x.registerComponent("CloseButton",Fh);var Uo=function(t){function i(e,r){var a;return r===void 0&&(r={}),a=t.call(this,e,r)||this,r.replay=r.replay===void 0||r.replay,a.on(e,"play",a.handlePlay),a.on(e,"pause",a.handlePause),r.replay&&a.on(e,"ended",a.handleEnded),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},i}(ee);Uo.prototype.controlText_="Play",x.registerComponent("PlayToggle",Uo);function Ro(t,i){t=t<0?0:t;var n=Math.floor(t%60),e=Math.floor(t/60%60),r=Math.floor(t/3600),a=Math.floor(i/60%60),s=Math.floor(i/3600);return!isNaN(t)&&t!==1/0||(r=e=n="-"),(r=0<r||0<s?r+":":"")+(e=((r||10<=a)&&e<10?"0"+e:e)+":")+(n=n<10?"0"+n:n)}var Hr=Ro;function ti(t,i){return i===void 0&&(i=t),Hr(t,i)}var ei=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).throttledUpdateContent=fe(J(K(a),a.updateContent),30),a.on(e,"timeupdate",a.throttledUpdateContent),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e=this.buildCSSClass(),r=t.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+"\xA0</span>"});return this.contentEl_=vt("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),r.appendChild(this.contentEl_),r},n.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},n.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=U.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},n.formatTime_=function(e){return ti(e)},n.updateFormattedTime_=function(e){var r=this.formatTime_(e);r!==this.formattedTime_&&(this.formattedTime_=r,this.requestAnimationFrame(this.updateTextNode_))},n.updateContent=function(e){},i}(x);ei.prototype.labelText_="Time",ei.prototype.controlText_="Time",x.registerComponent("TimeDisplay",ei);var Vr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,"ended",a.handleEnded),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(r)},n.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},i}(ei);Vr.prototype.labelText_="Current Time",Vr.prototype.controlText_="Current Time",x.registerComponent("CurrentTimeDisplay",Vr);var qr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,"durationchange",a.updateContent),a.on(e,"loadstart",a.updateContent),a.on(e,"loadedmetadata",a.throttledUpdateContent),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var r=this.player_.duration();this.duration_!==r&&(this.duration_=r,this.updateFormattedTime_(r))},i}(ei);qr.prototype.labelText_="Duration",qr.prototype.controlText_="Duration",x.registerComponent("DurationDisplay",qr);var Hh=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},i}(x);x.registerComponent("TimeDivider",Hh);var Wr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,"durationchange",a.throttledUpdateContent),a.on(e,"ended",a.handleEnded),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var e=t.prototype.createEl.call(this);return e.insertBefore(vt("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},n.updateContent=function(e){typeof this.player_.duration()=="number"&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},n.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},i}(ei);Wr.prototype.labelText_="Remaining Time",Wr.prototype.controlText_="Remaining Time",x.registerComponent("RemainingTimeDisplay",Wr);var Vh=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).updateShowing(),a.on(a.player(),"durationchange",a.updateShowing),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=vt("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"\xA0</span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},n.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},i}(x);x.registerComponent("LiveDisplay",Vh);var Mo=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).updateLiveEdgeStatus(),a.player_.liveTracker&&a.on(a.player_.liveTracker,"liveedgechange",a.updateLiveEdgeStatus),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=vt("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},n.updateLiveEdgeStatus=function(e){!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"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,t.prototype.dispose.call(this)},i}(ee);Mo.prototype.controlText_="Seek to live, currently playing live",x.registerComponent("SeekToLive",Mo);var zr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}j(i,t);var n=i.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){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)},n.disable=function(){if(this.enabled()){var 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}},n.createEl=function(e,r,a){return r===void 0&&(r={}),a===void 0&&(a={}),r.className=r.className+" vjs-slider",r=lt({tabIndex:0},r),a=lt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),t.prototype.createEl.call(this,e,r,a)},n.handleMouseDown=function(e){var r=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type!=="touchstart"||le||e.preventDefault(),ms(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(r,"mousemove",this.handleMouseMove),this.on(r,"mouseup",this.handleMouseUp),this.on(r,"touchmove",this.handleMouseMove),this.on(r,"touchend",this.handleMouseUp),this.handleMouseMove(e)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;gs(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},n.update=function(){if(this.el_){var e=this.getPercent(),r=this.bar;if(r){(typeof e!="number"||e!=e||e<0||e===1/0)&&(e=0);var a=(100*e).toFixed(2)+"%",s=r.el().style,o=this.vertical()?"height":"width";return s[o]!==a&&(s[o]=a),e}}},n.calculateDistance=function(e){var r=Yn(this.el_,e);return this.vertical()?r.y:r.x},n.handleKeyDown=function(e){z.isEventKey(e,"Left")||z.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):z.isEventKey(e,"Right")||z.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):t.prototype.handleKeyDown.call(this,e)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},i}(x);x.registerComponent("Slider",zr);var qh=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).partEls_=[],a.on(e,"progress",a.update),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},n.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},n.update=function(e){function r(E,S,C){var L=E/S||0;return L=100*(1<=L?1:L),C&&(L=L.toFixed(2)),L+"%"}var a=this.player_.liveTracker,s=this.player_.buffered(),o=a&&a.isLive()?a.seekableEnd():this.player_.duration(),u=this.player_.bufferedEnd(),c=this.partEls_,d=this.$(".vjs-control-text-loaded-percentage");this.el_.style.width=r(u,o),$e(d,r(u,o,!0));for(var h=0;h<s.length;h++){var f=s.start(h),y=s.end(h),b=c[h];b||(b=this.el_.appendChild(vt()),c[h]=b),b.style.left=r(f,u),b.style.width=r(y-f,u)}for(var _=c.length;_>s.length;_--)this.el_.removeChild(c[_-1]);c.length=s.length},i}(x);x.registerComponent("LoadProgressBar",qh);var Wh=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).update=fe(J(K(a),a.update),30),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,r,a){var s=Ci(this.el_),o=Ci(this.player_.el()),u=e.width*r;if(o&&s){var c=e.left-o.left+u,d=e.width-u+(o.right-e.right),h=s.width/2;c<h?h+=h-c:d<h&&(h=d),h<0?h=0:h>s.width&&(h=s.width),this.el_.style.right="-"+h+"px",this.write(a)}},n.write=function(e){$e(this.el_,e)},n.updateTime=function(e,r,a,s){var o=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var u,c=o.player_.duration();if(o.player_.liveTracker&&o.player_.liveTracker.isLive()){var d=o.player_.liveTracker.liveWindow(),h=d-r*d;u=(h<1?"":"-")+ti(h,d)}else u=ti(a,c);o.update(e,r,u),s&&s()})},i}(x);x.registerComponent("TimeTooltip",Wh);var $r=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).update=fe(J(K(a),a.update),30),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,r){var a=this.getChild("timeTooltip");if(a){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,r,s)}},i}(x);$r.prototype.options_={children:[]},Zt||me||$r.prototype.options_.children.push("timeTooltip"),x.registerComponent("PlayProgressBar",$r);var No=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).update=fe(J(K(a),a.update),30),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,r){var a=this,s=r*this.player_.duration();this.getChild("timeTooltip").updateTime(e,r,s,function(){a.el_.style.left=e.width*r+"px"})},i}(x);No.prototype.options_={children:["timeTooltip"]},x.registerComponent("MouseTimeDisplay",No);var Gr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).setEventHandlers_(),a}j(i,t);var n=i.prototype;return n.setEventHandlers_=function(){this.update=fe(J(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in U&&"visibilityState"in U&&this.on(U,"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){U.hidden?this.disableInterval_(e):(this.enableInterval_(),this.requestAnimationFrame(this.update))},n.enableInterval_=function(){var e=this;this.clearInterval(this.updateInterval),this.updateInterval=this.setInterval(function(){e.requestAnimationFrame(e.update)},30)},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e.type!=="ended"||this.clearInterval(this.updateInterval)},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update_=function(e,r){var a=this.player_.liveTracker,s=this.player_.duration();a&&a.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ti(e,s),ti(s,s)],"{1} of {2}")),this.bar&&this.bar.update(Ci(this.el_),r)},n.update=function(e){if(this.el().offsetParent!==null){var r=t.prototype.update.call(this);return this.update_(this.getCurrentTime_(),r),r}},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.handleEnded=function(e){this.update_(this.player_.duration(),1)},n.getPercent=function(){var e,r=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(e=(r-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(e=1)):e=r/this.player_.duration(),1<=e?1:e||0},n.handleMouseDown=function(e){Ge(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},n.handleMouseMove=function(e){if(Ge(e)){var r,a=this.calculateDistance(e),s=this.player_.liveTracker;if(s&&s.isLive()){var o=s.seekableStart(),u=s.liveCurrentTime();if(u<=(r=o+a*s.liveWindow())&&(r=u),r<=o&&(r=o+.1),r===1/0)return}else(r=a*this.player_.duration())===this.player_.duration()&&(r-=.1);this.player_.currentTime(r)}},n.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},n.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},n.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&ge(this.player_.play())},n.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},n.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(e){if(z.isEventKey(e,"Space")||z.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(z.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(0);else if(z.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.duration());else if(/^[0-9]$/.test(z(e))){e.preventDefault(),e.stopPropagation();var r=10*(z.codes[z(e)]-z.codes[0])/100;this.player_.currentTime(this.player_.duration()*r)}else z.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):z.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):t.prototype.handleKeyDown.call(this,e)},i}(zr);Gr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Zt||me||Gr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),x.registerComponent("SeekBar",Gr);var Bo=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).handleMouseMove=fe(J(K(a),a.handleMouseMove),30),a.throttledHandleMouseSeek=fe(J(K(a),a.handleMouseSeek),30),a.enable(),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var r=this.getChild("seekBar");if(r){var a=r.getChild("mouseTimeDisplay"),s=r.el(),o=Ci(s),u=Yn(s,e).x;1<u?u=1:u<0&&(u=0),a&&a.update(o,u)}},n.handleMouseSeek=function(e){var r=this.getChild("seekBar");r&&r.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},n.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.handleMouseDown=function(e){var r=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(r,"mousemove",this.throttledHandleMouseSeek),this.on(r,"touchmove",this.throttledHandleMouseSeek),this.on(r,"mouseup",this.handleMouseUp),this.on(r,"touchend",this.handleMouseUp)},n.handleMouseUp=function(e){var r=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseUp(e),this.off(r,"mousemove",this.throttledHandleMouseSeek),this.off(r,"touchmove",this.throttledHandleMouseSeek),this.off(r,"mouseup",this.handleMouseUp),this.off(r,"touchend",this.handleMouseUp)},i}(x);Bo.prototype.options_={children:["seekBar"]},x.registerComponent("ProgressControl",Bo);var jo=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],a.handlePictureInPictureChange),U.pictureInPictureEnabled||a.disable(),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+t.prototype.buildCSSClass.call(this)},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture")},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(ee);jo.prototype.controlText_="Picture-in-Picture",x.registerComponent("PictureInPictureToggle",jo);var Fo=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,"fullscreenchange",a.handleFullscreenChange),U[e.fsApi_.fullscreenEnabled]===!1&&a.disable(),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(ee);Fo.prototype.controlText_="Fullscreen",x.registerComponent("FullscreenToggle",Fo);var zh=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},i}(x);x.registerComponent("VolumeLevel",zh);var Xr=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on("slideractive",a.updateLastVolume_),a.on(e,"volumechange",a.updateARIAAttributes),e.ready(function(){return a.updateARIAAttributes()}),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(e){Ge(e)&&t.prototype.handleMouseDown.call(this,e)},n.handleMouseMove=function(e){Ge(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var r=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",r),this.el_.setAttribute("aria-valuetext",r+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,r=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(r)})},i}(zr);Xr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Xr.prototype.playerEvent="volumechange",x.registerComponent("VolumeBar",Xr);var Ho=function(t){function i(e,r){var a;return r===void 0&&(r={}),r.vertical=r.vertical||!1,typeof r.volumeBar!="undefined"&&!bi(r.volumeBar)||(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),function(s,o){o.tech_&&!o.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(K(a=t.call(this,e,r)||this),e),a.throttledHandleMouseMove=fe(J(K(a),a.handleMouseMove),30),a.on("mousedown",a.handleMouseDown),a.on("touchstart",a.handleMouseDown),a.on(a.volumeBar,["focus","slideractive"],function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")}),a.on(a.volumeBar,["blur","sliderinactive"],function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")}),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},n.handleMouseDown=function(e){var r=this.el_.ownerDocument;this.on(r,"mousemove",this.throttledHandleMouseMove),this.on(r,"touchmove",this.throttledHandleMouseMove),this.on(r,"mouseup",this.handleMouseUp),this.on(r,"touchend",this.handleMouseUp)},n.handleMouseUp=function(e){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseMove),this.off(r,"touchmove",this.throttledHandleMouseMove),this.off(r,"mouseup",this.handleMouseUp),this.off(r,"touchend",this.handleMouseUp)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},i}(x);Ho.prototype.options_={children:["volumeBar"]},x.registerComponent("VolumeControl",Ho);var Vo=function(t){function i(e,r){var a;return function(s,o){o.tech_&&!o.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(K(a=t.call(this,e,r)||this),e),a.on(e,["loadstart","volumechange"],a.update),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var r=this.player_.volume(),a=this.player_.lastVolume_();if(r===0){var s=a<.1?.1:a;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),r=3;Zt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?r=0:e<.33?r=1:e<.67&&(r=2);for(var a=0;a<4;a++)Si(this.el_,"vjs-vol-"+a);oe(this.el_,"vjs-vol-"+r)},n.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},i}(ee);Vo.prototype.controlText_="Mute",x.registerComponent("MuteToggle",Vo);var qo=function(t){function i(e,r){var a;return r===void 0&&(r={}),typeof r.inline!="undefined"?r.inline=r.inline:r.inline=!0,typeof r.volumeControl!="undefined"&&!bi(r.volumeControl)||(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline),(a=t.call(this,e,r)||this).on(e,["loadstart"],a.volumePanelState_),a.on(a.muteToggle,"keyup",a.handleKeyPress),a.on(a.volumeControl,"keyup",a.handleVolumeControlKeyUp),a.on("keydown",a.handleKeyPress),a.on("mouseover",a.handleMouseOver),a.on("mouseout",a.handleMouseOut),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}j(i,t);var n=i.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){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")},n.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},n.dispose=function(){this.handleMouseOut(),t.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){z.isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),Ht(U,"keyup",J(this,this.handleKeyPress))},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ct(U,"keyup",J(this,this.handleKeyPress))},n.handleKeyPress=function(e){z.isEventKey(e,"Esc")&&this.handleMouseOut()},i}(x);qo.prototype.options_={children:["muteToggle","volumeControl"]},x.registerComponent("VolumePanel",qo);var Kr=function(t){function i(e,r){var a;return a=t.call(this,e,r)||this,r&&(a.menuButton_=r.menuButton),a.focusedChild_=-1,a.on("keydown",a.handleKeyDown),a.boundHandleBlur_=J(K(a),a.handleBlur),a.boundHandleTapClick_=J(K(a),a.handleTapClick),a}j(i,t);var n=i.prototype;return n.addEventListenerForItem=function(e){e instanceof x&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof x&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),t.prototype.removeChild.call(this,e)},n.addItem=function(e){var r=this.addChild(e);r&&this.addEventListenerForItem(r)},n.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=vt(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),Ht(r,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),r},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,t.prototype.dispose.call(this)},n.handleBlur=function(e){var r=e.relatedTarget||U.activeElement;if(!this.children().some(function(s){return s.el()===r})){var a=this.menuButton_;a&&a.buttonPressed_&&r!==a.el().firstChild&&a.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var r=this.children();if(!Array.isArray(r))return;var a=r.filter(function(s){return s.el()===e.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},n.handleKeyDown=function(e){z.isEventKey(e,"Left")||z.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(z.isEventKey(e,"Right")||z.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){e===void 0&&(e=0);var r=this.children().slice();r.length&&r[0].className&&/vjs-menu-title/.test(r[0].className)&&r.shift(),0<r.length&&(e<0?e=0:e>=r.length&&(e=r.length-1),r[this.focusedChild_=e].el_.focus())},i}(x);x.registerComponent("Menu",Kr);var Yr=function(t){function i(e,r){var a;r===void 0&&(r={}),(a=t.call(this,e,r)||this).menuButton_=new ee(e,r),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ee.prototype.buildCSSClass();return a.menuButton_.el_.className=a.buildCSSClass()+" "+s,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0,a.on(a.menuButton_,"tap",a.handleClick),a.on(a.menuButton_,"click",a.handleClick),a.on(a.menuButton_,"keydown",a.handleKeyDown),a.on(a.menuButton_,"mouseenter",function(){a.addClass("vjs-hover"),a.menu.show(),Ht(U,"keyup",J(K(a),a.handleMenuKeyUp))}),a.on("mouseleave",a.handleMouseLeave),a.on("keydown",a.handleSubmenuKeyDown),a}j(i,t);var n=i.prototype;return n.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},n.createMenu=function(){var e=new Kr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=vt("li",{className:"vjs-menu-title",innerHTML:ft(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var a=new x(this.player_,{el:r});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var s=0;s<this.items.length;s++)e.addItem(this.items[s]);return e},n.createItems=function(){},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+ee.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},n.controlText=function(e,r){return r===void 0&&(r=this.menuButton_.el()),this.menuButton_.controlText(e,r)},n.dispose=function(){this.handleMouseLeave(),t.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Ct(U,"keyup",J(this,this.handleMenuKeyUp))},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){z.isEventKey(e,"Esc")||z.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),z.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(z.isEventKey(e,"Up")||z.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(z.isEventKey(e,"Esc")||z.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(z.isEventKey(e,"Esc")||z.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),z.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Zt&&cs())return;this.menu.focus()}},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},i}(x);x.registerComponent("MenuButton",Yr);var Qr=function(t){function i(n,e){var r,a=e.tracks;if((r=t.call(this,n,e)||this).items.length<=1&&r.hide(),!a)return K(r);var s=J(K(r),r.update);return a.addEventListener("removetrack",s),a.addEventListener("addtrack",s),r.player_.on("ready",s),r.player_.on("dispose",function(){a.removeEventListener("removetrack",s),a.removeEventListener("addtrack",s)}),r}return j(i,t),i}(Yr);x.registerComponent("TrackButton",Qr);var $h=["Tab","Esc","Up","Down","Right","Left"],Ni=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).selectable=r.selectable,a.isSelected_=r.selected||!1,a.multiSelectable=r.multiSelectable,a.selected(a.isSelected_),a.selectable?a.multiSelectable?a.el_.setAttribute("role","menuitemcheckbox"):a.el_.setAttribute("role","menuitemradio"):a.el_.setAttribute("role","menuitem"),a}j(i,t);var n=i.prototype;return n.createEl=function(e,r,a){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",lt({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},r),a)},n.handleKeyDown=function(e){$h.some(function(r){return z.isEventKey(e,r)})||t.prototype.handleKeyDown.call(this,e)},n.handleClick=function(e){this.selected(!0)},n.selected=function(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))},i}(yn);x.registerComponent("MenuItem",Ni);var Bi=function(t){function i(e,r){var a,s=r.track,o=e.textTracks();r.label=s.label||s.language||"Unknown",r.selected=s.mode==="showing",(a=t.call(this,e,r)||this).track=s,a.kinds=(r.kinds||[r.kind||a.track.kind]).filter(Boolean);function u(){for(var h=arguments.length,f=new Array(h),y=0;y<h;y++)f[y]=arguments[y];a.handleTracksChange.apply(K(a),f)}function c(){for(var h=arguments.length,f=new Array(h),y=0;y<h;y++)f[y]=arguments[y];a.handleSelectedLanguageChange.apply(K(a),f)}var d;return e.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",c),a.on("dispose",function(){e.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",c)}),o.onchange===void 0&&a.on(["tap","click"],function(){if(typeof k.Event!="object")try{d=new k.Event("change")}catch(h){}d||(d=U.createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(d)}),a.handleTracksChange(),a}j(i,t);var n=i.prototype;return n.handleClick=function(e){var r=this.track,a=this.player_.textTracks();if(t.prototype.handleClick.call(this,e),a)for(var s=0;s<a.length;s++){var o=a[s];this.kinds.indexOf(o.kind)!==-1&&(o===r?o.mode!=="showing"&&(o.mode="showing"):o.mode!=="disabled"&&(o.mode="disabled"))}},n.handleTracksChange=function(e){var r=this.track.mode==="showing";r!==this.isSelected_&&this.selected(r)},n.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var r=this.player_.cache_.selectedLanguage;if(r&&r.enabled&&r.language===this.track.language&&r.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},n.dispose=function(){this.track=null,t.prototype.dispose.call(this)},i}(Ni);x.registerComponent("TextTrackMenuItem",Bi);var Wo=function(t){function i(e,r){return r.track={player:e,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,t.call(this,e,r)||this}j(i,t);var n=i.prototype;return n.handleTracksChange=function(e){for(var r=this.player().textTracks(),a=!0,s=0,o=r.length;s<o;s++){var u=r[s];if(-1<this.options_.kinds.indexOf(u.kind)&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},n.handleSelectedLanguageChange=function(e){for(var r=this.player().textTracks(),a=!0,s=0,o=r.length;s<o;s++){var u=r[s];if(-1<["captions","descriptions","subtitles"].indexOf(u.kind)&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(Bi);x.registerComponent("OffTextTrackMenuItem",Wo);var ii=function(t){function i(n,e){return e===void 0&&(e={}),e.tracks=n.textTracks(),t.call(this,n,e)||this}return j(i,t),i.prototype.createItems=function(n,e){var r;n===void 0&&(n=[]),e===void 0&&(e=Bi),this.label_&&(r=this.label_+" off"),n.push(new Wo(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;var a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var s=0;s<a.length;s++){var o=a[s];if(-1<this.kinds_.indexOf(o.kind)){var u=new e(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass("vjs-"+o.kind+"-menu-item"),n.push(u)}}return n},i}(Qr);x.registerComponent("TextTrackButton",ii);var zo=function(t){function i(e,r){var a,s=r.track,o=r.cue,u=e.currentTime();return r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=u&&u<o.endTime,(a=t.call(this,e,r)||this).track=s,a.cue=o,s.addEventListener("cuechange",J(K(a),a.update)),a}j(i,t);var n=i.prototype;return n.handleClick=function(e){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},n.update=function(e){var r=this.cue,a=this.player_.currentTime();this.selected(r.startTime<=a&&a<r.endTime)},i}(Ni);x.registerComponent("ChaptersTrackMenuItem",zo);var Jr=function(t){function i(e,r,a){return t.call(this,e,r,a)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},n.update=function(e){this.track_&&(!e||e.type!=="addtrack"&&e.type!=="removetrack")||this.setTrack(this.findChaptersTrack()),t.prototype.update.call(this)},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var r=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);r&&r.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],r=e.length-1;0<=r;r--){var a=e[r];if(a.kind===this.kind_)return a}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(ft(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var r=this.track_.cues;if(!r)return e;for(var a=0,s=r.length;a<s;a++){var o=r[a],u=new zo(this.player_,{track:this.track_,cue:o});e.push(u)}return e},i}(ii);Jr.prototype.kind_="chapters",Jr.prototype.controlText_="Chapters",x.registerComponent("ChaptersButton",Jr);var Zr=function(t){function i(e,r,a){var s;s=t.call(this,e,r,a)||this;var o=e.textTracks(),u=J(K(s),s.handleTracksChange);return o.addEventListener("change",u),s.on("dispose",function(){o.removeEventListener("change",u)}),s}j(i,t);var n=i.prototype;return n.handleTracksChange=function(e){for(var r=this.player().textTracks(),a=!1,s=0,o=r.length;s<o;s++){var u=r[s];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},i}(ii);Zr.prototype.kind_="descriptions",Zr.prototype.controlText_="Descriptions",x.registerComponent("DescriptionsButton",Zr);var ta=function(t){function i(e,r,a){return t.call(this,e,r,a)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},i}(ii);ta.prototype.kind_="subtitles",ta.prototype.controlText_="Subtitles",x.registerComponent("SubtitlesButton",ta);var ea=function(t){function i(n,e){var r;return e.track={player:n,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",(r=t.call(this,n,e)||this).addClass("vjs-texttrack-settings"),r.controlText(", opens "+e.kind+" settings dialog"),r}return j(i,t),i.prototype.handleClick=function(n){this.player().getChild("textTrackSettings").open()},i}(Bi);x.registerComponent("CaptionSettingsMenuItem",ea);var ia=function(t){function i(e,r,a){return t.call(this,e,r,a)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ea(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},i}(ii);ia.prototype.kind_="captions",ia.prototype.controlText_="Captions",x.registerComponent("CaptionsButton",ia);var $o=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(n,e,r){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return this.options_.track.kind==="captions"&&(a+=`
<span aria-hidden="true" class="vjs-icon-placeholder"></span>
<span class="vjs-control-text"> `+this.localize("Captions")+`</span>
`),a+="</span>",t.prototype.createEl.call(this,n,lt({innerHTML:a},e),r)},i}(Bi);x.registerComponent("SubsCapsMenuItem",$o);var na=function(t){function i(e,r){var a;return r===void 0&&(r={}),(a=t.call(this,e,r)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(a.player_.language_)&&(a.label_="captions"),a.menuButton_.controlText(ft(a.label_)),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ea(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,$o)},i}(ii);na.prototype.kinds_=["captions","subtitles"],na.prototype.controlText_="Subtitles",x.registerComponent("SubsCapsButton",na);var Go=function(t){function i(e,r){var a,s=r.track,o=e.audioTracks();r.label=s.label||s.language||"Unknown",r.selected=s.enabled,(a=t.call(this,e,r)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");function u(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];a.handleTracksChange.apply(K(a),d)}return o.addEventListener("change",u),a.on("dispose",function(){o.removeEventListener("change",u)}),a}j(i,t);var n=i.prototype;return n.createEl=function(e,r,a){var s='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return this.options_.track.kind==="main-desc"&&(s+=`
<span aria-hidden="true" class="vjs-icon-placeholder"></span>
<span class="vjs-control-text"> `+this.localize("Descriptions")+`</span>
`),s+="</span>",t.prototype.createEl.call(this,e,lt({innerHTML:s},r),a)},n.handleClick=function(e){var r=this.player_.audioTracks();t.prototype.handleClick.call(this,e);for(var a=0;a<r.length;a++){var s=r[a];s.enabled=s===this.track}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},i}(Ni);x.registerComponent("AudioTrackMenuItem",Go);var Xo=function(t){function i(e,r){return r===void 0&&(r={}),r.tracks=e.audioTracks(),t.call(this,e,r)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var r=this.player_.audioTracks(),a=0;a<r.length;a++){var s=r[a];e.push(new Go(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e},i}(Qr);Xo.prototype.controlText_="Audio Track",x.registerComponent("AudioTrackButton",Xo);var ra=function(t){function i(e,r){var a,s=r.rate,o=parseFloat(s,10);return r.label=s,r.selected=o===1,r.selectable=!0,r.multiSelectable=!1,(a=t.call(this,e,r)||this).label=s,a.rate=o,a.on(e,"ratechange",a.update),a}j(i,t);var n=i.prototype;return n.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},i}(Ni);ra.prototype.contentElType="button",x.registerComponent("PlaybackRateMenuItem",ra);var Ko=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).updateVisibility(),a.updateLabel(),a.on(e,"loadstart",a.updateVisibility),a.on(e,"ratechange",a.updateLabel),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=vt("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},n.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},n.createMenu=function(){var e=new Kr(this.player()),r=this.playbackRates();if(r)for(var a=r.length-1;0<=a;a--)e.addChild(new ra(this.player(),{rate:r[a]+"x"}));return e},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var r=this.player().playbackRate(),a=this.playbackRates(),s=a[0],o=0;o<a.length;o++)if(a[o]>r){s=a[o];break}this.player().playbackRate(s)},n.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},i}(Yr);Ko.prototype.controlText_="Playback Rate",x.registerComponent("PlaybackRateMenuButton",Ko);var Yo=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},i}(x);x.registerComponent("Spacer",Yo);var Gh=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},n.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML="\xA0",e},i}(Yo);x.registerComponent("CustomControlSpacer",Gh);var _n=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(x);_n.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in U&&_n.prototype.options_.children.splice(_n.prototype.options_.children.length-1,0,"pictureInPictureToggle"),x.registerComponent("ControlBar",_n);var Qo=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).on(e,"error",a.open),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},i}(Ye);Qo.prototype.options_=at(Ye.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),x.registerComponent("ErrorDisplay",Qo);var aa="vjs-text-track-settings",Jo=["#000","Black"],Zo=["#00F","Blue"],tu=["#0FF","Cyan"],eu=["#0F0","Green"],iu=["#F0F","Magenta"],nu=["#F00","Red"],ru=["#FFF","White"],au=["#FF0","Yellow"],sa=["1","Opaque"],oa=["0.5","Semi-Transparent"],su=["0","Transparent"],Ie={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Jo,ru,nu,eu,Zo,au,iu,tu]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[sa,oa,su]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ru,Jo,nu,eu,Zo,au,iu,tu]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[sa,oa]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[su,oa,sa]}};function ou(t,i){if(i&&(t=i(t)),t&&t!=="none")return t}Ie.windowColor.options=Ie.backgroundColor.options;var Xh=function(t){function i(e,r){var a;return r.temporary=!1,(a=t.call(this,e,r)||this).updateDisplay=J(K(a),a.updateDisplay),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=vt("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),r.persistTextTrackSettings===void 0&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),We(Ie,function(s){a.on(a.$(s.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}j(i,t);var n=i.prototype;return n.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},n.createElSelect_=function(e,r,a){var s=this;r===void 0&&(r=""),a===void 0&&(a="label");var o=Ie[e],u=o.id.replace("%s",this.id_),c=[r,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(o.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(o.options.map(function(d){var h=u+"-"+d[1].replace(/\W+/g,"");return['<option id="'+h+'" value="'+d[0]+'" ','aria-labelledby="'+c+" "+h+'">',s.localize(d[1]),"</option>"].join("")})).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return vt("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return vt("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return vt("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e=this;return function(r,a,s){return s===void 0&&(s=0),os(r).reduce(function(o,u){return a(o,r[u],u)},s)}(Ie,function(r,a,s){var o=function(u,c){return ou(u.options[u.options.selectedIndex].value,c)}(e.$(a.selector),a.parser);return o!==void 0&&(r[s]=o),r},{})},n.setValues=function(e){var r=this;We(Ie,function(a,s){(function(o,u,c){if(u){for(var d=0;d<o.options.length;d++)if(ou(o.options[d].value,c)===u){o.selectedIndex=d;break}}})(r.$(a.selector),e[s],a.parser)})},n.setDefaults=function(){var e=this;We(Ie,function(r){var a=r.hasOwnProperty("default")?r.default:0;e.$(r.selector).selectedIndex=a})},n.restoreSettings=function(){var e;try{e=JSON.parse(k.localStorage.getItem(aa))}catch(r){Z.warn(r)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(aa,JSON.stringify(e)):k.localStorage.removeItem(aa)}catch(r){Z.warn(r)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,r=e&&e.subsCapsButton,a=e&&e.captionsButton;r?r.focus():a&&a.focus()},i}(Ye);x.registerComponent("TextTrackSettings",Xh);var Kh=function(t){function i(e,r){var a,s=r.ResizeObserver||k.ResizeObserver;r.ResizeObserver===null&&(s=!1);var o=at({createEl:!s,reportTouchActivity:!1},r);return(a=t.call(this,e,o)||this).ResizeObserver=r.ResizeObserver||k.ResizeObserver,a.loadListener_=null,a.resizeObserver_=null,a.debouncedHandler_=function(u,c,d,h){var f;h===void 0&&(h=k);function y(){var b=this,_=arguments,E=function(){E=f=null,d||u.apply(b,_)};!f&&d&&u.apply(b,_),h.clearTimeout(f),f=h.setTimeout(E,c)}return y.cancel=function(){h.clearTimeout(f),f=null},y}(function(){a.resizeHandler()},100,!1,K(a)),s?(a.resizeObserver_=new a.ResizeObserver(a.debouncedHandler_),a.resizeObserver_.observe(e.el())):(a.loadListener_=function(){if(a.el_&&a.el_.contentWindow){var u=a.debouncedHandler_,c=a.unloadListener_=function(){Ct(this,"resize",u),Ct(this,"unload",c),c=null};Ht(a.el_.contentWindow,"unload",c),Ht(a.el_.contentWindow,"resize",u)}},a.one("load",a.loadListener_)),a}j(i,t);var n=i.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},n.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},n.dispose=function(){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,t.prototype.dispose.call(this)},i}(x);x.registerComponent("ResizeManager",Kh);var Yh=function(t){function i(e,r){var a,s=at({createEl:!1},r);return(a=t.call(this,e,s)||this).reset_(),a.on(a.player_,"durationchange",a.handleDurationchange),fr&&"hidden"in U&&"visibilityState"in U&&a.on(U,"visibilitychange",a.handleVisibilityChange),a}j(i,t);var n=i.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(U.hidden?this.stopTracking():this.startTracking())},n.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),r=this.player_.currentTime(),a=2*this.seekableIncrement_+.07;return e!==1/0&&r<=e-a},n.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var r=this.seekableEnd();r!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrementList_=this.seekableIncrementList_.slice(-11),this.seekableIncrementList_.push(Math.abs(r-this.lastSeekEnd_)),3<this.seekableIncrementList_.length&&(this.seekableIncrement_=function(a){var s=Math.floor(a.length/2),o=[].concat(a).sort(function(u,c){return u-c});return a.length%2!=0?o[s]:(o[s-1]+o[s])/2}(this.seekableIncrementList_))),this.pastSeekEnd_=0,this.lastSeekEnd_=r,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},n.startTracking=function(){var e=this;this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.timeupdateSeen_||(this.one(this.player_,"play",this.handlePlay),this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},n.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.seekableIncrementList_=[],this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},n.stopTracking=function(){this.isTracking()&&this.reset_()},n.seekableEnd=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.end(a));return r.length?r.sort()[r.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.start(a));return r.length?r.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){return this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return typeof this.trackingInterval_=="number"},n.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},n.dispose=function(){this.stopTracking(),t.prototype.dispose.call(this)},i}(x);x.registerComponent("LiveTracker",Yh);function ua(t){var i=t.el();if(i.hasAttribute("src"))return t.triggerSourceset(i.src),!0;var n=t.$$("source"),e=[],r="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&e.indexOf(s)===-1&&e.push(s)}return!!e.length&&(e.length===1&&(r=e[0]),t.triggerSourceset(r),!0)}function uu(t,i){for(var n={},e=0;e<t.length&&!((n=Object.getOwnPropertyDescriptor(t[e],i))&&n.set&&n.get);e++);return n.enumerable=!0,n.configurable=!0,n}function lu(t){var i=t.el();if(!i.resetSourceWatch_){let a=function(s){return function(){for(var o=arguments.length,u=new Array(o),c=0;c<o;c++)u[c]=arguments[c];var d=s.apply(i,u);return ua(t),d}};var r=a,n={},e=function(s){return uu([s.el(),k.HTMLMediaElement.prototype,k.Element.prototype,Jh],"innerHTML")}(t);["append","appendChild","insertAdjacentHTML"].forEach(function(s){i[s]&&(n[s]=i[s],i[s]=a(n[s]))}),Object.defineProperty(i,"innerHTML",at(e,{set:a(e.set)})),i.resetSourceWatch_=function(){i.resetSourceWatch_=null,Object.keys(n).forEach(function(s){i[s]=n[s]}),Object.defineProperty(i,"innerHTML",e)},t.one("sourceset",i.resetSourceWatch_)}}function Qh(t){if(t.featuresSourceset){var i=t.el();if(!i.resetSourceset_){var n=function(a){return uu([a.el(),k.HTMLMediaElement.prototype,Zh],"src")}(t),e=i.setAttribute,r=i.load;Object.defineProperty(i,"src",at(n,{set:function(a){var s=n.set.call(i,a);return t.triggerSourceset(i.src),s}})),i.setAttribute=function(a,s){var o=e.call(i,a,s);return/src/i.test(a)&&t.triggerSourceset(i.src),o},i.load=function(){var a=r.call(i);return ua(t)||(t.triggerSourceset(""),lu(t)),a},i.currentSrc?t.triggerSourceset(i.currentSrc):ua(t)||lu(t),i.resetSourceset_=function(){i.resetSourceset_=null,i.load=r,i.setAttribute=e,Object.defineProperty(i,"src",n),i.resetSourceWatch_&&i.resetSourceWatch_()}}}}var Jh=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var i=U.createElement(this.nodeName.toLowerCase());i.innerHTML=t;for(var n=U.createDocumentFragment();i.childNodes.length;)n.appendChild(i.childNodes[0]);return this.innerText="",k.Element.prototype.appendChild.call(this,n),this.innerHTML}}),Zh=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?$s(k.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return k.Element.prototype.setAttribute.call(this,"src",t),t}}),M=function(t){function i(e,r){var a;a=t.call(this,e,r)||this;var s=e.source,o=!1;if(s&&(a.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?a.setSource(s):a.handleLateInit_(a.el_),e.enableSourceset&&a.setupSourcesetHandling_(),a.el_.hasChildNodes()){for(var u=a.el_.childNodes,c=u.length,d=[];c--;){var h=u[c];h.nodeName.toLowerCase()==="track"&&(a.featuresNativeTextTracks?(a.remoteTextTrackEls().addTrackElement_(h),a.remoteTextTracks().addTrack(h.track),a.textTracks().addTrack(h.track),o||a.el_.hasAttribute("crossorigin")||!un(h.src)||(o=!0)):d.push(h))}for(var f=0;f<d.length;f++)a.el_.removeChild(d[f])}return a.proxyNativeTracks_(),a.featuresNativeTextTracks&&o&&Z.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
This may prevent text tracks from loading.`),a.restoreMetadataTracksInIOSNativePlayer_(),(wi||hr||Ns)&&e.nativeControlsForTouch===!0&&a.setControls(!0),a.proxyWebkitFullscreen_(),a.triggerReady(),a}j(i,t);var n=i.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){Qh(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){function e(){r=[];for(var o=0;o<a.length;o++){var u=a[o];u.kind==="metadata"&&r.push({track:u,storedMode:u.mode})}}var r,a=this.textTracks();e(),a.addEventListener("change",e),this.on("dispose",function(){return a.removeEventListener("change",e)});function s(){for(var o=0;o<r.length;o++){var u=r[o];u.track.mode==="disabled"&&u.track.mode!==u.storedMode&&(u.track.mode=u.storedMode)}a.removeEventListener("change",s)}this.on("webkitbeginfullscreen",function(){a.removeEventListener("change",e),a.removeEventListener("change",s),a.addEventListener("change",s)}),this.on("webkitendfullscreen",function(){a.removeEventListener("change",e),a.addEventListener("change",e),a.removeEventListener("change",s)})},n.overrideNative_=function(e,r){var a=this;if(r===this["featuresNative"+e+"Tracks"]){var s=e.toLowerCase();this[s+"TracksListeners_"]&&Object.keys(this[s+"TracksListeners_"]).forEach(function(o){a.el()[s+"Tracks"].removeEventListener(o,a[s+"TracksListeners_"][o])}),this["featuresNative"+e+"Tracks"]=!r,this[s+"TracksListeners_"]=null,this.proxyNativeTracksForType_(s)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var r=this,a=$t[e],s=this.el()[a.getterName],o=this[a.getterName]();if(this["featuresNative"+a.capitalName+"Tracks"]&&s&&s.addEventListener){let d=function(){for(var h=[],f=0;f<o.length;f++){for(var y=!1,b=0;b<s.length;b++)if(s[b]===o[f]){y=!0;break}y||h.push(o[f])}for(;h.length;)o.removeTrack(h.shift())};var c=d,u={change:function(h){o.trigger({type:"change",target:o,currentTarget:o,srcElement:o})},addtrack:function(h){o.addTrack(h.track)},removetrack:function(h){o.removeTrack(h.track)}};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(h){var f=u[h];s.addEventListener(h,f),r.on("dispose",function(y){return s.removeEventListener(h,f)})}),this.on("loadstart",d),this.on("dispose",function(h){return r.off("loadstart",d)})}},n.proxyNativeTracks_=function(){var e=this;$t.names.forEach(function(r){e.proxyNativeTracksForType_(r)})},n.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),i.disposeMediaElement(e),e=r}else{e=U.createElement("video");var a=at({},this.options_.tag&&ue(this.options_.tag));wi&&this.options_.nativeControlsForTouch===!0||delete a.controls,ps(e,lt(a,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload!="undefined"&&ki(e,"preload",this.options_.preload);for(var s=["loop","muted","playsinline","autoplay"],o=0;o<s.length;o++){var u=s[o],c=this.options_[u];typeof c!="undefined"&&(c?ki(e,u,u):tn(e,u),e[u]=c)}return e},n.handleLateInit_=function(e){if(e.networkState!==0&&e.networkState!==3){if(e.readyState===0){let u=function(){r=!0},c=function(){r||this.trigger("loadstart")};var s=u,o=c,r=!1;return this.on("loadstart",u),this.on("loadedmetadata",c),void this.ready(function(){this.off("loadstart",u),this.off("loadedmetadata",c),r||this.trigger("loadstart")})}var a=["loadstart"];a.push("loadedmetadata"),2<=e.readyState&&a.push("loadeddata"),3<=e.readyState&&a.push("canplay"),4<=e.readyState&&a.push("canplaythrough"),this.ready(function(){a.forEach(function(u){this.trigger(u)},this)})}},n.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(r){Z(r,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&me&&le&&this.el_.currentTime===0?(this.on("timeupdate",function r(){0<e.el_.currentTime&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",r))}),NaN):this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){let s=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},o=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",s),this.trigger("fullscreenchange",{isFullscreen:!0}))};var r=s,a=o;this.on("webkitbeginfullscreen",o),this.on("dispose",function(){e.off("webkitbeginfullscreen",o),e.off("webkitendfullscreen",s)})}},n.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=k.navigator&&k.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){e.pause(),e.webkitEnterFullScreen()},0)):e.webkitEnterFullScreen()},n.exitFullScreen=function(){this.el_.webkitExitFullScreen()},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},n.reset=function(){i.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(e,r,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,r,a):t.prototype.addTextTrack.call(this,e,r,a)},n.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var r=U.createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},n.addRemoteTextTrack=function(e,r){var a=t.prototype.addRemoteTextTrack.call(this,e,r);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},n.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var r=this.$$("track"),a=r.length;a--;)e!==r[a]&&e!==r[a].track||this.el().removeChild(r[a])},n.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount!="undefined"&&typeof this.el().webkitDecodedFrameCount!="undefined"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),k.performance&&typeof k.performance.now=="function"?e.creationTime=k.performance.now():k.performance&&k.performance.timing&&typeof k.performance.timing.navigationStart=="number"&&(e.creationTime=k.Date.now()-k.performance.timing.navigationStart),e},i}(st);if(ze()){M.TEST_VID=U.createElement("video");var bn=U.createElement("track");bn.kind="captions",bn.srclang="en",bn.label="English",M.TEST_VID.appendChild(bn)}M.isSupported=function(){try{M.TEST_VID.volume=.5}catch(t){return!1}return!(!M.TEST_VID||!M.TEST_VID.canPlayType)},M.canPlayType=function(t){return M.TEST_VID.canPlayType(t)},M.canPlaySource=function(t,i){return M.canPlayType(t.type)},M.canControlVolume=function(){try{var t=M.TEST_VID.volume;return M.TEST_VID.volume=t/2+.1,t!==M.TEST_VID.volume}catch(i){return!1}},M.canMuteVolume=function(){try{var t=M.TEST_VID.muted;return M.TEST_VID.muted=!t,M.TEST_VID.muted?ki(M.TEST_VID,"muted","muted"):tn(M.TEST_VID,"muted"),t!==M.TEST_VID.muted}catch(i){return!1}},M.canControlPlaybackRate=function(){if(me&&le&&js<58)return!1;try{var t=M.TEST_VID.playbackRate;return M.TEST_VID.playbackRate=t/2+.1,t!==M.TEST_VID.playbackRate}catch(i){return!1}},M.canOverrideAttributes=function(){try{let i=function(){};var t=i;Object.defineProperty(U.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"innerHTML",{get:i,set:i})}catch(i){return!1}return!0},M.supportsNativeTextTracks=function(){return mr||Zt&&le},M.supportsNativeVideoTracks=function(){return!(!M.TEST_VID||!M.TEST_VID.videoTracks)},M.supportsNativeAudioTracks=function(){return!(!M.TEST_VID||!M.TEST_VID.audioTracks)},M.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],M.prototype.featuresVolumeControl=M.canControlVolume(),M.prototype.featuresMuteControl=M.canMuteVolume(),M.prototype.featuresPlaybackRate=M.canControlPlaybackRate(),M.prototype.featuresSourceset=M.canOverrideAttributes(),M.prototype.movingMediaElementInDOM=!Zt,M.prototype.featuresFullscreenResize=!0,M.prototype.featuresProgressEvents=!0,M.prototype.featuresTimeupdateEvents=!0,M.prototype.featuresNativeTextTracks=M.supportsNativeTextTracks(),M.prototype.featuresNativeVideoTracks=M.supportsNativeVideoTracks(),M.prototype.featuresNativeAudioTracks=M.supportsNativeAudioTracks();var cu=M.TEST_VID&&M.TEST_VID.constructor.prototype.canPlayType,td=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;M.patchCanPlayType=function(){4<=dr&&!Bs&&!le&&(M.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&td.test(t)?"maybe":cu.call(this,t)})},M.unpatchCanPlayType=function(){var t=M.TEST_VID.constructor.prototype.canPlayType;return M.TEST_VID.constructor.prototype.canPlayType=cu,t},M.patchCanPlayType(),M.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch(i){}}()}},M.resetMediaElement=function(t){if(t){for(var i=t.querySelectorAll("source"),n=i.length;n--;)t.removeChild(i[n]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){M.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){M.prototype["set"+ft(t)]=function(i){(this.el_[t]=i)?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(t){M.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(t){M.prototype["set"+ft(t)]=function(i){this.el_[t]=i}}),["pause","load","play"].forEach(function(t){M.prototype[t]=function(){return this.el_[t]()}}),st.withSourceHandlers(M),M.nativeSourceHandler={},M.nativeSourceHandler.canPlayType=function(t){try{return M.TEST_VID.canPlayType(t)}catch(i){return""}},M.nativeSourceHandler.canHandleSource=function(t,i){if(t.type)return M.nativeSourceHandler.canPlayType(t.type);if(t.src){var n=kr(t.src);return M.nativeSourceHandler.canPlayType("video/"+n)}return""},M.nativeSourceHandler.handleSource=function(t,i,n){i.setSrc(t.src)},M.nativeSourceHandler.dispose=function(){},M.registerSourceHandler(M.nativeSourceHandler),st.registerTech("Html5",M);var hu=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],la={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ca=["tiny","xsmall","small","medium","large","xlarge","huge"],Tn={};ca.forEach(function(t){var i=t.charAt(0)==="x"?"x-"+t.substring(1):t;Tn[t]="vjs-layout-"+i});var ed={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},_t=function(t){function i(e,r,a){var s;if(e.id=e.id||r.id||"vjs_video_"+Se(),(r=lt(i.getTagSettings(e),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if(typeof e.closest=="function"){var o=e.closest("[lang]");o&&o.getAttribute&&(r.language=o.getAttribute("lang"))}else for(var u=e;u&&u.nodeType===1;){if(ue(u).hasOwnProperty("lang")){r.language=u.getAttribute("lang");break}u=u.parentNode}if((s=t.call(this,null,r,a)||this).boundDocumentFullscreenChange_=J(K(s),s.documentFullscreenChange_),s.boundFullWindowOnEscKey_=J(K(s),s.fullWindowOnEscKey),s.log=ss(s.id_),s.fsApi_=yr,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,!s.options_||!s.options_.techOrder||!s.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(s.tag=e,s.tagAttributes=e&&ue(e),s.language(s.options_.language),r.languages){var c={};Object.getOwnPropertyNames(r.languages).forEach(function(f){c[f.toLowerCase()]=r.languages[f]}),s.languages_=c}else s.languages_=i.prototype.options_.languages;s.resetCache_(),s.poster_=r.poster||"",s.controls_=!!r.controls,e.controls=!1,e.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],e.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach(function(f){if(typeof s[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),ar(K(s),{eventBusKey:"el_"}),s.fluid_&&s.on("playerreset",s.updateStyleEl_);var d=at(s.options_);r.plugins&&Object.keys(r.plugins).forEach(function(f){s[f](r.plugins[f])}),s.options_.playerOptions=d,s.middleware_=[],s.initChildren(),s.isAudio(e.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),wi&&s.addClass("vjs-touch-enabled"),Zt||s.addClass("vjs-workinghover"),i.players[s.id_]=K(s);var h=as.split(".")[0];return s.addClass("vjs-v"+h),s.userActive(!0),s.reportUserActivity(),s.one("play",s.listenForUserActivity_),s.on("stageclick",s.handleStageClick_),s.on("keydown",s.handleKeyDown),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s}j(i,t);var n=i.prototype;return n.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Ct(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ct(U,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.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),function(r){Nr[r.id()]=null}(this),Lt.names.forEach(function(r){var a=Lt[r],s=e[a.getterName]();s&&s.off&&s.off()}),t.prototype.dispose.call(this)},n.createEl=function(){var e,r=this.tag,a=this.playerElIngest_=r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";a?e=this.el_=r.parentNode:s||(e=this.el_=t.prototype.createEl.call(this,"div"));var o=ue(r);if(s){for(e=this.el_=r,r=this.tag=U.createElement("video");e.children.length;)r.appendChild(e.firstChild);Te(e,"video-js")||oe(e,"video-js"),e.appendChild(r),a=this.playerElIngest_=e,Object.keys(e).forEach(function(y){r[y]=e[y]})}if(r.setAttribute("tabindex","-1"),o.tabindex="-1",(fr||le&&Hs)&&(r.setAttribute("role","application"),o.role="application"),r.removeAttribute("width"),r.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(y){s&&y==="class"||e.setAttribute(y,o[y]),s&&r.setAttribute(y,o[y])}),r.playerId=r.id,r.id+="_html5_api",r.className="vjs-tech",r.player=e.player=this,this.addClass("vjs-paused"),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Cs("vjs-styles-dimensions");var u=pe(".vjs-styles-defaults"),c=pe("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.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);for(var d=r.getElementsByTagName("a"),h=0;h<d.length;h++){var f=d.item(h);oe(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return r.initNetworkState_=r.networkState,r.parentNode&&!a&&r.parentNode.insertBefore(e,r),Kn(r,e),this.children_.unshift(r),this.el_.setAttribute("lang",this.language_),this.el_=e},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,r){var a=e+"_";if(r===void 0)return this[a]||0;if(r==="")return this[a]=void 0,void this.updateStyleEl_();var s=parseFloat(r);isNaN(s)?Z.error('Improper value "'+r+'" supplied for for '+e):(this[a]=s,this.updateStyleEl_())},n.fluid=function(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ce(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),function(r,a){Ce(r)?a():(r.eventedCallbacks||(r.eventedCallbacks=[]),r.eventedCallbacks.push(a))}(function(){this.on("playerreset",this.updateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(e===void 0)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_()},n.updateStyleEl_=function(){if(k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){var e,r,a,s=(this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/o:this.videoWidth()||300,r=this.height_!==void 0?this.height_:e*o,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),Es(this.styleEl_,`
.`+a+` {
width: `+e+`px;
height: `+r+`px;
}
.`+a+`.vjs-fluid {
padding-top: `+100*o+`%;
}
`)}else{var u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(0<=u&&(d.width=u),0<=c&&(d.height=c))}},n.loadTech_=function(e,r){var a=this;this.tech_&&this.unloadTech_();var s=ft(e),o=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var u={source:r,autoplay:typeof this.autoplay()!="string"&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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,Promise:this.options_.Promise};Lt.names.forEach(function(d){var h=Lt[d];u[h.getterName]=a[h.privateName]}),lt(u,this.options_[s]),lt(u,this.options_[o]),lt(u,this.options_[e.toLowerCase()]),this.tag&&(u.tag=this.tag),r&&r.src===this.cache_.src&&0<this.cache_.currentTime&&(u.startTime=this.cache_.currentTime);var c=st.getTech(e);if(!c)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new c(u),this.tech_.ready(J(this,this.handleTechReady_),!0),Oc(this.textTracksJson_||[],this.tech_),hu.forEach(function(d){a.on(a.tech_,d,a["handleTech"+ft(d)+"_"])}),Object.keys(la).forEach(function(d){a.on(a.tech_,d,function(h){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+la[d]+"_"].bind(a),event:h}):a["handleTech"+la[d]+"_"](h)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||s==="Html5"&&this.tag||Kn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;Lt.names.forEach(function(r){var a=Lt[r];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=Lc(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return e===void 0&&Z.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
See https://github.com/videojs/video.js/issues/2617 for more info.
`),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mouseup",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},n.manualAutoplay_=function(e){var r=this;if(this.tech_&&typeof e=="string"){let o=function(){var u=r.muted();r.muted(!0);function c(){r.muted(u)}r.playTerminatedQueue_.push(c);var d=r.play();if(Pi(d))return d.catch(c)};var s=o,a;if(e==="any"&&this.muted()!==!0?Pi(a=this.play())&&(a=a.catch(o)):a=e==="muted"&&this.muted()!==!0?o():this.play(),Pi(a))return a.then(function(){r.trigger({type:"autoplay-success",autoplay:e})}).catch(function(u){r.trigger({type:"autoplay-failure",autoplay:e})})}},n.updateSourceCaches_=function(e){e===void 0&&(e="");var r=e,a="";typeof r!="string"&&(r=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],r&&!a&&(a=function(f,y){if(!y)return"";if(f.cache_.source.src===y&&f.cache_.source.type)return f.cache_.source.type;var b=f.cache_.sources.filter(function(C){return C.src===y});if(b.length)return b[0].type;for(var _=f.$$("source"),E=0;E<_.length;E++){var S=_[E];if(S.type&&S.src&&S.src===y)return S.type}return gn(y)}(this,r)),this.cache_.source=at({},e,{src:r,type:a});for(var s=this.cache_.sources.filter(function(f){return f.src&&f.src===r}),o=[],u=this.$$("source"),c=[],d=0;d<u.length;d++){var h=ue(u[d]);o.push(h),h.src&&h.src===r&&c.push(h.src)}c.length&&!s.length?this.cache_.sources=o:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=r},n.handleTechSourceset_=function(e){var r=this;if(!this.changingSrc_){var a=function(u){return r.updateSourceCaches_(u)},s=this.currentSource().src,o=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(o)&&(this.lastSource_&&(this.lastSource_.tech===o||this.lastSource_.player===s)||(a=function(){})),a(o),e.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=r.techGet("currentSrc");r.lastSource_.tech=c,r.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var r=this.currentTime();this.on("timeupdate",function a(){r!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",a))})},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(Z.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){Ge(e)&&this.controls_&&(this.paused()?ge(this.play()):this.pause())},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(r){return r.contains(e.target)})||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var r=this.el(),a=U[this.fsApi_.fullscreenElement]===r;!a&&r.matches?a=r.matches(":"+this.fsApi_.fullscreen):!a&&r.msMatchesSelector&&(a=r.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(a),this.isFullscreen()===!1&&Ct(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.fsApi_.prefixed&&this.trigger("fullscreenchange")},n.handleTechFullscreenChange_=function(e,r){r&&this.isFullscreen(r.isFullscreen),this.trigger("fullscreenchange")},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(e,r){var a=null;1<arguments.length&&(a=r),this.trigger("textdata",a)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}},n.techCall_=function(e,r){this.ready(function(){if(e in xh)return function(a,s,o,u){return s[o](a.reduce(Br(o),u))}(this.middleware_,this.tech_,e,r);if(e in Oo)return Lo(this.middleware_,this.tech_,e,r);try{this.tech_&&this.tech_[e](r)}catch(a){throw Z(a),a}},!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Oh)return function(r,a,s){return r.reduceRight(Br(s),a[s]())}(this.middleware_,this.tech_,e);if(e in Oo)return Lo(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(r){throw this.tech_[e]===void 0?(Z("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",r),r):r.name==="TypeError"?(Z("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",r),this.tech_.isReady_=!1,r):(Z(r),r)}}},n.play=function(){var e=this,r=this.options_.Promise||k.Promise;return r?new r(function(a){e.play_(a)}):this.play_()},n.play_=function(e){var r=this;e===void 0&&(e=ge),this.playCallbacks_.push(e);var a=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(o){r.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(a||!mr&&!Zt||this.load());var s=this.techGet_("play");s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(r){r()})},n.runPlayCallbacks_=function(e){var r=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],r.forEach(function(a){a(e)})},n.pause=function(){this.techCall_("pause")},n.paused=function(){return this.techGet_("paused")!==!1},n.played=function(){return this.techGet_("played")||Ee(0,0)},n.scrubbing=function(e){if(typeof e=="undefined")return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return typeof e!="undefined"?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&((this.cache_.duration=e)===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Ee(0,0)),e},n.bufferedPercent=function(){return qs(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),r=this.duration(),a=e.end(e.length-1);return r<a&&(a=r),a},n.volume=function(e){var r;return e!==void 0?(r=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=r,this.techCall_("setVolume",r),void(0<r&&this.lastVolume_(r))):(r=parseFloat(this.techGet_("volume")),isNaN(r)?1:r)},n.muted=function(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){return e!==void 0?(this.isFullscreen_=!!e,void this.toggleFullscreenClass_()):!!this.isFullscreen_},n.requestFullscreen=function(e){var r;this.isFullscreen(!0),this.fsApi_.requestFullscreen?(Ht(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.fsApi_.prefixed||(r=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(r=e)),ge(this.el_[this.fsApi_.requestFullscreen](r))):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},n.exitFullscreen=function(){this.isFullscreen(!1),this.fsApi_.requestFullscreen?ge(U[this.fsApi_.exitFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},n.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=U.documentElement.style.overflow,Ht(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow="hidden",oe(U.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){z.isEventKey(e,"Esc")&&(this.isFullscreen()===!0?this.exitFullscreen():this.exitFullWindow())},n.exitFullWindow=function(){this.isFullWindow=!1,Ct(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow=this.docOrigOverflow,Si(U.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.isInPictureInPicture=function(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in U)return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in U)return U.exitPictureInPicture()},n.handleKeyDown=function(e){var r=this.options_.userActions;r&&r.hotkeys&&!function(a){var s=a.tagName.toLowerCase();return a.isContentEditable?!0:s==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(a.type)===-1:["textarea"].indexOf(s)!==-1}(this.el_.ownerDocument.activeElement)&&(typeof r.hotkeys=="function"?r.hotkeys.call(this,e):this.handleHotkeys(e))},n.handleHotkeys=function(e){var r=this.options_.userActions?this.options_.userActions.hotkeys:{},a=r.fullscreenKey,s=a===void 0?function(f){return z.isEventKey(f,"f")}:a,o=r.muteKey,u=o===void 0?function(f){return z.isEventKey(f,"m")}:o,c=r.playPauseKey,d=c===void 0?function(f){return z.isEventKey(f,"k")||z.isEventKey(f,"Space")}:c;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();var h=x.getComponent("FullscreenToggle");U[this.fsApi_.fullscreenEnabled]!==!1&&h.prototype.handleClick.call(this,e)}else u.call(this,e)?(e.preventDefault(),e.stopPropagation(),x.getComponent("MuteToggle").prototype.handleClick.call(this,e)):d.call(this,e)&&(e.preventDefault(),e.stopPropagation(),x.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var r,a=0,s=this.options_.techOrder;a<s.length;a++){var o=s[a],u=st.getTech(o);if(u=u||x.getComponent(o)){if(u.isSupported()&&(r=u.canPlayType(e)))return r}else Z.error('The "'+o+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){function r(c,d,h){var f;return c.some(function(y){return d.some(function(b){if(f=h(y,b))return!0})}),f}function a(c,d){var h=c[0];if(c[1].canPlaySource(d,o.options_[h.toLowerCase()]))return{source:d,tech:h}}var s,o=this,u=this.options_.techOrder.map(function(c){return[c,st.getTech(c)]}).filter(function(c){var d=c[0],h=c[1];return h?h.isSupported():(Z.error('The "'+d+'" tech is undefined. Skipped browser support check for that tech.'),!1)});return(this.options_.sourceOrder?r(e,u,(s=a,function(c,d){return s(d,c)})):r(u,e,a))||!1},n.src=function(e){var r=this;if(typeof e=="undefined")return this.cache_.src||"";var a=function s(o){if(Array.isArray(o)){var u=[];o.forEach(function(c){c=s(c),Array.isArray(c)?u=u.concat(c):de(c)&&u.push(c)}),o=u}else o=typeof o=="string"&&o.trim()?[xo({src:o})]:de(o)&&typeof o.src=="string"&&o.src&&o.src.trim()?[xo(o)]:[];return o}(e);a.length?(this.changingSrc_=!0,this.cache_.sources=a,this.updateSourceCaches_(a[0]),Lh(this,a[0],function(s,o){if(r.middleware_=o,r.cache_.sources=a,r.updateSourceCaches_(s),r.src_(s))return 1<a.length?r.src(a.slice(1)):(r.changingSrc_=!1,r.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void r.triggerReady());(function(u,c){u.forEach(function(d){return d.setTech&&d.setTech(c)})})(o,r.tech_)})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},n.src_=function(e){var r=this,a=this.selectSource([e]);return!a||(function(s,o){return ft(s)===ft(o)}(a.tech,this.techName_)?this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){r.changingSrc_=!1})),!1)},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,r=this.options_.Promise||k.Promise;this.paused()||!r?this.doReset_():ge(this.play().then(function(){return e.doReset_()}))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Ce(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,r=e.durationDisplay,a=e.remainingTimeDisplay;r&&r.updateContent(),a&&a.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),r=[];return Object.keys(e).length!==0&&r.push(e),this.cache_.sources||r},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var r;typeof e=="string"&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),r=!1):this.options_.autoplay=!!e,r=typeof r=="undefined"?this.options_.autoplay:r,this.tech_&&this.techCall_("setAutoplay",r)},n.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(e===void 0)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(e){if(e===void 0)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_()))},n.usingNativeControls=function(e){if(e===void 0)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")))},n.error=function(e){if(e===void 0)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&e.message&&e.message===this.localize(this.options_.notSupportedMessage)){let a=function(){this.error(e)};var r=a;return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(e===null)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new It(e),this.addClass("vjs-error"),Z.error("(CODE:"+this.error_.code+" "+It.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(e===void 0)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(r){r.stopPropagation(),r.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,r,a,s=J(this,this.reportUserActivity);this.on("mousedown",function(){s(),this.clearInterval(e),e=this.setInterval(s,250)}),this.on("mousemove",function(c){c.screenX===r&&c.screenY===a||(r=c.screenX,a=c.screenY,s())}),this.on("mouseup",function(c){s(),this.clearInterval(e)});var o,u=this.getChild("controlBar");!u||Zt||me||(u.on("mouseenter",function(c){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(c){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var c=this.options_.inactivityTimeout;c<=0||(o=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},c))}},250)},n.playbackRate=function(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e},n.addTextTrack=function(e,r,a){if(this.tech_)return this.tech_.addTextTrack(e,r,a)},n.addRemoteTextTrack=function(e,r){if(this.tech_)return this.tech_.addRemoteTextTrack(e,r)},n.removeRemoteTextTrack=function(e){e===void 0&&(e={});var r=e.track;if(r=r||e,this.tech_)return this.tech_.removeRemoteTextTrack(r)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(e===void 0)return this.language_;this.language_=String(e).toLowerCase()},n.languages=function(){return at(i.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=at(this.options_),r=e.tracks;e.tracks=[];for(var a=0;a<r.length;a++){var s=r[a];(s=at(s)).player=void 0,e.tracks[a]=s}return e},n.createModal=function(e,r){var a=this;(r=r||{}).content=e||"";var s=new Ye(this,r);return this.addChild(s),s.on("dispose",function(){a.removeChild(s)}),s.open(),s},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),r=this.currentWidth(),a=0;a<ca.length;a++){var s=ca[a];if(r<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(Tn[e]),this.addClass(Tn[s]),this.breakpoint_=s;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return e===void 0||(this.breakpoint_="",this.breakpoints_=lt({},ed,e),this.updateCurrentBreakpoint_()),lt(this.breakpoints_)},n.responsive=function(e){return e===void 0?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return Tn[this.breakpoint_]||""},n.loadMedia=function(e,r){var a=this;if(e&&typeof e=="object"){this.reset(),this.cache_.media=at(e);var s=this.cache_.media,o=s.artwork,u=s.poster,c=s.src,d=s.textTracks;!o&&u&&(this.cache_.media.artwork=[{src:u,type:gn(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(d)&&d.forEach(function(h){return a.addRemoteTextTrack(h,!1)}),this.ready(r)}},n.getMedia=function(){if(this.cache_.media)return at(this.cache_.media);var e=this.poster(),r={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(a){return{kind:a.kind,label:a.label,language:a.language,src:a.src}})};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:gn(r.poster)}]),r},i.getTagSettings=function(e){var r={sources:[],tracks:[]},a=ue(e),s=a["data-setup"];if(Te(e,"vjs-fill")&&(a.fill=!0),Te(e,"vjs-fluid")&&(a.fluid=!0),s!==null){var o=Ic(s||"{}"),u=o[0],c=o[1];u&&Z.error(u),lt(a,c)}if(lt(r,a),e.hasChildNodes())for(var d=e.childNodes,h=0,f=d.length;h<f;h++){var y=d[h],b=y.nodeName.toLowerCase();b==="source"?r.sources.push(ue(y)):b==="track"&&r.tracks.push(ue(y))}return r},n.flexNotSupported_=function(){var e=U.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},i}(x);Lt.names.forEach(function(t){var i=Lt[t];_t.prototype[i.getterName]=function(){return this.tech_?this.tech_[i.getterName]():(this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName])}}),_t.players={};var ji=k.navigator;_t.prototype.options_={techOrder:st.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ji&&(ji.languages&&ji.languages[0]||ji.userLanguage||ji.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){_t.prototype[t]=function(){return this.techGet_(t)}}),hu.forEach(function(t){_t.prototype["handleTech"+ft(t)+"_"]=function(){return this.trigger(t)}}),x.registerComponent("Player",_t);function Sn(t){return ri.hasOwnProperty(t)}function kn(t){return Sn(t)?ri[t]:void 0}function du(t,i){t[ni]=t[ni]||{},t[ni][i]=!0}function Cn(t,i,n){var e=(n?"before":"")+"pluginsetup";t.trigger(e,i),t.trigger(e+":"+i.name,i)}function pu(t,i){return i.prototype.name=t,function(){Cn(this,{name:t,plugin:i,instance:null},!0);for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];var a=Us(i,[this].concat(e));return this[t]=function(){return a},Cn(this,a.getEventHash()),a}}var En="plugin",ni="activePlugins_",ri={},ne=function(){function t(n){if(this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=n,ar(this),delete this.trigger,xs(this,this.constructor.defaultState),du(n,this.name),this.dispose=J(this,this.dispose),n.on("dispose",this.dispose)}var i=t.prototype;return i.version=function(){return this.constructor.VERSION},i.getEventHash=function(n){return n===void 0&&(n={}),n.name=this.name,n.plugin=this.constructor,n.instance=this,n},i.trigger=function(n,e){return e===void 0&&(e={}),Xe(this.eventBusEl_,n,this.getEventHash(e))},i.handleStateChanged=function(n){},i.dispose=function(){var n=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[ni][n]=!1,this.player=this.state=null,e[n]=pu(n,ri[n])},t.isBasic=function(n){var e=typeof n=="string"?kn(n):n;return typeof e=="function"&&!t.prototype.isPrototypeOf(e.prototype)},t.registerPlugin=function(n,e){if(typeof n!="string")throw new Error('Illegal plugin name, "'+n+'", must be a string, was '+typeof n+".");if(Sn(n))Z.warn('A plugin named "'+n+'" already exists. You may want to avoid re-registering plugins!');else if(_t.prototype.hasOwnProperty(n))throw new Error('Illegal plugin name, "'+n+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+n+'", must be a function, was '+typeof e+".");return ri[n]=e,n!==En&&(t.isBasic(e)?_t.prototype[n]=function(r,a){function s(){Cn(this,{name:r,plugin:a,instance:null},!0);var o=a.apply(this,arguments);return du(this,r),Cn(this,{name:r,plugin:a,instance:o}),o}return Object.keys(a).forEach(function(o){s[o]=a[o]}),s}(n,e):_t.prototype[n]=pu(n,e)),e},t.deregisterPlugin=function(n){if(n===En)throw new Error("Cannot de-register base plugin.");Sn(n)&&(delete ri[n],delete _t.prototype[n])},t.getPlugins=function(n){var e;return n===void 0&&(n=Object.keys(ri)),n.forEach(function(r){var a=kn(r);a&&((e=e||{})[r]=a)}),e},t.getPluginVersion=function(n){var e=kn(n);return e&&e.VERSION||""},t}();ne.getPlugin=kn,ne.BASE_PLUGIN_NAME=En,ne.registerPlugin(En,ne),_t.prototype.usingPlugin=function(t){return!!this[ni]&&this[ni][t]===!0},_t.prototype.hasPlugin=function(t){return!!Sn(t)};var fu=function(t){return t.indexOf("#")===0?t.slice(1):t};function w(t,i,n){var e=w.getPlayer(t);if(e)return i&&Z.warn('Player "'+t+'" is already initialised. Options will not be applied.'),n&&e.ready(n),e;var r=typeof t=="string"?pe("#"+fu(t)):t;if(!Ti(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||Z.warn("The element supplied is not included in the DOM"),i=i||{},w.hooks("beforesetup").forEach(function(s){var o=s(r,at(i));de(o)&&!Array.isArray(o)?i=at(i,o):Z.error("please return an object in beforesetup hooks")});var a=x.getComponent("Player");return e=new a(r,i,n),w.hooks("setup").forEach(function(s){return s(e)}),e}if(w.hooks_={},w.hooks=function(t,i){return w.hooks_[t]=w.hooks_[t]||[],i&&(w.hooks_[t]=w.hooks_[t].concat(i)),w.hooks_[t]},w.hook=function(t,i){w.hooks(t,i)},w.hookOnce=function(t,i){w.hooks(t,[].concat(i).map(function(n){return function e(){return w.removeHook(t,e),n.apply(void 0,arguments)}}))},w.removeHook=function(t,i){var n=w.hooks(t).indexOf(i);return!(n<=-1)&&(w.hooks_[t]=w.hooks_[t].slice(),w.hooks_[t].splice(n,1),!0)},k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ze()){var wn=pe(".vjs-styles-defaults");if(!wn){wn=Cs("vjs-styles-defaults");var ha=pe("head");ha&&ha.insertBefore(wn,ha.firstChild),Es(wn,`
.video-js {
width: 300px;
height: 150px;
}
.vjs-fluid {
padding-top: 56.25%
}
`)}}tr(1,w),w.VERSION=as,w.options=_t.prototype.options_,w.getPlayers=function(){return _t.players},w.getPlayer=function(t){var i,n=_t.players;if(typeof t=="string"){var e=fu(t),r=n[e];if(r)return r;i=pe("#"+e)}else i=t;if(Ti(i)){var a=i,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},w.getAllPlayers=function(){return Object.keys(_t.players).map(function(t){return _t.players[t]}).filter(Boolean)},w.players=_t.players,w.getComponent=x.getComponent,w.registerComponent=function(t,i){st.isTech(i)&&Z.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),x.registerComponent.call(x,t,i)},w.getTech=st.getTech,w.registerTech=st.registerTech,w.use=function(t,i){Pe[t]=Pe[t]||[],Pe[t].push(i)},Object.defineProperty(w,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(w.middleware,"TERMINATOR",{value:mn,writeable:!1,enumerable:!0}),w.browser=Pc,w.TOUCH_ENABLED=wi,w.extend=function(t,i){i===void 0&&(i={});var n=function(){t.apply(this,arguments)},e={};for(var r in typeof i=="object"?(i.constructor!==Object.prototype.constructor&&(n=i.constructor),e=i):typeof i=="function"&&(n=i),function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s&&(a.super_=s)}(n,t),e)e.hasOwnProperty(r)&&(n.prototype[r]=e[r]);return n},w.mergeOptions=at,w.bind=J,w.registerPlugin=ne.registerPlugin,w.deregisterPlugin=ne.deregisterPlugin,w.plugin=function(t,i){return Z.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ne.registerPlugin(t,i)},w.getPlugins=ne.getPlugins,w.getPlugin=ne.getPlugin,w.getPluginVersion=ne.getPluginVersion,w.addLanguage=function(t,i){var n;return t=(""+t).toLowerCase(),w.options.languages=at(w.options.languages,((n={})[t]=i,n)),w.options.languages[t]},w.log=Z,w.createLogger=ss,w.createTimeRange=w.createTimeRanges=Ee,w.formatTime=ti,w.setFormatTime=function(t){Hr=t},w.resetFormatTime=function(){Hr=Ro},w.parseUrl=Sr,w.isCrossOrigin=un,w.EventTarget=Pt,w.on=Ht,w.one=nn,w.off=Ct,w.trigger=Xe,w.xhr=_o,w.TextTrack=Li,w.AudioTrack=ko,w.VideoTrack=Co,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){w[t]=function(){return Z.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),Ss[t].apply(null,arguments)}}),w.computedStyle=Zi,w.dom=Ss,w.url=jc;var mu=vr(function(t,i){var n,e,r,a,s;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,e=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(o,u,c){if(c=c||{},o=o.trim(),!(u=u.trim())){if(!c.alwaysNormalize)return o;var d=s.parseURL(o);if(!d)throw new Error("Error trying to parse base URL.");return d.path=s.normalizePath(d.path),s.buildURLFromParts(d)}var h=s.parseURL(u);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=s.normalizePath(h.path),s.buildURLFromParts(h)):u;var f=s.parseURL(o);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var y=e.exec(f.path);f.netLoc=y[1],f.path=y[2]}f.netLoc&&!f.path&&(f.path="/");var b={scheme:f.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(b.netLoc=f.netLoc,h.path[0]!=="/"))if(h.path){var _=f.path,E=_.substring(0,_.lastIndexOf("/")+1)+h.path;b.path=s.normalizePath(E)}else b.path=f.path,h.params||(b.params=f.params,h.query||(b.query=f.query));return b.path===null&&(b.path=c.alwaysNormalize?s.normalizePath(h.path):h.path),s.buildURLFromParts(b)},parseURL:function(o){var u=n.exec(o);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(o){for(o=o.split("").reverse().join("").replace(r,"");o.length!==(o=o.replace(a,"")).length;);return o.split("").reverse().join("")},buildURLFromParts:function(o){return o.scheme+o.netLoc+o.path+o.params+o.query+o.fragment}},t.exports=s});/*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */function gu(){return(gu=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}function da(t,i){t.prototype=Object.create(i.prototype),(t.prototype.constructor=t).__proto__=i}function Fi(t){for(var i,n=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),e={},r=n.length;r--;)n[r]!==""&&((i=/([^=]*)=(.*)/.exec(n[r]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e}var pa=function(){function t(){this.listeners={}}var i=t.prototype;return i.on=function(n,e){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(e)},i.off=function(n,e){if(!this.listeners[n])return!1;var r=this.listeners[n].indexOf(e);return this.listeners[n].splice(r,1),-1<r},i.trigger=function(n,e){var r,a,s,o=this.listeners[n];if(o)if(arguments.length===2)for(a=o.length,r=0;r<a;++r)o[r].call(this,e);else for(s=Array.prototype.slice.call(arguments,1),a=o.length,r=0;r<a;++r)o[r].apply(this,s)},i.dispose=function(){this.listeners={}},i.pipe=function(n){this.on("data",function(e){n.push(e)})},t}(),id=function(t){function i(){var n;return(n=t.call(this)||this).buffer="",n}return da(i,t),i.prototype.push=function(n){var e;for(this.buffer+=n,e=this.buffer.indexOf(`
`);-1<e;e=this.buffer.indexOf(`
`))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},i}(pa),nd=function(t){function i(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}da(i,t);var n=i.prototype;return n.push=function(e){var r,a,s=this;(e=e.trim()).length!==0&&(e[0]==="#"?this.tagMappers.reduce(function(o,u){var c=u(e);return c===e?o:o.concat([c])},[e]).forEach(function(o){for(var u=0;u<s.customParsers.length;u++)if(s.customParsers[u].call(s,o))return;if(o.indexOf("#EXT")===0)if(o=o.replace("\r",""),r=/^#EXTM3U/.exec(o))s.trigger("data",{type:"tag",tagType:"m3u"});else{if(r=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(o))return a={type:"tag",tagType:"inf"},r[1]&&(a.duration=parseFloat(r[1])),r[2]&&(a.title=r[2]),void s.trigger("data",a);if(r=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"targetduration"},r[1]&&(a.duration=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"totalduration"},r[1]&&(a.duration=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"version"},r[1]&&(a.version=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"media-sequence"},r[1]&&(a.number=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"discontinuity-sequence"},r[1]&&(a.number=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(o))return a={type:"tag",tagType:"playlist-type"},r[1]&&(a.playlistType=r[1]),void s.trigger("data",a);if(r=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"byterange"},r[1]&&(a.length=parseInt(r[1],10)),r[2]&&(a.offset=parseInt(r[2],10)),void s.trigger("data",a);if(r=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(o))return a={type:"tag",tagType:"allow-cache"},r[1]&&(a.allowed=!/NO/.test(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-MAP:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"map"},r[1]){var c=Fi(r[1]);if(c.URI&&(a.uri=c.URI),c.BYTERANGE){var d=c.BYTERANGE.split("@"),h=d[0],f=d[1];a.byterange={},h&&(a.byterange.length=parseInt(h,10)),f&&(a.byterange.offset=parseInt(f,10))}}s.trigger("data",a)}else if(r=/^#EXT-X-STREAM-INF:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"stream-inf"},r[1]){if(a.attributes=Fi(r[1]),a.attributes.RESOLUTION){var y=a.attributes.RESOLUTION.split("x"),b={};y[0]&&(b.width=parseInt(y[0],10)),y[1]&&(b.height=parseInt(y[1],10)),a.attributes.RESOLUTION=b}a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))}s.trigger("data",a)}else{if(r=/^#EXT-X-MEDIA:?(.*)$/.exec(o))return a={type:"tag",tagType:"media"},r[1]&&(a.attributes=Fi(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-ENDLIST/.exec(o))s.trigger("data",{type:"tag",tagType:"endlist"});else if(r=/^#EXT-X-DISCONTINUITY/.exec(o))s.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(r=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(o))return a={type:"tag",tagType:"program-date-time"},r[1]&&(a.dateTimeString=r[1],a.dateTimeObject=new Date(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-KEY:?(.*)$/.exec(o))return a={type:"tag",tagType:"key"},r[1]&&(a.attributes=Fi(r[1]),a.attributes.IV&&(a.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void s.trigger("data",a);if(r=/^#EXT-X-START:?(.*)$/.exec(o))return a={type:"tag",tagType:"start"},r[1]&&(a.attributes=Fi(r[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void s.trigger("data",a);if(r=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-out-cont"},r[1]?a.data=r[1]:a.data="",void s.trigger("data",a);if(r=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-out"},r[1]?a.data=r[1]:a.data="",void s.trigger("data",a);if(r=/^#EXT-X-CUE-IN:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-in"},r[1]?a.data=r[1]:a.data="",void s.trigger("data",a);s.trigger("data",{type:"tag",data:o.slice(4)})}}}else s.trigger("data",{type:"comment",text:o.slice(1)})}):this.trigger("data",{type:"uri",uri:e}))},n.addParser=function(e){var r=this,a=e.expression,s=e.customType,o=e.dataParser,u=e.segment;typeof o!="function"&&(o=function(c){return c}),this.customParsers.push(function(c){if(a.exec(c))return r.trigger("data",{type:"custom",data:o(c),customType:s,segment:u}),!0})},n.addTagMapper=function(e){var r=e.expression,a=e.map;this.tagMappers.push(function(s){return r.test(s)?a(s):s})},i}(pa);function yu(t){return!!t&&typeof t=="object"}function Mt(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce(function(e,r){return Object.keys(r).forEach(function(a){Array.isArray(e[a])&&Array.isArray(r[a])?e[a]=e[a].concat(r[a]):yu(e[a])&&yu(r[a])?e[a]=Mt(e[a],r[a]):e[a]=r[a]}),e},{})}function An(t){return t.reduce(function(i,n){return i.concat(n)},[])}function vu(t){if(!t.length)return[];for(var i=[],n=0;n<t.length;n++)i.push(t[n]);return i}var _u=function(t){function i(){var e;(e=t.call(this)||this).lineStream=new id,e.parseStream=new nd,e.lineStream.pipe(e.parseStream);var r,a,s=function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}(e),o=[],u={},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;return e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},e.parseStream.on("data",function(h){var f,y;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=h.allowed,"allowed"in h||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var b={};"length"in h&&((u.byterange=b).length=h.length,"offset"in h||(this.trigger("info",{message:"defaulting offset to zero"}),h.offset=0)),"offset"in h&&((u.byterange=b).offset=h.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),0<h.duration&&(u.duration=h.duration),h.duration===0&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(h.attributes)if(h.attributes.METHOD!=="NONE")if(h.attributes.URI){if(h.attributes.KEYFORMAT==="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(h.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(h.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),h.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):h.attributes.KEYID&&h.attributes.KEYID.substring(0,2)==="0x"?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:h.attributes.KEYFORMAT,keyId:h.attributes.KEYID.substring(2)},pssh:function(b){for(var _=k.atob(b||""),E=new Uint8Array(_.length),S=0;S<_.length;S++)E[S]=_.charCodeAt(S);return E}(h.attributes.URI.split(",")[1])}}):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));h.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:h.attributes.METHOD||"AES-128",uri:h.attributes.URI},typeof h.attributes.IV!="undefined"&&(a.iv=h.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else a=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(h.number)?this.manifest.mediaSequence=h.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+h.number})},"discontinuity-sequence":function(){isFinite(h.number)?(this.manifest.discontinuitySequence=h.number,d=h.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+h.number})},"playlist-type":function(){/VOD|EVENT/.test(h.playlistType)?this.manifest.playlistType=h.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+h.playlist})},map:function(){r={},h.uri&&(r.uri=h.uri),h.byterange&&(r.byterange=h.byterange)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||c,h.attributes?(u.attributes||(u.attributes={}),gu(u.attributes,h.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,h.attributes&&h.attributes.TYPE&&h.attributes["GROUP-ID"]&&h.attributes.NAME){var b=this.manifest.mediaGroups[h.attributes.TYPE];b[h.attributes["GROUP-ID"]]=b[h.attributes["GROUP-ID"]]||{},f=b[h.attributes["GROUP-ID"]],(y={default:/yes/i.test(h.attributes.DEFAULT)}).default?y.autoselect=!0:y.autoselect=/yes/i.test(h.attributes.AUTOSELECT),h.attributes.LANGUAGE&&(y.language=h.attributes.LANGUAGE),h.attributes.URI&&(y.uri=h.attributes.URI),h.attributes["INSTREAM-ID"]&&(y.instreamId=h.attributes["INSTREAM-ID"]),h.attributes.CHARACTERISTICS&&(y.characteristics=h.attributes.CHARACTERISTICS),h.attributes.FORCED&&(y.forced=/yes/i.test(h.attributes.FORCED)),f[h.attributes.NAME]=y}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){typeof this.manifest.dateTimeString=="undefined"&&(this.manifest.dateTimeString=h.dateTimeString,this.manifest.dateTimeObject=h.dateTimeObject),u.dateTimeString=h.dateTimeString,u.dateTimeObject=h.dateTimeObject},targetduration:function(){!isFinite(h.duration)||h.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+h.duration}):this.manifest.targetDuration=h.duration},totalduration:function(){!isFinite(h.duration)||h.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+h.duration}):this.manifest.totalDuration=h.duration},start:function(){h.attributes&&!isNaN(h.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:h.attributes["TIME-OFFSET"],precise:h.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=h.data},"cue-out-cont":function(){u.cueOutCont=h.data},"cue-in":function(){u.cueIn=h.data}}[h.tagType]||function(){}).call(s)},uri:function(){u.uri=h.uri,o.push(u),!this.manifest.targetDuration||"duration"in u||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),a&&(u.key=a),u.timeline=d,r&&(u.map=r),u={}},comment:function(){},custom:function(){h.segment?(u.custom=u.custom||{},u.custom[h.customType]=h.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[h.customType]=h.data)}})[h.type].call(s)}),e}da(i,t);var n=i.prototype;return n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push(`
`)},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},i}(pa),rd="INVALID_NUMBER_OF_PERIOD",ad="DASH_EMPTY_MANIFEST",sd="DASH_INVALID_XML",od="NO_BASE_URL",ud="SEGMENT_TIME_UNSPECIFIED",ld="UNSUPPORTED_UTC_TIMING_SCHEME";/*! @name mpd-parser @version 0.8.1 @license Apache-2.0 */function fa(t,i){return/^[a-z]+:/i.test(i)?i:(/\/\//i.test(t)||(t=Eu.buildAbsoluteURL(k.location.href,t)),Eu.buildAbsoluteURL(t,i))}function Hi(t){var i=t.baseUrl,n=i===void 0?"":i,e=t.source,r=e===void 0?"":e,a=t.range,s=a===void 0?"":a,o=t.indexRange,u=o===void 0?"":o,c={uri:r,resolvedUri:fa(n||"",r)};if(s||u){var d=(s||u).split("-"),h=parseInt(d[0],10),f=parseInt(d[1],10);c.byterange={length:f-h+1,offset:h}}return c}function ma(t){var i=t.type,n=i===void 0?"static":i,e=t.duration,r=t.timescale,a=r===void 0?1:r,s=t.sourceDuration,o=gd[n](t),u=function(d,h){for(var f=[],y=d;y<h;y++)f.push(y);return f}(o.start,o.end).map(function(d){return function(h,f){var y=d.duration,b=d.timescale,_=b===void 0?1:b,E=d.periodIndex,S=d.startNumber;return{number:(S===void 0?1:S)+h,duration:y/_,timeline:E,time:f*y}}}(t));if(n==="static"){var c=u.length-1;u[c].duration=s-e/a*c}return u}function bu(t){var i=t.baseUrl,n=t.initialization,e=n===void 0?{}:n,r=t.sourceDuration,a=t.timescale,s=a===void 0?1:a,o=t.indexRange,u=o===void 0?"":o,c=t.duration;if(!i)throw new Error(od);var d=Hi({baseUrl:i,source:e.sourceURL,range:e.range}),h=Hi({baseUrl:i,source:i,indexRange:u});if(h.map=d,c){var f=ma(t);f.length&&(h.duration=f[0].duration,h.timeline=f[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]}function cd(t,i,n){for(var e=t.sidx.map?t.sidx.map:null,r=t.sidx.duration,a=t.timeline||0,s=t.sidx.byterange,o=s.offset+s.length,u=i.timescale,c=i.references.filter(function(S){return S.referenceType!==1}),d=[],h=o+i.firstOffset,f=0;f<c.length;f++){var y=i.references[f],b=y.referencedSize,_=y.subsegmentDuration,E=bu({baseUrl:n,timescale:u,timeline:a,periodIndex:a,duration:_,sourceDuration:r,indexRange:h+"-"+(h+b-1)})[0];e&&(E.map=e),d.push(E),h+=b}return t.segments=d,t}function Tu(t){return function(i){return Object.keys(i).map(function(n){return i[n]})}(t.reduce(function(i,n){var e,r=n.attributes.id+(n.attributes.lang||"");return i[r]?(n.segments[0]&&(n.segments[0].discontinuity=!0),(e=i[r].segments).push.apply(e,n.segments),n.attributes.contentProtection&&(i[r].attributes.contentProtection=n.attributes.contentProtection)):i[r]=n,i},{})).map(function(i){return i.discontinuityStarts=function(n,e){return n.reduce(function(r,a,s){return a[e]&&r.push(s),r},[])}(i.segments,"discontinuity"),i})}function ga(t,i){if(i===void 0&&(i={}),!Object.keys(i).length)return t;for(var n in t){var e=t[n];if(e.sidx){var r=e.sidx.uri+"-"+(s=e.sidx.byterange,o=s.offset+s.length-1,s.offset+"-"+o),a=i[r]&&i[r].sidx;e.sidx&&a&&cd(e,a,e.sidx.resolvedUri)}}var s,o;return t}function hd(t){var i,n=t.attributes,e=t.segments,r=t.sidx,a={attributes:(i={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:(n.type||"static")==="static",timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:e,mediaSequence:e.length?e[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),r&&(a.sidx=r),a}function dd(t,i){var n;if(i===void 0&&(i={}),!t.length)return{};var e=t[0].attributes,r=e.sourceDuration,a=e.minimumUpdatePeriod,s=a===void 0?0:a,o=Tu(t.filter(function(h){var f=h.attributes;return f.mimeType==="video/mp4"||f.contentType==="video"})).map(hd),u=Tu(t.filter(function(h){var f=h.attributes;return f.mimeType==="audio/mp4"||f.contentType==="audio"})),c=t.filter(function(h){var f=h.attributes;return f.mimeType==="text/vtt"||f.contentType==="text"}),d={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:r,playlists:ga(o,i),minimumUpdatePeriod:1e3*s};return u.length&&(d.mediaGroups.AUDIO.audio=function(h,f){var y;f===void 0&&(f={});var b=h.reduce(function(_,E){var S=E.attributes.role&&E.attributes.role.value||"",C=E.attributes.lang||"",L="main";if(C){var D=S?" ("+S+")":"";L=E.attributes.lang+D}return _[L]&&_[L].playlists[0].attributes.BANDWIDTH>E.attributes.bandwidth||(_[L]={language:C,autoselect:!0,default:S==="main",playlists:ga([function(F){var B,H=F.attributes,V=F.segments,R=F.sidx,W={attributes:(B={NAME:H.id,BANDWIDTH:H.bandwidth,CODECS:H.codecs},B["PROGRAM-ID"]=1,B),uri:"",endList:(H.type||"static")==="static",timeline:H.periodIndex,resolvedUri:"",targetDuration:H.duration,segments:V,mediaSequence:V.length?V[0].number:1};return H.contentProtection&&(W.contentProtection=H.contentProtection),R&&(W.sidx=R),W}(E)],f),uri:""},typeof y=="undefined"&&S==="main"&&((y=E).default=!0)),_},{});return y||(b[Object.keys(b)[0]].default=!0),b}(u,i)),c.length&&(d.mediaGroups.SUBTITLES.subs=function(h,f){return f===void 0&&(f={}),h.reduce(function(y,b){var _=b.attributes.lang||"text";return y[_]||(y[_]={language:_,default:!1,autoselect:!1,playlists:ga([function(E){var S,C=E.attributes,L=E.segments;return typeof L=="undefined"&&(L=[{uri:C.baseUrl,timeline:C.periodIndex,resolvedUri:C.baseUrl||"",duration:C.sourceDuration,number:0}],C.duration=C.sourceDuration),{attributes:(S={NAME:C.id,BANDWIDTH:C.bandwidth},S["PROGRAM-ID"]=1,S),uri:"",endList:(C.type||"static")==="static",timeline:C.periodIndex,resolvedUri:C.baseUrl||"",targetDuration:C.duration,segments:L,mediaSequence:L.length?L[0].number:1}}(b)],f),uri:""}),y},{})}(c,i)),d}function Su(t,i){for(var n,e,r,a,s,o,u,c,d,h,f,y,b=t.type,_=b===void 0?"static":b,E=t.minimumUpdatePeriod,S=E===void 0?0:E,C=t.media,L=C===void 0?"":C,D=t.sourceDuration,F=t.timescale,B=F===void 0?1:F,H=t.startNumber,V=H===void 0?1:H,R=t.periodIndex,W=[],et=-1,tt=0;tt<i.length;tt++){var Tt=i[tt],St=Tt.d,qt=Tt.r||0,Y=Tt.t||0;et<0&&(et=Y),Y&&et<Y&&(et=Y);var ot=void 0;if(qt<0){var ut=tt+1;ot=ut===i.length?_==="dynamic"&&0<S&&0<L.indexOf("$Number$")?(e=et,r=St,a=(n=t).NOW,s=n.clientOffset,o=n.availabilityStartTime,u=n.timescale,c=u===void 0?1:u,d=n.start,h=d===void 0?0:d,f=n.minimumUpdatePeriod,y=(a+s)/1e3+(f===void 0?0:f)-(o+h),Math.ceil((y*c-e)/r)):(D*B-et)/St:(i[ut].t-et)/St}else ot=qt+1;for(var mt=V+W.length+ot,kt=V+W.length;kt<mt;)W.push({number:kt,duration:St/B,time:et,timeline:R}),et+=St,kt++}return W}function ku(t,i){return t.replace(yd,function(n){return function(e,r,a,s){if(e==="$$")return"$";if(typeof n[r]=="undefined")return e;var o=""+n[r];return r==="RepresentationID"||(s=a?parseInt(s,10):1)<=o.length?o:new Array(s-o.length+1).join("0")+o}}(i))}function pd(t,i){var n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,r=e===void 0?{sourceURL:"",range:""}:e,a=Hi({baseUrl:t.baseUrl,source:ku(r.sourceURL,n),range:r.range});return function(s,o){return s.duration||o?s.duration?ma(s):Su(s,o):[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodIndex}]}(t,i).map(function(s){n.Number=s.number,n.Time=s.time;var o=ku(t.media||"",n);return{uri:o,timeline:s.timeline,duration:s.duration,resolvedUri:fa(t.baseUrl||"",o),map:a,number:s.number}})}function fd(t,i){var n=t.duration,e=t.segmentUrls,r=e===void 0?[]:e;if(!n&&!i||n&&i)throw new Error(ud);var a,s=r.map(function(o){return function(u,c){var d=u.baseUrl,h=u.initialization,f=h===void 0?{}:h,y=Hi({baseUrl:d,source:f.sourceURL,range:f.range}),b=Hi({baseUrl:d,source:c.media,range:c.mediaRange});return b.map=y,b}(t,o)});return n&&(a=ma(t)),i&&(a=Su(t,i)),a.map(function(o,u){if(s[u]){var c=s[u];return c.timeline=o.timeline,c.duration=o.duration,c.number=o.number,c}}).filter(function(o){return o})}function md(t){var i,n,e=t.attributes,r=t.segmentInfo;r.template?(n=pd,i=Mt(e,r.template)):r.base?(n=bu,i=Mt(e,r.base)):r.list&&(n=fd,i=Mt(e,r.list));var a={attributes:e};if(!n)return a;var s=n(i,r.timeline);if(i.duration){var o=i,u=o.duration,c=o.timescale,d=c===void 0?1:c;i.duration=u/d}else s.length?i.duration=s.reduce(function(h,f){return Math.max(h,Math.ceil(f.duration))},0):i.duration=0;return a.attributes=i,a.segments=s,r.base&&i.indexRange&&(a.sidx=s[0],a.segments=[]),a}function bt(t,i){return vu(t.childNodes).filter(function(n){return n.tagName===i})}function Cu(t){return t.textContent.trim()}function Vi(t){var i=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!i)return 0;var n=i.slice(1),e=n[0],r=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(e||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)}function xt(t){return t&&t.attributes?vu(t.attributes).reduce(function(i,n){var e=wu[n.name]||wu.DEFAULT;return i[n.name]=e(n.value),i},{}):{}}var ya,Eu=(function(t,i){var n,e,r,a,s;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,e=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(o,u,c){if(c=c||{},o=o.trim(),!(u=u.trim())){if(!c.alwaysNormalize)return o;var d=s.parseURL(o);if(!d)throw new Error("Error trying to parse base URL.");return d.path=s.normalizePath(d.path),s.buildURLFromParts(d)}var h=s.parseURL(u);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=s.normalizePath(h.path),s.buildURLFromParts(h)):u;var f=s.parseURL(o);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var y=e.exec(f.path);f.netLoc=y[1],f.path=y[2]}f.netLoc&&!f.path&&(f.path="/");var b={scheme:f.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(b.netLoc=f.netLoc,h.path[0]!=="/"))if(h.path){var _=f.path,E=_.substring(0,_.lastIndexOf("/")+1)+h.path;b.path=s.normalizePath(E)}else b.path=f.path,h.params||(b.params=f.params,h.query||(b.query=f.query));return b.path===null&&(b.path=c.alwaysNormalize?s.normalizePath(h.path):h.path),s.buildURLFromParts(b)},parseURL:function(o){var u=n.exec(o);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(o){for(o=o.split("").reverse().join("").replace(r,"");o.length!==(o=o.replace(a,"")).length;);return o.split("").reverse().join("")},buildURLFromParts:function(o){return o.scheme+o.netLoc+o.path+o.params+o.query+o.fragment}},t.exports=s}(ya={exports:{}},ya.exports),ya.exports),gd={static:function(t){var i=t.duration,n=t.timescale,e=n===void 0?1:n,r=t.sourceDuration;return{start:0,end:Math.ceil(r/(i/e))}},dynamic:function(t){var i=t.NOW,n=t.clientOffset,e=t.availabilityStartTime,r=t.timescale,a=r===void 0?1:r,s=t.duration,o=t.start,u=o===void 0?0:o,c=t.minimumUpdatePeriod,d=c===void 0?0:c,h=t.timeShiftBufferDepth,f=h===void 0?1/0:h,y=(i+n)/1e3,b=e+u,_=y+d-b,E=Math.ceil(_*a/s),S=Math.floor((y-b-f)*a/s),C=Math.floor((y-b)*a/s);return{start:Math.max(0,S),end:Math.min(E,C)}}},yd=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,wu={mediaPresentationDuration:function(t){return Vi(t)},availabilityStartTime:function(t){return function(i){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)}(t)/1e3},minimumUpdatePeriod:function(t){return Vi(t)},timeShiftBufferDepth:function(t){return Vi(t)},start:function(t){return Vi(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},duration:function(t){var i=parseInt(t,10);return isNaN(i)?Vi(t):i},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}};function Pn(t,i){return i.length?An(t.map(function(n){return i.map(function(e){return fa(n,Cu(e))})})):t}function va(t){var i=bt(t,"SegmentTemplate")[0],n=bt(t,"SegmentList")[0],e=n&&bt(n,"SegmentURL").map(function(h){return Mt({tag:"SegmentURL"},xt(h))}),r=bt(t,"SegmentBase")[0],a=n||i,s=a&&bt(a,"SegmentTimeline")[0],o=n||r||i,u=o&&bt(o,"Initialization")[0],c=i&&xt(i);c&&u?c.initialization=u&&xt(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var d={template:c,timeline:s&&bt(s,"S").map(function(h){return xt(h)}),list:n&&Mt(xt(n),{segmentUrls:e,initialization:xt(u)}),base:r&&Mt(xt(r),{initialization:xt(u)})};return Object.keys(d).forEach(function(h){d[h]||delete d[h]}),d}function vd(t){return t.reduce(function(i,n){var e=xt(n),r=Sd[e.schemeIdUri];if(r){i[r]={attributes:e};var a=bt(n,"cenc:pssh")[0];if(a){var s=Cu(a),o=s&&function(u){for(var c=k.atob(u),d=new Uint8Array(c.length),h=0;h<c.length;h++)d[h]=c.charCodeAt(h);return d}(s);i[r].pssh=o}}return i},{})}function _d(t,i,n){return function(e){var r=xt(e),a=Pn(i,bt(e,"BaseURL")),s=bt(e,"Role")[0],o={role:xt(s)},u=Mt(t,r,o),c=vd(bt(e,"ContentProtection"));Object.keys(c).length&&(u=Mt(u,{contentProtection:c}));var d=va(e),h=bt(e,"Representation"),f=Mt(n,d);return An(h.map(function(y,b,_){return function(E){var S=bt(E,"BaseURL"),C=Pn(b,S),L=Mt(y,xt(E)),D=va(E);return C.map(function(F){return{segmentInfo:Mt(_,D),attributes:Mt(L,{baseUrl:F})}})}}(u,a,f)))}}function bd(t,i){i===void 0&&(i={});var n=i,e=n.manifestUri,r=e===void 0?"":e,a=n.NOW,s=a===void 0?Date.now():a,o=n.clientOffset,u=o===void 0?0:o,c=bt(t,"Period");if(!c.length)throw new Error(rd);var d=xt(t),h=Pn([r],bt(t,"BaseURL"));return d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,An(c.map(function(f,y){return function(b,_){var E=Pn(y,bt(b,"BaseURL")),S=xt(b),C=parseInt(S.id,10),L=k.isNaN(C)?_:C,D=Mt(f,{periodIndex:L}),F=bt(b,"AdaptationSet"),B=va(b);return An(F.map(_d(D,E,B)))}}(d,h)))}function Au(t){if(t==="")throw new Error(ad);var i=new k.DOMParser().parseFromString(t,"application/xml"),n=i&&i.documentElement.tagName==="MPD"?i.documentElement:null;if(!n||n&&0<n.getElementsByTagName("parsererror").length)throw new Error(sd);return n}function Pu(t,i){return i===void 0&&(i={}),dd(function(n){return n.map(md)}(bd(Au(t),i)),i.sidxMapping)}function Td(t){return function(i){var n=bt(i,"UTCTiming")[0];if(!n)return null;var e=xt(n);switch(e.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":e.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":e.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":e.method="DIRECT",e.value=Date.parse(e.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ld)}return e}(Au(t))}var wt,Le,Iu,Lu,Ou,xu,Sd={"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"},Oe=function(t){return t>>>0},qi=function(t){return("00"+t.toString(16)).slice(-2)};Iu=function(t){return wt(t,["moov","trak"]).reduce(function(i,n){var e,r,a,s,o;return(e=wt(n,["tkhd"])[0])?(r=e[0],s=Oe(e[a=r===0?12:20]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]),(o=wt(n,["mdia","mdhd"])[0])?(a=(r=o[0])===0?12:20,i[s]=Oe(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3]),i):null):null},{})},Lu=function(t,i){var n,e,r;return n=wt(i,["moof","traf"]),e=[].concat.apply([],n.map(function(a){return wt(a,["tfhd"]).map(function(s){var o,u;return o=Oe(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),u=t[o]||9e4,(wt(a,["tfdt"]).map(function(c){var d,h;return d=c[0],h=Oe(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),d===1&&(h*=Math.pow(2,32),h+=Oe(c[8]<<24|c[9]<<16|c[10]<<8|c[11])),h})[0]||1/0)/u})})),r=Math.min.apply(null,e),isFinite(r)?r:0},Ou=function(t){var i=wt(t,["moov","trak"]),n=[];return i.forEach(function(e){var r=wt(e,["mdia","hdlr"]),a=wt(e,["tkhd"]);r.forEach(function(s,o){var u,c,d=Le(s.subarray(8,12)),h=a[o];d==="vide"&&(c=(u=new DataView(h.buffer,h.byteOffset,h.byteLength)).getUint8(0)===0?u.getUint32(12):u.getUint32(20),n.push(c))})}),n},xu=function(t){var i=wt(t,["moov","trak"]),n=[];return i.forEach(function(e){var r,a,s={},o=wt(e,["tkhd"])[0];o&&(a=(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0),s.id=a===0?r.getUint32(12):r.getUint32(20));var u=wt(e,["mdia","hdlr"])[0];if(u){var c=Le(u.subarray(8,12));s.type=c==="vide"?"video":c==="soun"?"audio":c}var d=wt(e,["mdia","minf","stbl","stsd"])[0];if(d){var h=d.subarray(8);s.codec=Le(h.subarray(4,8));var f,y=wt(h,[s.codec])[0];y&&(/^[a-z]vc[1-9]$/i.test(s.codec)?(f=y.subarray(78),Le(f.subarray(4,8))==="avcC"&&11<f.length?(s.codec+=".",s.codec+=qi(f[9]),s.codec+=qi(f[10]),s.codec+=qi(f[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)&&(f=y.subarray(28),Le(f.subarray(4,8))==="esds"&&20<f.length&&f[19]!==0?(s.codec+="."+qi(f[19]),s.codec+="."+qi(f[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"))}var b=wt(e,["mdia","mdhd"])[0];if(b&&o){var _=a===0?12:20;s.timescale=Oe(b[_]<<24|b[1+_]<<16|b[2+_]<<8|b[3+_])}n.push(s)}),n};function Gt(t){return new Date(1e3*t-20828448e5)}function Du(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}}function xe(){this.init=function(){var t={};this.on=function(i,n){t[i]||(t[i]=[]),t[i]=t[i].concat(n)},this.off=function(i,n){var e;return!!t[i]&&(e=t[i].indexOf(n),t[i]=t[i].slice(),t[i].splice(e,1),-1<e)},this.trigger=function(i){var n,e,r,a;if(n=t[i])if(arguments.length===2)for(r=n.length,e=0;e<r;++e)n[e].call(this,arguments[1]);else{for(a=[],e=arguments.length,e=1;e<arguments.length;++e)a.push(arguments[e]);for(r=n.length,e=0;e<r;++e)n[e].apply(this,a)}},this.dispose=function(){t={}}}}var Nt,Uu,re={findBox:wt=function(t,i){var n,e,r,a,s,o=[];if(!i.length)return null;for(n=0;n<t.byteLength;)e=Oe(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),r=Le(t.subarray(n+4,n+8)),a=1<e?n+e:t.byteLength,r===i[0]&&(i.length===1?o.push(t.subarray(n+8,a)):(s=wt(t.subarray(n+8,a),i.slice(1))).length&&(o=o.concat(s))),n=a;return o},parseType:Le=function(t){var i="";return i+=String.fromCharCode(t[0]),i+=String.fromCharCode(t[1]),i+=String.fromCharCode(t[2]),i+=String.fromCharCode(t[3])},timescale:Iu,startTime:Lu,videoTrackIds:Ou,tracks:xu},In=re.parseType,De={avc1:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:i.getUint16(6),width:i.getUint16(24),height:i.getUint16(26),horizresolution:i.getUint16(28)+i.getUint16(30)/16,vertresolution:i.getUint16(32)+i.getUint16(34)/16,frameCount:i.getUint16(40),depth:i.getUint16(74),config:Nt(t.subarray(78,t.byteLength))}},avcC:function(t){var i,n,e,r,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},o=31&t[5];for(e=6,r=0;r<o;r++)n=a.getUint16(e),e+=2,s.sps.push(new Uint8Array(t.subarray(e,e+n))),e+=n;for(i=t[e],e++,r=0;r<i;r++)n=a.getUint16(e),e+=2,s.pps.push(new Uint8Array(t.subarray(e,e+n))),e+=n;return s},btrt:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:i.getUint32(0),maxBitrate:i.getUint32(4),avgBitrate:i.getUint32(8)}},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={majorBrand:In(t.subarray(0,4)),minorVersion:i.getUint32(4),compatibleBrands:[]},e=8;e<t.byteLength;)n.compatibleBrands.push(In(t.subarray(e,e+4))),e+=4;return n},dinf:function(t){return{boxes:Nt(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:Nt(t.subarray(8))}},hdlr:function(t){var i={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:In(t.subarray(8,12)),name:""},n=8;for(n=24;n<t.byteLength;n++){if(t[n]===0){n++;break}i.name+=String.fromCharCode(t[n])}return i.name=decodeURIComponent(escape(i.name)),i},mdat:function(t){return{byteLength:t.byteLength,nals:function(i){var n,e,r=new DataView(i.buffer,i.byteOffset,i.byteLength),a=[];for(n=0;n+4<i.length;n+=e)if(e=r.getUint32(n),n+=4,e<=0)a.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&i[n]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push("UNKNOWN NAL - "+i[n]&31)}return a}(t)}},mdhd:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e=4,r={version:n.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return r.version===1?(e+=4,r.creationTime=Gt(n.getUint32(e)),e+=8,r.modificationTime=Gt(n.getUint32(e)),e+=4,r.timescale=n.getUint32(e),e+=8):(r.creationTime=Gt(n.getUint32(e)),e+=4,r.modificationTime=Gt(n.getUint32(e)),e+=4,r.timescale=n.getUint32(e),e+=4),r.duration=n.getUint32(e),e+=4,i=n.getUint16(e),r.language+=String.fromCharCode(96+(i>>10)),r.language+=String.fromCharCode(96+((992&i)>>5)),r.language+=String.fromCharCode(96+(31&i)),r},mdia:function(t){return{boxes:Nt(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:Nt(t)}},mp4a:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={dataReferenceIndex:i.getUint16(6),channelcount:i.getUint16(16),samplesize:i.getUint16(18),samplerate:i.getUint16(24)+i.getUint16(26)/65536};return 28<t.byteLength&&(n.streamDescriptor=Nt(t.subarray(28))[0]),n},moof:function(t){return{boxes:Nt(t)}},moov:function(t){return{boxes:Nt(t)}},mvex:function(t){return{boxes:Nt(t)}},mvhd:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,e={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return e.version===1?(n+=4,e.creationTime=Gt(i.getUint32(n)),n+=8,e.modificationTime=Gt(i.getUint32(n)),n+=4,e.timescale=i.getUint32(n),n+=8):(e.creationTime=Gt(i.getUint32(n)),n+=4,e.modificationTime=Gt(i.getUint32(n)),n+=4,e.timescale=i.getUint32(n),n+=4),e.duration=i.getUint32(n),n+=4,e.rate=i.getUint16(n)+i.getUint16(n+2)/16,n+=4,e.volume=i.getUint8(n)+i.getUint8(n+1)/8,n+=2,n+=2,n+=8,e.matrix=new Uint32Array(t.subarray(n,n+36)),n+=36,n+=24,e.nextTrackId=i.getUint32(n),e},pdin:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:i.getUint32(4),initialDelay:i.getUint32(8)}},sdtp:function(t){var i,n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]};for(i=4;i<t.byteLength;i++)n.samples.push({dependsOn:(48&t[i])>>4,isDependedOn:(12&t[i])>>2,hasRedundancy:3&t[i]});return n},sidx:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8),earliestPresentationTime:n.getUint32(12),firstOffset:n.getUint32(16)},r=n.getUint16(22);for(i=24;r;i+=12,r--)e.references.push({referenceType:(128&t[i])>>>7,referencedSize:2147483647&n.getUint32(i),subsegmentDuration:n.getUint32(i+4),startsWithSap:!!(128&t[i+8]),sapType:(112&t[i+8])>>>4,sapDeltaTime:268435455&n.getUint32(i+8)});return e},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:Nt(t)}},stco:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},r=n.getUint32(4);for(i=8;r;i+=4,r--)e.chunkOffsets.push(n.getUint32(i));return e},stsc:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e=n.getUint32(4),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]};for(i=8;e;i+=12,e--)r.sampleToChunks.push({firstChunk:n.getUint32(i),samplesPerChunk:n.getUint32(i+4),sampleDescriptionIndex:n.getUint32(i+8)});return r},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:Nt(t.subarray(8))}},stsz:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:n.getUint32(4),entries:[]};for(i=12;i<t.byteLength;i+=4)e.entries.push(n.getUint32(i));return e},stts:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},r=n.getUint32(4);for(i=8;r;i+=8,r--)e.timeToSamples.push({sampleCount:n.getUint32(i),sampleDelta:n.getUint32(i+4)});return e},styp:function(t){return De.ftyp(t)},tfdt:function(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};return i.version===1&&(i.baseMediaDecodeTime*=Math.pow(2,32),i.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),i},tfhd:function(t){var i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:n.getUint32(4)},r=1&e.flags[2],a=2&e.flags[2],s=8&e.flags[2],o=16&e.flags[2],u=32&e.flags[2],c=65536&e.flags[0],d=131072&e.flags[0];return i=8,r&&(i+=4,e.baseDataOffset=n.getUint32(12),i+=4),a&&(e.sampleDescriptionIndex=n.getUint32(i),i+=4),s&&(e.defaultSampleDuration=n.getUint32(i),i+=4),o&&(e.defaultSampleSize=n.getUint32(i),i+=4),u&&(e.defaultSampleFlags=n.getUint32(i)),c&&(e.durationIsEmpty=!0),!r&&d&&(e.baseDataOffsetIsMoof=!0),e},tkhd:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,e={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return e.version===1?(n+=4,e.creationTime=Gt(i.getUint32(n)),n+=8,e.modificationTime=Gt(i.getUint32(n)),n+=4,e.trackId=i.getUint32(n),n+=4,n+=8):(e.creationTime=Gt(i.getUint32(n)),n+=4,e.modificationTime=Gt(i.getUint32(n)),n+=4,e.trackId=i.getUint32(n),n+=4,n+=4),e.duration=i.getUint32(n),n+=4,n+=8,e.layer=i.getUint16(n),n+=2,e.alternateGroup=i.getUint16(n),n+=2,e.volume=i.getUint8(n)+i.getUint8(n+1)/8,n+=2,n+=2,e.matrix=new Uint32Array(t.subarray(n,n+36)),n+=36,e.width=i.getUint16(n)+i.getUint16(n+2)/16,n+=4,e.height=i.getUint16(n)+i.getUint16(n+2)/16,e},traf:function(t){return{boxes:Nt(t)}},trak:function(t){return{boxes:Nt(t)}},trex:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4),defaultSampleDescriptionIndex:i.getUint32(8),defaultSampleDuration:i.getUint32(12),defaultSampleSize:i.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:i.getUint16(22)}},trun:function(t){var i,n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},e=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],c=8&n.flags[1],d=e.getUint32(4),h=8;for(r&&(n.dataOffset=e.getInt32(h),h+=4),a&&d&&(i={flags:Du(t.subarray(h,h+4))},h+=4,s&&(i.duration=e.getUint32(h),h+=4),o&&(i.size=e.getUint32(h),h+=4),c&&(i.compositionTimeOffset=e.getUint32(h),h+=4),n.samples.push(i),d--);d--;)i={},s&&(i.duration=e.getUint32(h),h+=4),o&&(i.size=e.getUint32(h),h+=4),u&&(i.flags=Du(t.subarray(h,h+4)),h+=4),c&&(i.compositionTimeOffset=e.getUint32(h),h+=4),n.samples.push(i);return n},"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:i.getUint16(4),opcolor:new Uint16Array([i.getUint16(6),i.getUint16(8),i.getUint16(10)])}}},Ln={inspect:Nt=function(t){for(var i,n,e,r,a,s=0,o=[],u=new ArrayBuffer(t.length),c=new Uint8Array(u),d=0;d<t.length;++d)c[d]=t[d];for(i=new DataView(u);s<t.byteLength;)n=i.getUint32(s),e=In(t.subarray(s+4,s+8)),r=1<n?s+n:t.byteLength,(a=(De[e]||function(h){return{data:h}})(t.subarray(s+8,r))).size=n,a.type=e,o.push(a),s=r;return o},textify:Uu=function(t,i){var n;return i=i||0,n=new Array(2*i+1).join(" "),t.map(function(e,r){return n+e.type+`
`+Object.keys(e).filter(function(a){return a!=="type"&&a!=="boxes"}).map(function(a){var s=n+" "+a+": ",o=e[a];if(o instanceof Uint8Array||o instanceof Uint32Array){var u=Array.prototype.slice.call(new Uint8Array(o.buffer,o.byteOffset,o.byteLength)).map(function(c){return" "+("00"+c.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return u?u.length===1?s+"<"+u.join("").slice(1)+">":s+`<
`+u.map(function(c){return n+" "+c}).join(`
`)+`
`+n+" >":s+"<>"}return s+JSON.stringify(o,null,2).split(`
`).map(function(c,d){return d===0?c:n+" "+c}).join(`
`)}).join(`
`)+(e.boxes?`
`+Uu(e.boxes,i+1):"")}).join(`
`)},parseTfdt:De.tfdt,parseHdlr:De.hdlr,parseTfhd:De.tfhd,parseTrun:De.trun,parseSidx:De.sidx},kd=function(t){for(var i=0,n={payloadType:-1,payloadSize:0},e=0,r=0;i<t.byteLength&&t[i]!==128;){for(;t[i]===255;)e+=255,i++;for(e+=t[i++];t[i]===255;)r+=255,i++;if(r+=t[i++],!n.payload&&e===4){n.payloadType=e,n.payloadSize=r,n.payload=t.subarray(i,i+r);break}i+=r,r=e=0}return n},Cd=function(t){return t.payload[0]!==181||(t.payload[1]<<8|t.payload[2])!=49||String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"||t.payload[7]!==3?null:t.payload.subarray(8,t.payload.length-1)},Ed=function(t,i){var n,e,r,a,s=[];if(!(64&i[0]))return s;for(e=31&i[0],n=0;n<e;n++)a={type:3&i[2+(r=3*n)],pts:t},4&i[2+r]&&(a.ccData=i[3+r]<<8|i[4+r],s.push(a));return s},wd=function(t){for(var i,n,e=t.byteLength,r=[],a=1;a<e-2;)t[a]===0&&t[a+1]===0&&t[a+2]===3?(r.push(a+2),a+=2):a++;if(r.length===0)return t;i=e-r.length,n=new Uint8Array(i);var s=0;for(a=0;a<i;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=t[s];return n},Ad=4;xe.prototype.pipe=function(t){return this.on("data",function(i){t.push(i)}),this.on("done",function(i){t.flush(i)}),this.on("partialdone",function(i){t.partialFlush(i)}),this.on("endedtimeline",function(i){t.endTimeline(i)}),this.on("reset",function(i){t.reset(i)}),t},xe.prototype.push=function(t){this.trigger("data",t)},xe.prototype.flush=function(t){this.trigger("done",t)},xe.prototype.partialFlush=function(t){this.trigger("partialdone",t)},xe.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)},xe.prototype.reset=function(t){this.trigger("reset",t)};function Xt(){Xt.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new pt(0,0),new pt(0,1),new pt(1,0),new pt(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("partialdone",this.trigger.bind(this,"partialdone")),t.on("done",this.trigger.bind(this,"done"))},this)}var _a=xe;(Xt.prototype=new _a).push=function(t){var i,n,e;if(t.nalUnitType==="sei_rbsp"&&(i=kd(t.escapedRBSP)).payloadType===Ad&&(n=Cd(i)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));e=Ed(t.pts,n),this.captionPackets_=this.captionPackets_.concat(e),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},Xt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(i){return t==="flush"?i.flush():i.partialFlush()},this)},Xt.prototype.flushStream=function(t){this.captionPackets_.length&&(this.captionPackets_.forEach(function(i,n){i.presortIndex=n}),this.captionPackets_.sort(function(i,n){return i.pts===n.pts?i.presortIndex-n.presortIndex:i.pts-n.pts}),this.captionPackets_.forEach(function(i){i.type<2&&this.dispatchCea608Packet(i)},this),this.captionPackets_.length=0),this.flushCCStreams(t)},Xt.prototype.flush=function(){return this.flushStream("flush")},Xt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Xt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},Xt.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),this.activeCea608Channel_[t.type]!==null&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},Xt.prototype.setsChannel1Active=function(t){return(30720&t.ccData)==4096},Xt.prototype.setsChannel2Active=function(t){return(30720&t.ccData)==6144},Xt.prototype.setsTextOrXDSActive=function(t){return(28928&t.ccData)==256||(30974&t.ccData)==4138||(30974&t.ccData)==6186};function On(t){return t===null?"":(t=Pd[t]||t,String.fromCharCode(t))}function Ue(){for(var t=[],i=15;i--;)t.push("");return t}var Pd={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},Id=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],pt=function t(i,n){t.prototype.init.call(this),this.field_=i||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var r,a,s,o,u;if((r=32639&e.ccData)!==this.lastControlCode_){if((61440&r)==4096?this.lastControlCode_=r:r!==this.PADDING_&&(this.lastControlCode_=null),s=r>>>8,o=255&r,r!==this.PADDING_)if(r===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(r===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),a=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=a,this.startPts_=e.pts;else if(r===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(r===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(r===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(r===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(r===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(r===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ue();else if(r===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ue();else if(r===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(e.pts),this.displayed_=Ue()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(s,o))u=On((s=(3&s)<<8)|o),this[this.mode_](e.pts,u),this.column_++;else if(this.isExtCharacter(s,o))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),u=On((s=(3&s)<<8)|o),this[this.mode_](e.pts,u),this.column_++;else if(this.isMidRowCode(s,o))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&o)==14&&this.addFormatting(e.pts,["i"]),(1&o)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(s,o))this.column_+=3&o;else if(this.isPAC(s,o)){var c=Id.indexOf(7968&r);this.mode_==="rollUp"&&(c-this.rollUpRows_+1<0&&(c=this.rollUpRows_-1),this.setRollUp(e.pts,c)),c!==this.row_&&(this.clearFormatting(e.pts),this.row_=c),1&o&&this.formatting_.indexOf("u")===-1&&this.addFormatting(e.pts,["u"]),(16&r)==16&&(this.column_=4*((14&r)>>1)),this.isColorPAC(o)&&(14&o)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(s)&&(o===0&&(o=null),u=On(s),u+=On(o),this[this.mode_](e.pts,u),this.column_+=u.length)}else this.lastControlCode_=null}};pt.prototype=new _a,pt.prototype.flushDisplayed=function(t){var i=this.displayed_.map(function(n){try{return n.trim()}catch(e){return""}}).join(`
`).replace(/^\n+|\n+$/g,"");i.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:i,stream:this.name_})},pt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ue(),this.nonDisplayed_=Ue(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},pt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=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_},pt.prototype.isSpecialCharacter=function(t,i){return t===this.EXT_&&48<=i&&i<=63},pt.prototype.isExtCharacter=function(t,i){return(t===this.EXT_+1||t===this.EXT_+2)&&32<=i&&i<=63},pt.prototype.isMidRowCode=function(t,i){return t===this.EXT_&&32<=i&&i<=47},pt.prototype.isOffsetControlCode=function(t,i){return t===this.OFFSET_&&33<=i&&i<=35},pt.prototype.isPAC=function(t,i){return t>=this.BASE_&&t<this.BASE_+8&&64<=i&&i<=127},pt.prototype.isColorPAC=function(t){return 64<=t&&t<=79||96<=t&&t<=127},pt.prototype.isNormalChar=function(t){return 32<=t&&t<=127},pt.prototype.setRollUp=function(t,i){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=Ue(),this.displayed_=Ue()),i!==void 0&&i!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[i-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";i===void 0&&(i=this.row_),this.topRow_=i-this.rollUpRows_+1},pt.prototype.addFormatting=function(t,i){this.formatting_=this.formatting_.concat(i);var n=i.reduce(function(e,r){return e+"<"+r+">"},"");this[this.mode_](t,n)},pt.prototype.clearFormatting=function(t){if(this.formatting_.length){var i=this.formatting_.reverse().reduce(function(n,e){return n+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,i)}},pt.prototype.popOn=function(t,i){var n=this.nonDisplayed_[this.row_];n+=i,this.nonDisplayed_[this.row_]=n},pt.prototype.rollUp=function(t,i){var n=this.displayed_[this.row_];n+=i,this.displayed_[this.row_]=n},pt.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},pt.prototype.paintOn=function(t,i){var n=this.displayed_[this.row_];n+=i,this.displayed_[this.row_]=n};function Ld(t,i){for(var n=t,e=0;e<i.length;e++){var r=i[e];if(n<r.size)return r;n-=r.size}return null}function Od(t,i){var n=re.findBox(t,["moof","traf"]),e=re.findBox(t,["mdat"]),r={},a=[];return e.forEach(function(s,o){var u=n[o];a.push({mdat:s,traf:u})}),a.forEach(function(s){var o,u=s.mdat,c=s.traf,d=re.findBox(c,["tfhd"]),h=Ln.parseTfhd(d[0]),f=h.trackId,y=re.findBox(c,["tfdt"]),b=0<y.length?Ln.parseTfdt(y[0]).baseMediaDecodeTime:0,_=re.findBox(c,["trun"]);i===f&&0<_.length&&(o=function(E,S,C){var L,D,F,B,H=new DataView(E.buffer,E.byteOffset,E.byteLength),V=[];for(D=0;D+4<E.length;D+=F)if(F=H.getUint32(D),D+=4,!(F<=0))switch(31&E[D]){case 6:var R=E.subarray(D+1,D+1+F),W=Ld(D,S);L={nalUnitType:"sei_rbsp",size:F,data:R,escapedRBSP:Dd(R),trackId:C},W?(L.pts=W.pts,L.dts=W.dts,B=W):(L.pts=B.pts,L.dts=B.dts),V.push(L)}return V}(u,function(E,S,C){var L=S,D=C.defaultSampleDuration||0,F=C.defaultSampleSize||0,B=C.trackId,H=[];return E.forEach(function(V){var R=Ln.parseTrun(V).samples;R.forEach(function(W){W.duration===void 0&&(W.duration=D),W.size===void 0&&(W.size=F),W.trackId=B,W.dts=L,W.compositionTimeOffset===void 0&&(W.compositionTimeOffset=0),W.pts=L+W.compositionTimeOffset,L+=W.duration}),H=H.concat(R)}),H}(_,b,h),f),r[f]||(r[f]=[]),r[f]=r[f].concat(o))}),r}function xd(t,i){var n=1;for(i<t&&(n=-1);4294967296<Math.abs(i-t);)t+=8589934592*n;return t}var Dd=wd,Ud=Xt,Rd=function(){var t,i,n,e,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(o){t=new Ud,s=!0,a=!!o&&o.isPartial,t.on("data",function(u){u.startTime=u.startPts/e,u.endTime=u.endPts/e,r.captions.push(u),r.captionStreams[u.stream]=!0})},this.isNewInit=function(o,u){return!(o&&o.length===0||u&&typeof u=="object"&&Object.keys(u).length===0)&&(n!==o[0]||e!==u[n])},this.parse=function(o,u,c){var d;if(!this.isInitialized()||!u||!c)return null;if(this.isNewInit(u,c))n=u[0],e=c[n];else if(n===null||!e)return i.push(o),null;for(;0<i.length;){var h=i.shift();this.parse(h,u,c)}return(d=function(f,y,b){return y===null?null:{seiNals:Od(f,y)[y],timescale:b}}(o,n,e))!==null&&d.seiNals?(this.pushNals(d.seiNals),this.flushStream(),r):null},this.pushNals=function(o){if(!this.isInitialized()||!o||o.length===0)return null;o.forEach(function(u){t.push(u)})},this.flushStream=function(){if(!this.isInitialized())return null;a?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){i=[],e=n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Ru=27,Mu=15,Md=21;new _a;function Nu(t){var i=31&t[1];return i<<=8,i|=t[2]}function xn(t){return!!(64&t[1])}function Dn(t){var i=0;return 1<(48&t[3])>>>4&&(i+=t[4]+1),i}function ba(t){switch(t){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}}function Bu(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]}var Nd,Bd,jd,Fd,Hd={parseType:function(t,i){var n=Nu(t);return n===0?"pat":n===i?"pmt":i?"pes":null},parsePat:function(t){var i=xn(t),n=4+Dn(t);return i&&(n+=t[n]+1),(31&t[n+10])<<8|t[n+11]},parsePmt:function(t){var i={},n=xn(t),e=4+Dn(t);if(n&&(e+=t[e]+1),1&t[e+5]){var r;r=3+((15&t[e+1])<<8|t[e+2])-4;for(var a=12+((15&t[e+10])<<8|t[e+11]);a<r;){var s=e+a;i[(31&t[s+1])<<8|t[s+2]]=t[s],a+=5+((15&t[s+3])<<8|t[s+4])}return i}},parsePayloadUnitStartIndicator:xn,parsePesType:function(t,i){switch(i[Nu(t)]){case Ru:return"video";case Mu:return"audio";case Md:return"timed-metadata";default:return null}},parsePesTime:function(t){if(!xn(t))return null;var i=4+Dn(t);if(i>=t.byteLength)return null;var n,e=null;return 192&(n=t[i+7])&&((e={}).pts=(14&t[i+9])<<27|(255&t[i+10])<<20|(254&t[i+11])<<12|(255&t[i+12])<<5|(254&t[i+13])>>>3,e.pts*=4,e.pts+=(6&t[i+13])>>>1,e.dts=e.pts,64&n&&(e.dts=(14&t[i+14])<<27|(255&t[i+15])<<20|(254&t[i+16])<<12|(255&t[i+17])<<5|(254&t[i+18])>>>3,e.dts*=4,e.dts+=(6&t[i+18])>>>1)),e},videoPacketContainsKeyFrame:function(t){for(var i=4+Dn(t),n=t.subarray(i),e=0,r=0,a=!1;r<n.byteLength-3;r++)if(n[r+2]===1){e=r+5;break}for(;e<n.byteLength;)switch(n[e]){case 0:if(n[e-1]!==0){e+=2;break}if(n[e-2]!==0){e++;break}for(r+3!==e-2&&ba(31&n[r+3])==="slice_layer_without_partitioning_rbsp_idr"&&(a=!0);n[++e]!==1&&e<n.length;);r=e-2,e+=3;break;case 1:if(n[e-1]!==0||n[e-2]!==0){e+=3;break}ba(31&n[r+3])==="slice_layer_without_partitioning_rbsp_idr"&&(a=!0),r=e-2,e+=3;break;default:e+=3}return n=n.subarray(r),e-=r,r=0,n&&3<n.byteLength&&ba(31&n[r+3])==="slice_layer_without_partitioning_rbsp_idr"&&(a=!0),a}},Vd=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],qd={isLikelyAacData:function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},parseId3TagSize:function(t,i){var n=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];return(16&t[i+5])>>4?20+n:10+n},parseAdtsSize:function(t,i){var n=(224&t[i+5])>>5,e=t[i+4]<<3;return 6144&t[i+3]|e|n},parseType:function(t,i){return t[i]==="I".charCodeAt(0)&&t[i+1]==="D".charCodeAt(0)&&t[i+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[i]&&(240&t[i+1])==240?"audio":null},parseSampleRate:function(t){for(var i=0;i+5<t.length;){if(t[i]===255&&(246&t[i+1])==240)return Vd[(60&t[i+2])>>>2];i++}return null},parseAacTimestamp:function(t){var i,n,e;i=10,64&t[5]&&(i+=4,i+=Bu(t.subarray(10,14)));do{if((n=Bu(t.subarray(i+4,i+8)))<1)return null;if(String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3])==="PRIV"){e=t.subarray(i+10,i+n+10);for(var r=0;r<e.byteLength;r++)if(e[r]===0){if(unescape(function(o,u,c){var d,h="";for(d=u;d<c;d++)h+="%"+("00"+o[d].toString(16)).slice(-2);return h}(e,0,r))!=="com.apple.streaming.transportStreamTimestamp")break;var a=e.subarray(r+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return s*=4,s+=3&a[7]}}i+=10,i+=n}while(i<t.byteLength);return null}},Wd=9e4,ai=(Nd=function(t){return 9e4*t},Bd=function(t,i){return t*i},jd=function(t){return t/9e4},Fd=function(t,i){return t/i},xd),it={};it.ts=Hd,it.aac=qd;function zd(t,i,n){for(var e,r,a,s,o=0,u=Dt,c=!1;u<=t.byteLength;)if(t[o]!==71||t[u]!==71&&u!==t.byteLength)o++,u++;else{switch(e=t.subarray(o,u),it.ts.parseType(e,i.pid)){case"pes":r=it.ts.parsePesType(e,i.table),a=it.ts.parsePayloadUnitStartIndicator(e),r==="audio"&&a&&(s=it.ts.parsePesTime(e))&&(s.type="audio",n.audio.push(s),c=!0)}if(c)break;o+=Dt,u+=Dt}for(o=(u=t.byteLength)-Dt,c=!1;0<=o;)if(t[o]!==71||t[u]!==71&&u!==t.byteLength)o--,u--;else{switch(e=t.subarray(o,u),it.ts.parseType(e,i.pid)){case"pes":r=it.ts.parsePesType(e,i.table),a=it.ts.parsePayloadUnitStartIndicator(e),r==="audio"&&a&&(s=it.ts.parsePesTime(e))&&(s.type="audio",n.audio.push(s),c=!0)}if(c)break;o-=Dt,u-=Dt}}function $d(t,i,n){for(var e,r,a,s,o,u,c,d=0,h=Dt,f=!1,y={data:[],size:0};h<t.byteLength;)if(t[d]!==71||t[h]!==71)d++,h++;else{switch(e=t.subarray(d,h),it.ts.parseType(e,i.pid)){case"pes":if(r=it.ts.parsePesType(e,i.table),a=it.ts.parsePayloadUnitStartIndicator(e),r==="video"&&(a&&!f&&(s=it.ts.parsePesTime(e))&&(s.type="video",n.video.push(s),f=!0),!n.firstKeyFrame)){if(a&&y.size!==0){for(o=new Uint8Array(y.size),u=0;y.data.length;)c=y.data.shift(),o.set(c,u),u+=c.byteLength;if(it.ts.videoPacketContainsKeyFrame(o)){var b=it.ts.parsePesTime(o);b&&(n.firstKeyFrame=b,n.firstKeyFrame.type="video")}y.size=0}y.data.push(e),y.size+=e.byteLength}}if(f&&n.firstKeyFrame)break;d+=Dt,h+=Dt}for(d=(h=t.byteLength)-Dt,f=!1;0<=d;)if(t[d]!==71||t[h]!==71)d--,h--;else{switch(e=t.subarray(d,h),it.ts.parseType(e,i.pid)){case"pes":r=it.ts.parsePesType(e,i.table),a=it.ts.parsePayloadUnitStartIndicator(e),r==="video"&&a&&(s=it.ts.parsePesTime(e))&&(s.type="video",n.video.push(s),f=!0)}if(f)break;d-=Dt,h-=Dt}}function Gd(t){var i={pid:null,table:null},n={};for(var e in function(r,a){for(var s,o=0,u=Dt;u<r.byteLength;)if(r[o]!==71||r[u]!==71)o++,u++;else{switch(s=r.subarray(o,u),it.ts.parseType(s,a.pid)){case"pat":a.pid||(a.pid=it.ts.parsePat(s));break;case"pmt":a.table||(a.table=it.ts.parsePmt(s))}if(a.pid&&a.table)return;o+=Dt,u+=Dt}}(t,i),i.table)if(i.table.hasOwnProperty(e))switch(i.table[e]){case Ru:n.video=[],$d(t,i,n),n.video.length===0&&delete n.video;break;case Mu:n.audio=[],zd(t,i,n),n.audio.length===0&&delete n.audio}return n}var Re=Wd,Dt=188,Xd=function(t,i){var n;return(n=it.aac.isLikelyAacData(t)?function(e){for(var r,a=!1,s=0,o=null,u=null,c=0,d=0;3<=e.length-d;){switch(it.aac.parseType(e,d)){case"timed-metadata":if(e.length-d<10){a=!0;break}if((c=it.aac.parseId3TagSize(e,d))>e.length){a=!0;break}u===null&&(r=e.subarray(d,d+c),u=it.aac.parseAacTimestamp(r)),d+=c;break;case"audio":if(e.length-d<7){a=!0;break}if((c=it.aac.parseAdtsSize(e,d))>e.length){a=!0;break}o===null&&(r=e.subarray(d,d+c),o=it.aac.parseSampleRate(r)),s++,d+=c;break;default:d++}if(a)return null}if(o===null||u===null)return null;var h=Re/o;return{audio:[{type:"audio",dts:u,pts:u},{type:"audio",dts:u+1024*s*h,pts:u+1024*s*h}]}}(t):Gd(t))&&(n.audio||n.video)?(function(e,r){if(e.audio&&e.audio.length){var a=r;typeof a=="undefined"&&(a=e.audio[0].dts),e.audio.forEach(function(u){u.dts=ai(u.dts,a),u.pts=ai(u.pts,a),u.dtsTime=u.dts/Re,u.ptsTime=u.pts/Re})}if(e.video&&e.video.length){var s=r;if(typeof s=="undefined"&&(s=e.video[0].dts),e.video.forEach(function(u){u.dts=ai(u.dts,s),u.pts=ai(u.pts,s),u.dtsTime=u.dts/Re,u.ptsTime=u.pts/Re}),e.firstKeyFrame){var o=e.firstKeyFrame;o.dts=ai(o.dts,s),o.pts=ai(o.pts,s),o.dtsTime=o.dts/Re,o.ptsTime=o.dts/Re}}}(n,i),n):null};function Un(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}var Kd=function(t,i,n){return i&&ju(t.prototype,i),n&&ju(t,n),t};function ju(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}var Kt=null,Yd=(Ta.prototype.decrypt=function(t,i,n,e,r,a){var s=this._key[1],o=t^s[0],u=e^s[1],c=n^s[2],d=i^s[3],h=void 0,f=void 0,y=void 0,b=s.length/4-2,_=void 0,E=4,S=this._tables[1],C=S[0],L=S[1],D=S[2],F=S[3],B=S[4];for(_=0;_<b;_++)h=C[o>>>24]^L[u>>16&255]^D[c>>8&255]^F[255&d]^s[E],f=C[u>>>24]^L[c>>16&255]^D[d>>8&255]^F[255&o]^s[E+1],y=C[c>>>24]^L[d>>16&255]^D[o>>8&255]^F[255&u]^s[E+2],d=C[d>>>24]^L[o>>16&255]^D[u>>8&255]^F[255&c]^s[E+3],E+=4,o=h,u=f,c=y;for(_=0;_<4;_++)r[(3&-_)+a]=B[o>>>24]<<24^B[u>>16&255]<<16^B[c>>8&255]<<8^B[255&d]^s[E++],h=o,o=u,u=c,c=d,d=h},Ta);function Ta(t){Un(this,Ta),Kt=Kt||function(){var d=[[[],[],[],[],[]],[[],[],[],[],[]]],h=d[0],f=d[1],y=h[4],b=f[4],_=void 0,E=void 0,S=void 0,C=[],L=[],D=void 0,F=void 0,B=void 0,H=void 0,V=void 0;for(_=0;_<256;_++)L[(C[_]=_<<1^283*(_>>7))^_]=_;for(E=S=0;!y[E];E^=D||1,S=L[S]||1)for(B=(B=S^S<<1^S<<2^S<<3^S<<4)>>8^255&B^99,V=16843009*C[F=C[D=C[b[y[E]=B]=E]]]^65537*F^257*D^16843008*E,H=257*C[B]^16843008*B,_=0;_<4;_++)h[_][E]=H=H<<24^H>>>8,f[_][B]=V=V<<24^V>>>8;for(_=0;_<5;_++)h[_]=h[_].slice(0),f[_]=f[_].slice(0);return d}(),this._tables=[[Kt[0][0].slice(),Kt[0][1].slice(),Kt[0][2].slice(),Kt[0][3].slice(),Kt[0][4].slice()],[Kt[1][0].slice(),Kt[1][1].slice(),Kt[1][2].slice(),Kt[1][3].slice(),Kt[1][4].slice()]];var i=void 0,n=void 0,e=void 0,r=void 0,a=void 0,s=this._tables[0][4],o=this._tables[1],u=t.length,c=1;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size");for(r=t.slice(0),a=[],this._key=[r,a],i=u;i<4*u+28;i++)e=r[i-1],(i%u==0||u===8&&i%u==4)&&(e=s[e>>>24]<<24^s[e>>16&255]<<16^s[e>>8&255]<<8^s[255&e],i%u==0&&(e=e<<8^e>>>24^c<<24,c=c<<1^283*(c>>7))),r[i]=r[i-u]^e;for(n=0;i;n++,i--)e=r[3&n?i:i-4],a[n]=i<=4||n<4?e:o[0][s[e>>>24]]^o[1][s[e>>16&255]]^o[2][s[e>>8&255]]^o[3][s[255&e]]}var Fu=(Me.prototype.on=function(t,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(i)},Me.prototype.off=function(t,i){if(!this.listeners[t])return!1;var n=this.listeners[t].indexOf(i);return this.listeners[t].splice(n,1),-1<n},Me.prototype.trigger=function(t,i){var n=this.listeners[t];if(n)if(arguments.length===2)for(var e=n.length,r=0;r<e;++r)n[r].call(this,i);else for(var a=Array.prototype.slice.call(arguments,1),s=n.length,o=0;o<s;++o)n[o].apply(this,a)},Me.prototype.dispose=function(){this.listeners={}},Me.prototype.pipe=function(t){this.on("data",function(i){t.push(i)})},Me);function Me(){Un(this,Me),this.listeners={}}var Hu,Vu=(function(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i)}(Wi,Hu=Fu),Wi.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},Wi.prototype.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},Wi);function Wi(){Un(this,Wi);var t=function(i,n){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||typeof n!="object"&&typeof n!="function"?i:n}(this,Hu.call(this,Fu));return t.jobs=[],t.delay=1,t.timeout_=null,t}function Yt(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}function qu(t,i,n){var e=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),r=new Yd(Array.prototype.slice.call(i)),a=new Uint8Array(t.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,c=void 0,d=void 0,h=void 0,f=void 0,y=void 0,b=void 0,_=void 0;for(o=n[0],u=n[1],c=n[2],d=n[3],_=0;_<e.length;_+=4)h=Yt(e[_]),f=Yt(e[_+1]),y=Yt(e[_+2]),b=Yt(e[_+3]),r.decrypt(h,f,y,b,s,_),s[_]=Yt(s[_]^o),s[_+1]=Yt(s[_+1]^u),s[_+2]=Yt(s[_+2]^c),s[_+3]=Yt(s[_+3]^d),o=h,u=f,c=y,d=b;return a}var Qd=(zi.prototype.decryptChunk_=function(t,i,n,e){return function(){var r=qu(t,i,n);e.set(r,t.byteOffset)}},Kd(zi,null,[{key:"STEP",get:function(){return 32e3}}]),zi);function zi(t,i,n,e){Un(this,zi);var r=zi.STEP,a=new Int32Array(t.buffer),s=new Uint8Array(t.byteLength),o=0;for(this.asyncStream_=new Vu,this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),i,n,s)),o=r;o<a.length;o+=r)n=new Uint32Array([Yt(a[o-4]),Yt(a[o-3]),Yt(a[o-2]),Yt(a[o-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),i,n,s));this.asyncStream_.push(function(){e(null,function(u){return u.subarray(0,u.byteLength-u[u.byteLength-1])}(s))})}function Ne(t,i){return/^[a-z]+:/i.test(i)?i:(/\/\//i.test(t)||(t=mu.buildAbsoluteURL(k.location.href,t)),mu.buildAbsoluteURL(t,i))}function Rn(t,i,n){return t&&n.responseURL&&i!==n.responseURL?n.responseURL:i}function Qt(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}/**
* @videojs/http-streaming
* @version 1.10.6
* @copyright 2019 Brightcove, Inc
* @license Apache-2.0
*/var ie=function(t,i,n){return i&&Wu(t.prototype,i),n&&Wu(t,n),t};function Wu(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function ce(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i)}function ae(t,i){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||typeof i!="object"&&typeof i!="function"?t:i}function Mn(t,i){["AUDIO","SUBTITLES"].forEach(function(n){for(var e in t.mediaGroups[n])for(var r in t.mediaGroups[n][e]){var a=t.mediaGroups[n][e][r];i(a,n,e,r)}})}function Sa(t,i){var n=ka(t,{}),e=n.playlists[i.uri];if(!e||e.segments&&i.segments&&e.segments.length===i.segments.length&&e.endList===i.endList&&e.mediaSequence===i.mediaSequence)return null;var r=ka(e,i);e.segments&&(r.segments=function(s,o,u){var c=o.slice();u=u||0;for(var d=Math.min(s.length,o.length+u),h=u;h<d;h++)c[h-u]=ka(s[h],c[h-u]);return c}(e.segments,i.segments,i.mediaSequence-e.mediaSequence)),r.segments.forEach(function(s){(function(o,u){o.resolvedUri||(o.resolvedUri=Ne(u,o.uri)),o.key&&!o.key.resolvedUri&&(o.key.resolvedUri=Ne(u,o.key.uri)),o.map&&!o.map.resolvedUri&&(o.map.resolvedUri=Ne(u,o.map.uri))})(s,r.resolvedUri)});for(var a=0;a<n.playlists.length;a++)n.playlists[a].uri===i.uri&&(n.playlists[a]=r);return n.playlists[i.uri]=r,n}function zu(t){for(var i=t.playlists.length;i--;){var n=t.playlists[i];(t.playlists[n.uri]=n).resolvedUri=Ne(t.uri,n.uri),n.id=i,n.attributes||(n.attributes={},Zd.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}}function $u(t){Mn(t,function(i){i.uri&&(i.resolvedUri=Ne(t.uri,i.uri))})}function Gu(t,i){var n=t.segments[t.segments.length-1];return i&&n&&n.duration?1e3*n.duration:500*(t.targetDuration||10)}var Jd=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(n,e){var r=[],a=!0,s=!1,o=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);a=!0);}catch(d){s=!0,o=d}finally{try{!a&&c.return&&c.return()}finally{if(s)throw o}}return r}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},ka=w.mergeOptions,Zd=w.log,Nn=(ce(si,w.EventTarget),ie(si,[{key:"playlistRequestError",value:function(t,i,n){this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[i],status:t.status,message:"HLS playlist request error at URL: "+i+".",responseText:t.responseText,code:500<=t.status?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(t,i){var n=this;this.request=null,this.state="HAVE_METADATA";var e=new _u;this.customTagParsers.forEach(function(a){return e.addParser(a)}),this.customTagMappers.forEach(function(a){return e.addTagMapper(a)}),e.push(t.responseText),e.end(),e.manifest.uri=i,e.manifest.attributes=e.manifest.attributes||{};var r=Sa(this.master,e.manifest);this.targetDuration=e.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[e.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=k.setTimeout(function(){n.trigger("mediaupdatetimeout")},Gu(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout)}},{key:"stopRequest",value:function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}},{key:"media",value:function(t,i){var n=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof t=="string"){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(k.clearTimeout(this.finalRenditionTimeout),i){var e=t.targetDuration/2*1e3||5e3;this.finalRenditionTimeout=k.setTimeout(this.media.bind(this,t,!1),e)}else{var r=this.state,a=!this.media_||t.uri!==this.media_.uri;if(this.master.playlists[t.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(a&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(a){if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},function(s,o){if(n.request){if(t.resolvedUri=Rn(n.handleManifestRedirects,t.resolvedUri,o),s)return n.playlistRequestError(n.request,t.uri,r);n.haveMetadata(o,t.uri),r==="HAVE_MASTER"?n.trigger("loadedmetadata"):n.trigger("mediachange")}})}}}},{key:"pause",value:function(){this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}},{key:"load",value:function(t){var i=this;k.clearTimeout(this.mediaUpdateTimeout);var n=this.media();if(t){var e=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(function(){return i.load()},e)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var t=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(i,n){if(t.request){if(t.request=null,i)return t.error={status:n.status,message:"HLS playlist request error at URL: "+t.srcUrl+".",responseText:n.responseText,code:2},t.state==="HAVE_NOTHING"&&(t.started=!1),t.trigger("error");var e=new _u;return t.customTagParsers.forEach(function(r){return e.addParser(r)}),t.customTagMappers.forEach(function(r){return e.addTagMapper(r)}),e.push(n.responseText),e.end(),t.state="HAVE_MASTER",t.srcUrl=Rn(t.handleManifestRedirects,t.srcUrl,n),e.manifest.uri=t.srcUrl,e.manifest.playlists?(t.master=e.manifest,zu(t.master),$u(t.master),t.trigger("loadedplaylist"),void(t.request||t.media(e.manifest.playlists[0]))):(t.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,playlists:[{uri:t.srcUrl,id:0,resolvedUri:t.srcUrl,attributes:{}}]},t.master.playlists[t.srcUrl]=t.master.playlists[0],t.haveMetadata(n,t.srcUrl),t.trigger("loadedmetadata"))}})}}]),si);function si(t,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};Qt(this,si);var e=ae(this,(si.__proto__||Object.getPrototypeOf(si)).call(this)),r=n.withCredentials,a=r!==void 0&&r,s=n.handleManifestRedirects,o=s!==void 0&&s;e.srcUrl=t,e.hls_=i,e.withCredentials=a,e.handleManifestRedirects=o;var u=i.options_;if(e.customTagParsers=u&&u.customTagParsers||[],e.customTagMappers=u&&u.customTagMappers||[],!e.srcUrl)throw new Error("A non-empty playlist URL is required");return e.state="HAVE_NOTHING",e.on("mediaupdatetimeout",function(){e.state==="HAVE_METADATA"&&(e.state="HAVE_CURRENT_METADATA",e.request=e.hls_.xhr({uri:Ne(e.master.uri,e.media().uri),withCredentials:e.withCredentials},function(c,d){if(e.request)return c?e.playlistRequestError(e.request,e.media().uri,"HAVE_METADATA"):void e.haveMetadata(e.request,e.media().uri)}))}),e}function Xu(t,i,n){var e,r;return typeof i=="undefined"&&(i=t.mediaSequence+t.segments.length),i<t.mediaSequence?0:(e=function(a,s){var o=0,u=s-a.mediaSequence,c=a.segments[u];if(c){if(typeof c.start!="undefined")return{result:c.start,precise:!0};if(typeof c.end!="undefined")return{result:c.end-c.duration,precise:!0}}for(;u--;){if(typeof(c=a.segments[u]).end!="undefined")return{result:o+c.end,precise:!0};if(o+=c.duration,typeof c.start!="undefined")return{result:o+c.start,precise:!0}}return{result:o,precise:!1}}(t,i)).precise?e.result:(r=function(a,s){for(var o=0,u=void 0,c=s-a.mediaSequence;c<a.segments.length;c++){if(typeof(u=a.segments[c]).start!="undefined")return{result:u.start-o,precise:!0};if(o+=u.duration,typeof u.end!="undefined")return{result:u.end-o,precise:!0}}return{result:-1,precise:!1}}(t,i)).precise?r.result:e.result+n}function Ku(t,i,n){if(!t)return 0;if(typeof n!="number"&&(n=0),typeof i=="undefined"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return k.Infinity}return Xu(t,i,n)}function $i(t,i,n){var e=0;if(n<i){var r=[n,i];i=r[0],n=r[1]}if(i<0){for(var a=i;a<Math.min(0,n);a++)e+=t.targetDuration;i=0}for(var s=i;s<n;s++)e+=t.segments[s].duration;return e}function Yu(t){if(!t.segments.length)return 0;for(var i=t.segments.length-1,n=t.segments[i].duration||t.targetDuration,e=n+2*t.targetDuration;i--&&!(e<=(n+=t.segments[i].duration)););return Math.max(0,i)}function Qu(t,i,n){if(!t||!t.segments)return null;if(t.endList)return Ku(t);if(i===null)return null;i=i||0;var e=n?Yu(t):t.segments.length;return Xu(t,t.mediaSequence+e,i)}function Ju(t){return t-Math.floor(t)==0}function Zu(t,i){if(Ju(i))return i+.1*t;for(var n=i.toString().split(".")[1].length,e=1;e<=n;e++){var r=Math.pow(10,e),a=i*r;if(Ju(a)||e===n)return(a+t)/r}}function tl(t){return t.excludeUntil&&t.excludeUntil>Date.now()}function Ca(t){return t.excludeUntil&&t.excludeUntil===1/0}function Bn(t){var i=tl(t);return!t.disabled&&!i}function el(t,i){return i.attributes&&i.attributes[t]}function Ea(t,i){if(t.playlists.length===1)return!0;var n=i.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){return!!Bn(e)&&(e.attributes.BANDWIDTH||0)<n}).length===0}function il(){return function t(i,n){i=op({timeout:45e3},i);var e=t.beforeRequest||w.Hls.xhr.beforeRequest;if(e&&typeof e=="function"){var r=e(i);r&&(i=r)}var a=sp(i,function(o,u){var c=a.response;!o&&c&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=c.byteLength||c.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),u.headers&&(a.responseHeaders=u.headers),o&&o.code==="ETIMEDOUT"&&(a.timedout=!0),o||a.aborted||u.statusCode===200||u.statusCode===206||u.statusCode===0||(o=new Error("XHR Failed with a response of: "+(a&&(c||a.responseText)))),n(o,a)}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=i.uri,a.requestTime=Date.now(),a}}function wa(t){var i={};return t.byterange&&(i.Range=function(n){var e;return e=n.offset+n.length-1,"bytes="+n.offset+"-"+e}(t.byterange)),i}function tp(t,i){var n=t.toString(16);return"00".substring(0,2-n.length)+n+(i%2?" ":"")}function ep(t){return 32<=t&&t<126?String.fromCharCode(t):"."}function nl(t){var i={};return Object.keys(t).forEach(function(n){var e=t[n];ArrayBuffer.isView(e)?i[n]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:i[n]=e}),i}function jn(t){var i=t.byterange||{length:1/0,offset:0};return[i.length,i.offset,t.resolvedUri].join(",")}function rl(t){return t.resolvedUri}function al(t){for(var i=Array.prototype.slice.call(t),n="",e=0;e<i.length/16;e++)n+=i.slice(16*e,16*e+16).map(tp).join("")+" "+i.slice(16*e,16*e+16).map(ep).join("")+`
`;return n}function ip(t){var i=t.playlist,n=t.time,e=n===void 0?void 0:n,r=t.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(u,c){if(!c||!c.segments||c.segments.length===0)return null;for(var d=0,h=void 0,f=0;f<c.segments.length&&!(u<=(d=(h=c.segments[f]).videoTimingInfo?h.videoTimingInfo.transmuxedPresentationEnd:d+h.duration));f++);var y=c.segments[c.segments.length-1];if(y.videoTimingInfo&&y.videoTimingInfo.transmuxedPresentationEnd<u)return null;if(d<u){if(u>d+.25*y.duration)return null;h=y}return{segment:h,estimatedStart:h.videoTimingInfo?h.videoTimingInfo.transmuxedPresentationStart:d-h.duration,type:h.videoTimingInfo?"accurate":"estimate"}}(e,i);if(!a)return r({message:"valid programTime was not found"});if(a.type==="estimate")return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:e},o=function(u,c){if(!c.dateTimeObject)return null;var d=c.videoTimingInfo.transmuxerPrependedSeconds,h=u-(c.videoTimingInfo.transmuxedPresentationStart+d);return new Date(c.dateTimeObject.getTime()+1e3*h)}(e,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)}function sl(t){var i=t.programTime,n=t.playlist,e=t.retryCount,r=e===void 0?2:e,a=t.seekTo,s=t.pauseAfterSeek,o=s===void 0||s,u=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof i=="undefined"||!n||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(b){if(!b.segments||b.segments.length===0)return!1;for(var _=0;_<b.segments.length;_++)if(!b.segments[_].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var d=function(b,_){var E=void 0;try{E=new Date(b)}catch(B){return null}if(!_||!_.segments||_.segments.length===0)return null;var S=_.segments[0];if(E<S.dateTimeObject)return null;for(var C=0;C<_.segments.length-1&&(S=_.segments[C],!(E<_.segments[C+1].dateTimeObject));C++);var L=_.segments[_.segments.length-1],D=L.dateTimeObject,F=L.videoTimingInfo?function(B){return B.transmuxedPresentationEnd-B.transmuxedPresentationStart-B.transmuxerPrependedSeconds}(L.videoTimingInfo):L.duration+.25*L.duration;return new Date(D.getTime()+1e3*F)<E?null:(D<E&&(S=L),{segment:S,estimatedStart:S.videoTimingInfo?S.videoTimingInfo.transmuxedPresentationStart:Bt.duration(_,_.mediaSequence+_.segments.indexOf(S)),type:S.videoTimingInfo?"accurate":"estimate"})}(i,n);if(!d)return c({message:i+" was not found in the stream"});var h=d.segment,f=function(b,_){var E=void 0,S=void 0;try{E=new Date(b),S=new Date(_)}catch(L){}var C=E.getTime();return(S.getTime()-C)/1e3}(h.dateTimeObject,i);if(d.type==="estimate")return r===0?c({message:i+" is not buffered yet. Try again"}):(a(d.estimatedStart+f),void u.one("seeked",function(){sl({programTime:i,playlist:n,retryCount:r-1,seekTo:a,pauseAfterSeek:o,tech:u,callback:c})}));var y=h.start+f;u.one("seeked",function(){return c(null,u.currentTime())}),o&&u.pause(),a(y)}function ol(t,i){var n=[],e=void 0;if(t&&t.length)for(e=0;e<t.length;e++)i(t.start(e),t.end(e))&&n.push([t.start(e),t.end(e)]);return w.createTimeRanges(n)}function ul(t,i){return ol(t,function(n,e){return n-.1<=i&&i<=e+.1})}function ll(t,i){return ol(t,function(n){return i<=n-1/30})}function Aa(t){var i=[];if(!t||!t.length)return"";for(var n=0;n<t.length;n++)i.push(t.start(n)+" => "+t.end(n));return i.join(", ")}function cl(t){for(var i=[],n=0;n<t.length;n++)i.push({start:t.start(n),end:t.end(n)});return i}function oi(t,i,n){var e=void 0,r=void 0;if(n&&n.cues)for(e=n.cues.length;e--;)(r=n.cues[e]).startTime<=i&&r.endTime>=t&&n.removeCue(r)}function hl(t){return isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}function np(t,i,n){var e=k.WebKitDataCue||k.VTTCue;if(i&&i.forEach(function(d){var h=d.stream;this.inbandTextTracks_[h].addCue(new e(d.startTime+this.timestampOffset,d.endTime+this.timestampOffset,d.text))},t),n){var r=hl(t.mediaSource_.duration);if(n.forEach(function(d){var h=d.cueTime+this.timestampOffset;!(typeof h!="number"||k.isNaN(h)||h<0)&&h<1/0&&d.frames.forEach(function(f){var y=new e(h,h,f.value||f.url||f.data||"");y.frame=f,y.value=f,function(b){Object.defineProperties(b.frame,{id:{get:function(){return w.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),b.value.key}},value:{get:function(){return w.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),b.value.data}},privateData:{get:function(){return w.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),b.value.data}}})}(y),this.metadataTrack_.addCue(y)},this)},t),t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var a=t.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce(function(d,h){var f=d[h.startTime]||[];return f.push(h),d[h.startTime]=f,d},{}),c=Object.keys(u).sort(function(d,h){return Number(d)-Number(h)});c.forEach(function(d,h){var f=u[d],y=Number(c[h+1])||r;f.forEach(function(b){b.endTime=y})})}}}var dl=w.createTimeRange,rp=Zu.bind(null,1),ap=Zu.bind(null,-1),Bt={duration:Ku,seekable:function(t,i){var n=i||0,e=Qu(t,i,!0);return e===null?dl():dl(n,e)},safeLiveIndex:Yu,getMediaInfoForTime:function(t,i,n,e){var r=void 0,a=void 0,s=t.segments.length,o=i-e;if(o<0){if(0<n){for(r=n-1;0<=r;r--)if(a=t.segments[r],0<(o+=ap(a.duration)))return{mediaIndex:r,startTime:e-$i(t,n,r)}}return{mediaIndex:0,startTime:i}}if(n<0){for(r=n;r<0;r++)if((o-=t.targetDuration)<0)return{mediaIndex:0,startTime:i};n=0}for(r=n;r<s;r++)if(a=t.segments[r],(o-=rp(a.duration))<0)return{mediaIndex:r,startTime:e+$i(t,n,r)};return{mediaIndex:s-1,startTime:i}},isEnabled:Bn,isDisabled:function(t){return t.disabled},isBlacklisted:tl,isIncompatible:Ca,playlistEnd:Qu,isAes:function(t){for(var i=0;i<t.segments.length;i++)if(t.segments[i].key)return!0;return!1},isFmp4:function(t){for(var i=0;i<t.segments.length;i++)if(t.segments[i].map)return!0;return!1},hasAttribute:el,estimateSegmentRequestTime:function(t,i,n,e){var r=3<arguments.length&&e!==void 0?e:0;return el("BANDWIDTH",n)?(t*n.attributes.BANDWIDTH-8*r)/i:NaN},isLowestEnabledRendition:Ea},sp=w.xhr,op=w.mergeOptions,up=Object.freeze({createTransferableMessage:nl,initSegmentId:jn,segmentKeyId:rl,hexDump:al,tagDump:function(t){var i=t.bytes;return al(i)},textRanges:function(t){var i,n,e="",r=void 0;for(r=0;r<t.length;r++)e+=(n=r,(i=t).start(n)+"-"+i.end(n)+" ");return e}}),Be=typeof window!="undefined"?window:{},Pa=typeof Symbol=="undefined"?"__target":Symbol(),lp="application/javascript",cp=Be.BlobBuilder||Be.WebKitBlobBuilder||Be.MozBlobBuilder||Be.MSBlobBuilder,ui=Be.URL||Be.webkitURL||ui&&ui.msURL,li=Be.Worker;function pl(t,i){return function(n){var e=this;if(!i)return new li(t);if(li&&!n){var r=gl(i.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Pa]=new li(r),function(s,o){if(!(!s||!o)){var u=s.terminate;s.objURL=o,s.terminate=function(){s.objURL&&ui.revokeObjectURL(s.objURL),u.call(s)}}}(this[Pa],r),this[Pa]}var a={postMessage:function(s){e.onmessage&&setTimeout(function(){e.onmessage({data:s,target:a})})}};i.call(a),this.postMessage=function(s){setTimeout(function(){a.onmessage({data:s,target:e})})},this.isThisThread=!0}}if(li){var Ia,fl=gl("self.onmessage = function () {}"),ml=new Uint8Array(1);try{(Ia=new li(fl)).postMessage(ml,[ml.buffer])}catch(t){li=null}finally{ui.revokeObjectURL(fl),Ia&&Ia.terminate()}}function gl(t){try{return ui.createObjectURL(new Blob([t],{type:lp}))}catch(n){var i=new cp;return i.append(t),ui.createObjectURL(i.getBlob(type))}}function yl(t){return t.map(function(i){return i.replace(/avc1\.(\d+)\.(\d+)/i,function(n,e,r){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(r).toString(16)).slice(-2)})})}function Gi(t){var i,n=0<arguments.length&&t!==void 0?t:"",e={codecCount:0};return e.codecCount=n.split(",").length,e.codecCount=e.codecCount||2,(i=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(n))&&(e.videoCodec=i[2],e.videoObjectTypeIndicator=i[3]),e.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(n),e.audioProfile=e.audioProfile&&e.audioProfile[2],e}function La(t,i,n){return t+"/"+i+'; codecs="'+n.filter(function(e){return!!e}).join(", ")+'"'}function hp(t,i){var n=function(y){return y.segments&&y.segments.length&&y.segments[0].map?"mp4":"mp2t"}(i),e=function(y){var b=y.attributes||{};return b.CODECS?Gi(b.CODECS):bl}(i),r=i.attributes||{},a=!0,s=!1;if(!i)return[];if(t.mediaGroups.AUDIO&&r.AUDIO){var o=t.mediaGroups.AUDIO[r.AUDIO];if(o){for(var u in a=!(s=!0),o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}}s&&!e.audioProfile&&(a||(e.audioProfile=function(y,b){if(!y.mediaGroups.AUDIO||!b)return null;var _=y.mediaGroups.AUDIO[b];if(!_)return null;for(var E in _){var S=_[E];if(S.default&&S.playlists)return Gi(S.playlists[0].attributes.CODECS).audioProfile}return null}(t,r.AUDIO)),e.audioProfile||(w.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),e.audioProfile=bl.audioProfile));var c={};e.videoCodec&&(c.video=""+e.videoCodec+e.videoObjectTypeIndicator),e.audioProfile&&(c.audio="mp4a.40."+e.audioProfile);var d=La("audio",n,[c.audio]),h=La("video",n,[c.video]),f=La("video",n,[c.video,c.audio]);return s?!a&&c.video?[h,d]:a||c.video?[f,d]:[d,d]:c.video?[f]:[d]}function vl(t){return/mp4a\.\d+.\d+/i.test(t)}function _l(t){return/avc1\.[\da-f]+/i.test(t)}var dp=new pl("./transmuxer-worker.worker.js",function(t,i){var n=this;(function(){function e(){this.init=function(){var l={};this.on=function(p,m){l[p]||(l[p]=[]),l[p]=l[p].concat(m)},this.off=function(p,m){var g;return!!l[p]&&(g=l[p].indexOf(m),l[p]=l[p].slice(),l[p].splice(g,1),-1<g)},this.trigger=function(p){var m,g,v,T;if(m=l[p])if(arguments.length===2)for(v=m.length,g=0;g<v;++g)m[g].call(this,arguments[1]);else{for(T=[],g=arguments.length,g=1;g<arguments.length;++g)T.push(arguments[g]);for(v=m.length,g=0;g<v;++g)m[g].apply(this,T)}},this.dispose=function(){l={}}}}e.prototype.pipe=function(l){return this.on("data",function(p){l.push(p)}),this.on("done",function(p){l.flush(p)}),this.on("partialdone",function(p){l.partialFlush(p)}),this.on("endedtimeline",function(p){l.endTimeline(p)}),this.on("reset",function(p){l.reset(p)}),l},e.prototype.push=function(l){this.trigger("data",l)},e.prototype.flush=function(l){this.trigger("done",l)},e.prototype.partialFlush=function(l){this.trigger("partialdone",l)},e.prototype.endTimeline=function(l){this.trigger("endedtimeline",l)},e.prototype.reset=function(l){this.trigger("reset",l)};var r,a,s,o,u,c,d,h,f,y,b,_,E,S,C,L,D,F,B,H,V,R,W,et,tt,Tt,St,qt,Y,ot,ut,mt,kt,rt,se,Ut,Fe,He,$l,Ha,Rt=e,Gl=Math.pow(2,32)-1;(function(){var l;if(R={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:[]},typeof Uint8Array!="undefined"){for(l in R)R.hasOwnProperty(l)&&(R[l]=[l.charCodeAt(0),l.charCodeAt(1),l.charCodeAt(2),l.charCodeAt(3)]);W=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),tt=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),et=new Uint8Array([0,0,0,1]),Tt=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]),St=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]),qt={video:Tt,audio:St},ut=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ot=new Uint8Array([0,0,0,0,0,0,0,0]),mt=new Uint8Array([0,0,0,0,0,0,0,0]),kt=mt,rt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),se=mt,Y=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),r=function(l){var p,m,g=[],v=0;for(p=1;p<arguments.length;p++)g.push(arguments[p]);for(p=g.length;p--;)v+=g[p].byteLength;for(m=new Uint8Array(v+8),new DataView(m.buffer,m.byteOffset,m.byteLength).setUint32(0,m.byteLength),m.set(l,4),p=0,v=8;p<g.length;p++)m.set(g[p],v),v+=g[p].byteLength;return m},a=function(){return r(R.dinf,r(R.dref,ut))},s=function(l){return r(R.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,l.audioobjecttype<<3|l.samplingfrequencyindex>>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},C=function(l){return r(R.hdlr,qt[l])},S=function(l){var p=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,255&l.duration,85,196,0,0]);return l.samplerate&&(p[12]=l.samplerate>>>24&255,p[13]=l.samplerate>>>16&255,p[14]=l.samplerate>>>8&255,p[15]=255&l.samplerate),r(R.mdhd,p)},E=function(l){return r(R.mdia,S(l),C(l.type),c(l))},u=function(l){return r(R.mfhd,new Uint8Array([0,0,0,0,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l]))},c=function(l){return r(R.minf,l.type==="video"?r(R.vmhd,Y):r(R.smhd,ot),a(),D(l))},d=function(l,p){for(var m=[],g=p.length;g--;)m[g]=B(p[g]);return r.apply(null,[R.moof,u(l)].concat(m))},h=function(l){for(var p=l.length,m=[];p--;)m[p]=b(l[p]);return r.apply(null,[R.moov,y(4294967295)].concat(m).concat(f(l)))},f=function(l){for(var p=l.length,m=[];p--;)m[p]=H(l[p]);return r.apply(null,[R.mvex].concat(m))},y=function(l){var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,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(R.mvhd,p)},L=function(l){var p,m,g=l.samples||[],v=new Uint8Array(4+g.length);for(m=0;m<g.length;m++)p=g[m].flags,v[m+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return r(R.sdtp,v)},D=function(l){return r(R.stbl,F(l),r(R.stts,se),r(R.stsc,kt),r(R.stsz,rt),r(R.stco,mt))},F=function(l){return r(R.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),l.type==="video"?Ut(l):Fe(l))},Ut=function(l){var p,m,g=l.sps||[],v=l.pps||[],T=[],A=[];for(p=0;p<g.length;p++)T.push((65280&g[p].byteLength)>>>8),T.push(255&g[p].byteLength),T=T.concat(Array.prototype.slice.call(g[p]));for(p=0;p<v.length;p++)A.push((65280&v[p].byteLength)>>>8),A.push(255&v[p].byteLength),A=A.concat(Array.prototype.slice.call(v[p]));if(m=[R.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&l.width)>>8,255&l.width,(65280&l.height)>>8,255&l.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(R.avcC,new Uint8Array([1,l.profileIdc,l.profileCompatibility,l.levelIdc,255].concat([g.length],T,[v.length],A))),r(R.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],l.sarRatio){var P=l.sarRatio[0],I=l.sarRatio[1];m.push(r(R.pasp,new Uint8Array([(4278190080&P)>>24,(16711680&P)>>16,(65280&P)>>8,255&P,(4278190080&I)>>24,(16711680&I)>>16,(65280&I)>>8,255&I])))}return r.apply(null,m)},Fe=function(l){return r(R.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&l.channelcount)>>8,255&l.channelcount,(65280&l.samplesize)>>8,255&l.samplesize,0,0,0,0,(65280&l.samplerate)>>8,255&l.samplerate,0,0]),s(l))},_=function(l){var p=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,0,(4278190080&l.duration)>>24,(16711680&l.duration)>>16,(65280&l.duration)>>8,255&l.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&l.width)>>8,255&l.width,0,0,(65280&l.height)>>8,255&l.height,0,0]);return r(R.tkhd,p)},B=function(l){var p,m,g,v,T,A;return p=r(R.tfhd,new Uint8Array([0,0,0,58,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),T=Math.floor(l.baseMediaDecodeTime/(1+Gl)),A=Math.floor(l.baseMediaDecodeTime%(1+Gl)),m=r(R.tfdt,new Uint8Array([1,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,255&T,A>>>24&255,A>>>16&255,A>>>8&255,255&A])),l.type==="audio"?(g=V(l,92),r(R.traf,p,m,g)):(v=L(l),g=V(l,v.length+92),r(R.traf,p,m,g,v))},b=function(l){return l.duration=l.duration||4294967295,r(R.trak,_(l),E(l))},H=function(l){var p=new Uint8Array([0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(p[p.length-1]=0),r(R.trex,p)},Ha=function(l,p){var m=0,g=0,v=0,T=0;return l.length&&(l[0].duration!==void 0&&(m=1),l[0].size!==void 0&&(g=2),l[0].flags!==void 0&&(v=4),l[0].compositionTimeOffset!==void 0&&(T=8)),[0,0,m|g|v|T,1,(4278190080&l.length)>>>24,(16711680&l.length)>>>16,(65280&l.length)>>>8,255&l.length,(4278190080&p)>>>24,(16711680&p)>>>16,(65280&p)>>>8,255&p]},$l=function(l,p){var m,g,v,T;for(p+=20+16*(g=l.samples||[]).length,m=Ha(g,p),T=0;T<g.length;T++)v=g[T],m=m.concat([(4278190080&v.duration)>>>24,(16711680&v.duration)>>>16,(65280&v.duration)>>>8,255&v.duration,(4278190080&v.size)>>>24,(16711680&v.size)>>>16,(65280&v.size)>>>8,255&v.size,v.flags.isLeading<<2|v.flags.dependsOn,v.flags.isDependedOn<<6|v.flags.hasRedundancy<<4|v.flags.paddingValue<<1|v.flags.isNonSyncSample,61440&v.flags.degradationPriority,15&v.flags.degradationPriority,(4278190080&v.compositionTimeOffset)>>>24,(16711680&v.compositionTimeOffset)>>>16,(65280&v.compositionTimeOffset)>>>8,255&v.compositionTimeOffset]);return r(R.trun,new Uint8Array(m))},He=function(l,p){var m,g,v,T;for(p+=20+8*(g=l.samples||[]).length,m=Ha(g,p),T=0;T<g.length;T++)v=g[T],m=m.concat([(4278190080&v.duration)>>>24,(16711680&v.duration)>>>16,(65280&v.duration)>>>8,255&v.duration,(4278190080&v.size)>>>24,(16711680&v.size)>>>16,(65280&v.size)>>>8,255&v.size]);return r(R.trun,new Uint8Array(m))},V=function(l,p){return l.type==="audio"?He(l,p):$l(l,p)},o=function(){return r(R.ftyp,W,et,W,tt)};function xp(l,p){var m={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return m.dataOffset=p,m.compositionTimeOffset=l.pts-l.dts,m.duration=l.duration,m.size=4*l.length,m.size+=l.byteLength,l.keyFrame&&(m.flags.dependsOn=2,m.flags.isNonSyncSample=0),m}function nt(l){for(var p=[];l--;)p.push(0);return p}function Jt(){Jt.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new ct(0,0),new ct(0,1),new ct(1,0),new ct(1,1)],this.reset(),this.ccStreams_.forEach(function(l){l.on("data",this.trigger.bind(this,"data")),l.on("partialdone",this.trigger.bind(this,"partialdone")),l.on("done",this.trigger.bind(this,"done"))},this)}var Va,Xl,Kl,qa,Yl,Ql=function(l){return r(R.mdat,l)},Jl=d,Dp=function(l){var p,m=o(),g=h(l);return(p=new Uint8Array(m.byteLength+g.byteLength)).set(m),p.set(g,m.byteLength),p},Up=function(l){var p,m,g=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,p=g.byteLength=0;p<l.length;p++)(m=l[p]).nalUnitType==="access_unit_delimiter_rbsp"?(g.length&&(g.duration=m.dts-g.dts,v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g)),(g=[m]).byteLength=m.data.byteLength,g.pts=m.pts,g.dts=m.dts):(m.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(g.keyFrame=!0),g.duration=m.dts-g.dts,g.byteLength+=m.data.byteLength,g.push(m));return v.length&&(!g.duration||g.duration<=0)&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g),v},Rp=function(l){var p,m,g=[],v=[];for(g.byteLength=0,g.nalCount=0,g.duration=0,g.pts=l[0].pts,g.dts=l[0].dts,v.byteLength=0,v.nalCount=0,v.duration=0,v.pts=l[0].pts,v.dts=l[0].dts,p=0;p<l.length;p++)(m=l[p]).keyFrame?(g.length&&(v.push(g),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration),(g=[m]).nalCount=m.length,g.byteLength=m.byteLength,g.pts=m.pts,g.dts=m.dts,g.duration=m.duration):(g.duration+=m.duration,g.nalCount+=m.length,g.byteLength+=m.byteLength,g.push(m));return v.length&&g.duration<=0&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration,v.push(g),v},Mp=function(l){var p;return!l[0][0].keyFrame&&1<l.length&&(p=l.shift(),l.byteLength-=p.byteLength,l.nalCount-=p.nalCount,l[0][0].dts=p.dts,l[0][0].pts=p.pts,l[0][0].duration+=p.duration),l},Np=function(l,p){var m,g,v,T,A,P=p||0,I=[];for(m=0;m<l.length;m++)for(T=l[m],g=0;g<T.length;g++)A=T[g],P+=(v=xp(A,P)).size,I.push(v);return I},Bp=function(l){var p,m,g,v,T,A,P=0,I=l.byteLength,O=l.nalCount,N=new Uint8Array(I+4*O),$=new DataView(N.buffer);for(p=0;p<l.length;p++)for(v=l[p],m=0;m<v.length;m++)for(T=v[m],g=0;g<T.length;g++)A=T[g],$.setUint32(P,A.data.byteLength),P+=4,N.set(A.data,P),P+=A.data.byteLength;return N},be=[33,16,5,32,164,27],Wa=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],jp={96e3:[be,[227,64],nt(154),[56]],88200:[be,[231],nt(170),[56]],64e3:[be,[248,192],nt(240),[56]],48e3:[be,[255,192],nt(268),[55,148,128],nt(54),[112]],44100:[be,[255,192],nt(268),[55,163,128],nt(84),[112]],32e3:[be,[255,192],nt(268),[55,234],nt(226),[112]],24e3:[be,[255,192],nt(268),[55,255,128],nt(268),[111,112],nt(126),[224]],16e3:[be,[255,192],nt(268),[55,255,128],nt(268),[111,255],nt(269),[223,108],nt(195),[1,192]],12e3:[Wa,nt(268),[3,127,248],nt(268),[6,255,240],nt(268),[13,255,224],nt(268),[27,253,128],nt(259),[56]],11025:[Wa,nt(268),[3,127,248],nt(268),[6,255,240],nt(268),[13,255,224],nt(268),[27,255,192],nt(268),[55,175,128],nt(108),[112]],8e3:[Wa,nt(268),[3,121,16],nt(47),[7]]},Fp=(Va=jp,Object.keys(Va).reduce(function(l,p){return l[p]=new Uint8Array(Va[p].reduce(function(m,g){return m.concat(g)},[])),l},{})),Qi=9e4,Hp=(Xl=function(l){return 9e4*l},Kl=function(l,p){return l*p},qa=function(l){return l/9e4},Yl=function(l,p){return l/p},function(l,p){return Xl(Yl(l,p))}),Vp=function(l,p){return Kl(qa(l),p)},za=function(l,p,m){return qa(m?l:l-p)},qp=function(l,p,m,g){var v,T,A,P,I,O=0,N=0,$=0;if(p.length&&(v=Hp(l.baseMediaDecodeTime,l.samplerate),T=Math.ceil(Qi/(l.samplerate/1024)),m&&g&&(O=v-Math.max(m,g),$=(N=Math.floor(O/T))*T),!(N<1||Qi/2<$))){for(A=(A=Fp[l.samplerate])||p[0].data,P=0;P<N;P++)I=p[0],p.splice(0,0,{data:A,dts:I.dts-T,pts:I.pts-T});l.baseMediaDecodeTime-=Math.floor(Vp($,l.samplerate))}},Wp=function(l,p,m){return p.minSegmentDts>=m?l:(p.minSegmentDts=1/0,l.filter(function(g){return g.dts>=m&&(p.minSegmentDts=Math.min(p.minSegmentDts,g.dts),p.minSegmentPts=p.minSegmentDts,!0)}))},zp=function(l){var p,m,g=[];for(p=0;p<l.length;p++)m=l[p],g.push({size:m.data.byteLength,duration:1024});return g},$p=function(l){var p,m,g=0,v=new Uint8Array(function(T){var A,P=0;for(A=0;A<T.length;A++)P+=T[A].data.byteLength;return P}(l));for(p=0;p<l.length;p++)m=l[p],v.set(m.data,g),g+=m.data.byteLength;return v},Gp=Qi,yi=function(l){delete l.minSegmentDts,delete l.maxSegmentDts,delete l.minSegmentPts,delete l.maxSegmentPts},Zl=function(l,p){var m,g=l.minSegmentDts;return p||(g-=l.timelineStartInfo.dts),m=l.timelineStartInfo.baseMediaDecodeTime,m+=g,m=Math.max(0,m),l.type==="audio"&&(m*=l.samplerate/Gp,m=Math.floor(m)),m},$a=function(l,p){typeof p.pts=="number"&&(l.timelineStartInfo.pts===void 0&&(l.timelineStartInfo.pts=p.pts),l.minSegmentPts===void 0?l.minSegmentPts=p.pts:l.minSegmentPts=Math.min(l.minSegmentPts,p.pts),l.maxSegmentPts===void 0?l.maxSegmentPts=p.pts:l.maxSegmentPts=Math.max(l.maxSegmentPts,p.pts)),typeof p.dts=="number"&&(l.timelineStartInfo.dts===void 0&&(l.timelineStartInfo.dts=p.dts),l.minSegmentDts===void 0?l.minSegmentDts=p.dts:l.minSegmentDts=Math.min(l.minSegmentDts,p.dts),l.maxSegmentDts===void 0?l.maxSegmentDts=p.dts:l.maxSegmentDts=Math.max(l.maxSegmentDts,p.dts))},Xp=function(l){for(var p=0,m={payloadType:-1,payloadSize:0},g=0,v=0;p<l.byteLength&&l[p]!==128;){for(;l[p]===255;)g+=255,p++;for(g+=l[p++];l[p]===255;)v+=255,p++;if(v+=l[p++],!m.payload&&g===4){m.payloadType=g,m.payloadSize=v,m.payload=l.subarray(p,p+v);break}p+=v,v=g=0}return m},Kp=function(l){return l.payload[0]!==181||(l.payload[1]<<8|l.payload[2])!=49||String.fromCharCode(l.payload[3],l.payload[4],l.payload[5],l.payload[6])!=="GA94"||l.payload[7]!==3?null:l.payload.subarray(8,l.payload.length-1)},Yp=function(l,p){var m,g,v,T,A=[];if(!(64&p[0]))return A;for(g=31&p[0],m=0;m<g;m++)T={type:3&p[2+(v=3*m)],pts:l},4&p[2+v]&&(T.ccData=p[3+v]<<8|p[4+v],A.push(T));return A},Qp=4;(Jt.prototype=new Rt).push=function(l){var p,m,g;if(l.nalUnitType==="sei_rbsp"&&(p=Xp(l.escapedRBSP)).payloadType===Qp&&(m=Kp(p)))if(l.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(l.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));g=Yp(l.pts,m),this.captionPackets_=this.captionPackets_.concat(g),this.latestDts_!==l.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=l.dts}},Jt.prototype.flushCCStreams=function(l){this.ccStreams_.forEach(function(p){return l==="flush"?p.flush():p.partialFlush()},this)},Jt.prototype.flushStream=function(l){this.captionPackets_.length&&(this.captionPackets_.forEach(function(p,m){p.presortIndex=m}),this.captionPackets_.sort(function(p,m){return p.pts===m.pts?p.presortIndex-m.presortIndex:p.pts-m.pts}),this.captionPackets_.forEach(function(p){p.type<2&&this.dispatchCea608Packet(p)},this),this.captionPackets_.length=0),this.flushCCStreams(l)},Jt.prototype.flush=function(){return this.flushStream("flush")},Jt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Jt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(l){l.reset()})},Jt.prototype.dispatchCea608Packet=function(l){this.setsTextOrXDSActive(l)?this.activeCea608Channel_[l.type]=null:this.setsChannel1Active(l)?this.activeCea608Channel_[l.type]=0:this.setsChannel2Active(l)&&(this.activeCea608Channel_[l.type]=1),this.activeCea608Channel_[l.type]!==null&&this.ccStreams_[(l.type<<1)+this.activeCea608Channel_[l.type]].push(l)},Jt.prototype.setsChannel1Active=function(l){return(30720&l.ccData)==4096},Jt.prototype.setsChannel2Active=function(l){return(30720&l.ccData)==6144},Jt.prototype.setsTextOrXDSActive=function(l){return(28928&l.ccData)==256||(30974&l.ccData)==4138||(30974&l.ccData)==6186};function qn(l){return l===null?"":(l=Jp[l]||l,String.fromCharCode(l))}function Ve(){for(var l=[],p=15;p--;)l.push("");return l}var Jp={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},Zp=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ct=function l(p,m){l.prototype.init.call(this),this.field_=p||0,this.dataChannel_=m||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(g){var v,T,A,P,I;if((v=32639&g.ccData)!==this.lastControlCode_){if((61440&v)==4096?this.lastControlCode_=v:v!==this.PADDING_&&(this.lastControlCode_=null),A=v>>>8,P=255&v,v!==this.PADDING_)if(v===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(v===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(g.pts),this.flushDisplayed(g.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=g.pts;else if(v===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(g.pts);else if(v===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(g.pts);else if(v===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(g.pts);else if(v===this.CARRIAGE_RETURN_)this.clearFormatting(g.pts),this.flushDisplayed(g.pts),this.shiftRowsUp_(),this.startPts_=g.pts;else if(v===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(v===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(g.pts),this.displayed_=Ve();else if(v===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ve();else if(v===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(g.pts),this.displayed_=Ve()),this.mode_="paintOn",this.startPts_=g.pts;else if(this.isSpecialCharacter(A,P))I=qn((A=(3&A)<<8)|P),this[this.mode_](g.pts,I),this.column_++;else if(this.isExtCharacter(A,P))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=qn((A=(3&A)<<8)|P),this[this.mode_](g.pts,I),this.column_++;else if(this.isMidRowCode(A,P))this.clearFormatting(g.pts),this[this.mode_](g.pts," "),this.column_++,(14&P)==14&&this.addFormatting(g.pts,["i"]),(1&P)==1&&this.addFormatting(g.pts,["u"]);else if(this.isOffsetControlCode(A,P))this.column_+=3&P;else if(this.isPAC(A,P)){var O=Zp.indexOf(7968&v);this.mode_==="rollUp"&&(O-this.rollUpRows_+1<0&&(O=this.rollUpRows_-1),this.setRollUp(g.pts,O)),O!==this.row_&&(this.clearFormatting(g.pts),this.row_=O),1&P&&this.formatting_.indexOf("u")===-1&&this.addFormatting(g.pts,["u"]),(16&v)==16&&(this.column_=4*((14&v)>>1)),this.isColorPAC(P)&&(14&P)==14&&this.addFormatting(g.pts,["i"])}else this.isNormalChar(A)&&(P===0&&(P=null),I=qn(A),I+=qn(P),this[this.mode_](g.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};ct.prototype=new Rt,ct.prototype.flushDisplayed=function(l){var p=this.displayed_.map(function(m){try{return m.trim()}catch(g){return""}}).join(`
`).replace(/^\n+|\n+$/g,"");p.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,text:p,stream:this.name_})},ct.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ve(),this.nonDisplayed_=Ve(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},ct.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=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_},ct.prototype.isSpecialCharacter=function(l,p){return l===this.EXT_&&48<=p&&p<=63},ct.prototype.isExtCharacter=function(l,p){return(l===this.EXT_+1||l===this.EXT_+2)&&32<=p&&p<=63},ct.prototype.isMidRowCode=function(l,p){return l===this.EXT_&&32<=p&&p<=47},ct.prototype.isOffsetControlCode=function(l,p){return l===this.OFFSET_&&33<=p&&p<=35},ct.prototype.isPAC=function(l,p){return l>=this.BASE_&&l<this.BASE_+8&&64<=p&&p<=127},ct.prototype.isColorPAC=function(l){return 64<=l&&l<=79||96<=l&&l<=127},ct.prototype.isNormalChar=function(l){return 32<=l&&l<=127},ct.prototype.setRollUp=function(l,p){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=Ve(),this.displayed_=Ve()),p!==void 0&&p!==this.row_)for(var m=0;m<this.rollUpRows_;m++)this.displayed_[p-m]=this.displayed_[this.row_-m],this.displayed_[this.row_-m]="";p===void 0&&(p=this.row_),this.topRow_=p-this.rollUpRows_+1},ct.prototype.addFormatting=function(l,p){this.formatting_=this.formatting_.concat(p);var m=p.reduce(function(g,v){return g+"<"+v+">"},"");this[this.mode_](l,m)},ct.prototype.clearFormatting=function(l){if(this.formatting_.length){var p=this.formatting_.reverse().reduce(function(m,g){return m+"</"+g+">"},"");this.formatting_=[],this[this.mode_](l,p)}},ct.prototype.popOn=function(l,p){var m=this.nonDisplayed_[this.row_];m+=p,this.nonDisplayed_[this.row_]=m},ct.prototype.rollUp=function(l,p){var m=this.displayed_[this.row_];m+=p,this.displayed_[this.row_]=m},ct.prototype.shiftRowsUp_=function(){var l;for(l=0;l<this.topRow_;l++)this.displayed_[l]="";for(l=this.row_+1;l<15;l++)this.displayed_[l]="";for(l=this.topRow_;l<this.row_;l++)this.displayed_[l]=this.displayed_[l+1];this.displayed_[this.row_]=""},ct.prototype.paintOn=function(l,p){var m=this.displayed_[this.row_];m+=p,this.displayed_[this.row_]=m};function tc(l,p){var m=1;for(p<l&&(m=-1);4294967296<Math.abs(p-l);)l+=8589934592*m;return l}function Ga(l){var p,m;Ga.prototype.init.call(this),this.type_=l||"shared",this.push=function(g){this.type_!=="shared"&&g.type!==this.type_||(m===void 0&&(m=g.dts),g.dts=tc(g.dts,m),g.pts=tc(g.pts,m),p=g.dts,this.trigger("data",g))},this.flush=function(){m=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){p=m=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}}var ec={CaptionStream:Jt,Cea608Stream:ct},Wt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};Ga.prototype=new Rt;function ic(l,p,m){var g,v="";for(g=p;g<m;g++)v+="%"+("00"+l[g].toString(16)).slice(-2);return v}function Wn(l,p,m){return decodeURIComponent(ic(l,p,m))}function zn(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}var Xa,tf=Ga,nc={TXXX:function(l){var p;if(l.data[0]===3){for(p=1;p<l.data.length;p++)if(l.data[p]===0){l.description=Wn(l.data,1,p),l.value=Wn(l.data,p+1,l.data.length).replace(/\0*$/,"");break}l.data=l.value}},WXXX:function(l){var p;if(l.data[0]===3){for(p=1;p<l.data.length;p++)if(l.data[p]===0){l.description=Wn(l.data,1,p),l.url=Wn(l.data,p+1,l.data.length);break}}},PRIV:function(l){var p,m;for(p=0;p<l.data.length;p++)if(l.data[p]===0){l.owner=(m=l.data,unescape(ic(m,0,p)));break}l.privateData=l.data.subarray(p+1),l.data=l.privateData}};(Xa=function(l){var p,m={debug:!(!l||!l.debug),descriptor:l&&l.descriptor},g=0,v=[],T=0;if(Xa.prototype.init.call(this),this.dispatchType=Wt.METADATA_STREAM_TYPE.toString(16),m.descriptor)for(p=0;p<m.descriptor.length;p++)this.dispatchType+=("00"+m.descriptor[p].toString(16)).slice(-2);this.push=function(A){var P,I,O,N,$;if(A.type==="timed-metadata"){if(A.dataAlignmentIndicator&&(T=0,v.length=0),v.length===0&&(A.data.length<10||A.data[0]!=="I".charCodeAt(0)||A.data[1]!=="D".charCodeAt(0)||A.data[2]!=="3".charCodeAt(0)))m.debug;else if(v.push(A),T+=A.data.byteLength,v.length===1&&(g=zn(A.data.subarray(6,10)),g+=10),!(T<g)){for(P={data:new Uint8Array(g),frames:[],pts:v[0].pts,dts:v[0].dts},$=0;$<g;)P.data.set(v[0].data.subarray(0,g-$),$),$+=v[0].data.byteLength,T-=v[0].data.byteLength,v.shift();I=10,64&P.data[5]&&(I+=4,I+=zn(P.data.subarray(10,14)),g-=zn(P.data.subarray(16,20)));do{if((O=zn(P.data.subarray(I+4,I+8)))<1)return;if((N={id:String.fromCharCode(P.data[I],P.data[I+1],P.data[I+2],P.data[I+3]),data:P.data.subarray(I+10,I+O+10)}).key=N.id,nc[N.id]&&(nc[N.id](N),N.owner==="com.apple.streaming.transportStreamTimestamp")){var G=N.data,Q=(1&G[3])<<30|G[4]<<22|G[5]<<14|G[6]<<6|G[7]>>>2;Q*=4,Q+=3&G[7],N.timeStamp=Q,P.pts===void 0&&P.dts===void 0&&(P.pts=N.timeStamp,P.dts=N.timeStamp),this.trigger("timestamp",N)}P.frames.push(N),I+=10,I+=O}while(I<g);this.trigger("data",P)}}}}).prototype=new Rt;var Ka,$n,Ya,ef=Xa,nf=tf;(Ka=function(){var l=new Uint8Array(188),p=0;Ka.prototype.init.call(this),this.push=function(m){var g,v=0,T=188;for(p?((g=new Uint8Array(m.byteLength+p)).set(l.subarray(0,p)),g.set(m,p),p=0):g=m;T<g.byteLength;)g[v]!==71||g[T]!==71?(v++,T++):(this.trigger("data",g.subarray(v,T)),v+=188,T+=188);v<g.byteLength&&(l.set(g.subarray(v),0),p=g.byteLength-v)},this.flush=function(){p===188&&l[0]===71&&(this.trigger("data",l),p=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){p=0,this.trigger("reset")}}).prototype=new Rt,($n=function(){var l,p,m,g;$n.prototype.init.call(this),(g=this).packetsWaitingForPmt=[],this.programMapTable=void 0,l=function(v,T){var A=0;T.payloadUnitStartIndicator&&(A+=v[A]+1),T.type==="pat"?p(v.subarray(A),T):m(v.subarray(A),T)},p=function(v,T){T.section_number=v[7],T.last_section_number=v[8],g.pmtPid=(31&v[10])<<8|v[11],T.pmtPid=g.pmtPid},m=function(v,T){var A,P;if(1&v[5]){for(g.programMapTable={video:null,audio:null,"timed-metadata":{}},A=3+((15&v[1])<<8|v[2])-4,P=12+((15&v[10])<<8|v[11]);P<A;){var I=v[P],O=(31&v[P+1])<<8|v[P+2];I===Wt.H264_STREAM_TYPE&&g.programMapTable.video===null?g.programMapTable.video=O:I===Wt.ADTS_STREAM_TYPE&&g.programMapTable.audio===null?g.programMapTable.audio=O:I===Wt.METADATA_STREAM_TYPE&&(g.programMapTable["timed-metadata"][O]=I),P+=5+((15&v[P+3])<<8|v[P+4])}T.programMapTable=g.programMapTable}},this.push=function(v){var T={},A=4;if(T.payloadUnitStartIndicator=!!(64&v[1]),T.pid=31&v[1],T.pid<<=8,T.pid|=v[2],1<(48&v[3])>>>4&&(A+=v[A]+1),T.pid===0)T.type="pat",l(v.subarray(A),T),this.trigger("data",T);else if(T.pid===this.pmtPid)for(T.type="pmt",l(v.subarray(A),T),this.trigger("data",T);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,A,T]):this.processPes_(v,A,T)},this.processPes_=function(v,T,A){A.pid===this.programMapTable.video?A.streamType=Wt.H264_STREAM_TYPE:A.pid===this.programMapTable.audio?A.streamType=Wt.ADTS_STREAM_TYPE:A.streamType=this.programMapTable["timed-metadata"][A.pid],A.type="pes",A.data=v.subarray(T),this.trigger("data",A)}}).prototype=new Rt,$n.STREAM_TYPES={h264:27,adts:15},(Ya=function(){function l(A,P,I){var O,N,$=new Uint8Array(A.size),G={type:P},Q=0,ht=0;if(A.data.length&&!(A.size<9)){for(G.trackId=A.data[0].pid,Q=0;Q<A.data.length;Q++)N=A.data[Q],$.set(N.data,ht),ht+=N.data.byteLength;(function(X,gt){var Ft;gt.packetLength=6+(X[4]<<8|X[5]),gt.dataAlignmentIndicator=(4&X[6])!=0,192&(Ft=X[7])&&(gt.pts=(14&X[9])<<27|(255&X[10])<<20|(254&X[11])<<12|(255&X[12])<<5|(254&X[13])>>>3,gt.pts*=4,gt.pts+=(6&X[13])>>>1,gt.dts=gt.pts,64&Ft&&(gt.dts=(14&X[14])<<27|(255&X[15])<<20|(254&X[16])<<12|(255&X[17])<<5|(254&X[18])>>>3,gt.dts*=4,gt.dts+=(6&X[18])>>>1)),gt.data=X.subarray(9+X[8])})($,G),O=P==="video"||G.packetLength<=A.size,(I||O)&&(A.size=0,A.data.length=0),O&&m.trigger("data",G)}}var p,m=this,g={data:[],size:0},v={data:[],size:0},T={data:[],size:0};Ya.prototype.init.call(this),this.push=function(A){({pat:function(){},pes:function(){var P,I;switch(A.streamType){case Wt.H264_STREAM_TYPE:case Wt.H264_STREAM_TYPE:P=g,I="video";break;case Wt.ADTS_STREAM_TYPE:P=v,I="audio";break;case Wt.METADATA_STREAM_TYPE:P=T,I="timed-metadata";break;default:return}A.payloadUnitStartIndicator&&l(P,I,!0),P.data.push(A),P.size+=A.data.byteLength},pmt:function(){var P={type:"metadata",tracks:[]};(p=A.programMapTable).video!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.video,codec:"avc",type:"video"}),p.audio!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+p.audio,codec:"adts",type:"audio"}),m.trigger("data",P)}})[A.type]()},this.reset=function(){g.size=0,g.data.length=0,v.size=0,v.data.length=0,this.trigger("reset")},this.flushStreams_=function(){l(g,"video"),l(v,"audio"),l(T,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}}).prototype=new Rt;var rc={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ka,TransportParseStream:$n,ElementaryStream:Ya,TimestampRolloverStream:nf,CaptionStream:ec.CaptionStream,Cea608Stream:ec.Cea608Stream,MetadataStream:ef};for(var Qa in Wt)Wt.hasOwnProperty(Qa)&&(rc[Qa]=Wt[Qa]);var Ja,he=rc,rf=Qi,ac=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(Ja=function(l){var p,m=0;Ja.prototype.init.call(this),this.push=function(g){var v,T,A,P,I,O,N=0;if(l||(m=0),g.type==="audio")for(p?(P=p,(p=new Uint8Array(P.byteLength+g.data.byteLength)).set(P),p.set(g.data,P.byteLength)):p=g.data;N+5<p.length;)if(p[N]===255&&(246&p[N+1])==240){if(T=2*(1&~p[N+1]),v=(3&p[N+3])<<11|p[N+4]<<3|(224&p[N+5])>>5,O=(I=1024*(1+(3&p[N+6])))*rf/ac[(60&p[N+2])>>>2],A=N+v,p.byteLength<A)return;if(this.trigger("data",{pts:g.pts+m*O,dts:g.dts+m*O,sampleCount:I,audioobjecttype:1+(p[N+2]>>>6&3),channelcount:(1&p[N+2])<<2|(192&p[N+3])>>>6,samplerate:ac[(60&p[N+2])>>>2],samplingfrequencyindex:(60&p[N+2])>>>2,samplesize:16,data:p.subarray(N+7+T,A)}),m++,p.byteLength===A)return void(p=void 0);p=p.subarray(A)}else N++},this.flush=function(){m=0,this.trigger("done")},this.reset=function(){p=void 0,this.trigger("reset")},this.endTimeline=function(){p=void 0,this.trigger("endedtimeline")}}).prototype=new Rt;var Za,Gn,sc,oc=Ja,af=function(l){var p=l.byteLength,m=0,g=0;this.length=function(){return 8*p},this.bitsAvailable=function(){return 8*p+g},this.loadWord=function(){var v=l.byteLength-p,T=new Uint8Array(4),A=Math.min(4,p);if(A===0)throw new Error("no bytes available");T.set(l.subarray(v,v+A)),m=new DataView(T.buffer).getUint32(0),g=8*A,p-=A},this.skipBits=function(v){var T;v<g||(v-=g,v-=8*(T=Math.floor(v/8)),p-=T,this.loadWord()),m<<=v,g-=v},this.readBits=function(v){var T=Math.min(g,v),A=m>>>32-T;return 0<(g-=T)?m<<=T:0<p&&this.loadWord(),0<(T=v-T)?A<<T|this.readBits(T):A},this.skipLeadingZeros=function(){var v;for(v=0;v<g;++v)if((m&2147483648>>>v)!=0)return m<<=v,g-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Gn=function(){var l,p,m=0;Gn.prototype.init.call(this),this.push=function(g){for(var v,T=(p=p?((v=new Uint8Array(p.byteLength+g.data.byteLength)).set(p),v.set(g.data,p.byteLength),v):g.data).byteLength;m<T-3;m++)if(p[m+2]===1){l=m+5;break}for(;l<T;)switch(p[l]){case 0:if(p[l-1]!==0){l+=2;break}if(p[l-2]!==0){l++;break}for(m+3!==l-2&&this.trigger("data",p.subarray(m+3,l-2));p[++l]!==1&&l<T;);m=l-2,l+=3;break;case 1:if(p[l-1]!==0||p[l-2]!==0){l+=3;break}this.trigger("data",p.subarray(m+3,l-2)),m=l-2,l+=3;break;default:l+=3}p=p.subarray(m),l-=m,m=0},this.reset=function(){p=null,m=0,this.trigger("reset")},this.flush=function(){p&&3<p.byteLength&&this.trigger("data",p.subarray(m+3)),p=null,m=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new Rt,sc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(Za=function(){var l,p,m,g,v,T,A,P=new Gn;Za.prototype.init.call(this),(l=this).push=function(I){I.type==="video"&&(p=I.trackId,m=I.pts,g=I.dts,P.push(I))},P.on("data",function(I){var O={trackId:p,pts:m,dts:g,data:I};switch(31&I[0]){case 5:O.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:O.nalUnitType="sei_rbsp",O.escapedRBSP=v(I.subarray(1));break;case 7:O.nalUnitType="seq_parameter_set_rbsp",O.escapedRBSP=v(I.subarray(1)),O.config=T(O.escapedRBSP);break;case 8:O.nalUnitType="pic_parameter_set_rbsp";break;case 9:O.nalUnitType="access_unit_delimiter_rbsp"}l.trigger("data",O)}),P.on("done",function(){l.trigger("done")}),P.on("partialdone",function(){l.trigger("partialdone")}),P.on("reset",function(){l.trigger("reset")}),P.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){P.flush()},this.partialFlush=function(){P.partialFlush()},this.reset=function(){P.reset()},this.endTimeline=function(){P.endTimeline()},A=function(I,O){var N,$=8,G=8;for(N=0;N<I;N++)G!==0&&(G=($+O.readExpGolomb()+256)%256),$=G===0?$:G},v=function(I){for(var O,N,$=I.byteLength,G=[],Q=1;Q<$-2;)I[Q]===0&&I[Q+1]===0&&I[Q+2]===3?(G.push(Q+2),Q+=2):Q++;if(G.length===0)return I;O=$-G.length,N=new Uint8Array(O);var ht=0;for(Q=0;Q<O;ht++,Q++)ht===G[0]&&(ht++,G.shift()),N[Q]=I[ht];return N},T=function(I){var O,N,$,G,Q,ht,X,gt,Ft,_i,dc,yt,qe,pc=0,fc=0,mc=0,gc=0,yc=1;if(N=(O=new af(I)).readUnsignedByte(),G=O.readUnsignedByte(),$=O.readUnsignedByte(),O.skipUnsignedExpGolomb(),sc[N]&&((Q=O.readUnsignedExpGolomb())===3&&O.skipBits(1),O.skipUnsignedExpGolomb(),O.skipUnsignedExpGolomb(),O.skipBits(1),O.readBoolean()))for(dc=Q!==3?8:12,qe=0;qe<dc;qe++)O.readBoolean()&&A(qe<6?16:64,O);if(O.skipUnsignedExpGolomb(),(ht=O.readUnsignedExpGolomb())===0)O.readUnsignedExpGolomb();else if(ht===1)for(O.skipBits(1),O.skipExpGolomb(),O.skipExpGolomb(),X=O.readUnsignedExpGolomb(),qe=0;qe<X;qe++)O.skipExpGolomb();if(O.skipUnsignedExpGolomb(),O.skipBits(1),gt=O.readUnsignedExpGolomb(),Ft=O.readUnsignedExpGolomb(),(_i=O.readBits(1))===0&&O.skipBits(1),O.skipBits(1),O.readBoolean()&&(pc=O.readUnsignedExpGolomb(),fc=O.readUnsignedExpGolomb(),mc=O.readUnsignedExpGolomb(),gc=O.readUnsignedExpGolomb()),O.readBoolean()&&O.readBoolean()){switch(O.readUnsignedByte()){case 1:yt=[1,1];break;case 2:yt=[12,11];break;case 3:yt=[10,11];break;case 4:yt=[16,11];break;case 5:yt=[40,33];break;case 6:yt=[24,11];break;case 7:yt=[20,11];break;case 8:yt=[32,11];break;case 9:yt=[80,33];break;case 10:yt=[18,11];break;case 11:yt=[15,11];break;case 12:yt=[64,33];break;case 13:yt=[160,99];break;case 14:yt=[4,3];break;case 15:yt=[3,2];break;case 16:yt=[2,1];break;case 255:yt=[O.readUnsignedByte()<<8|O.readUnsignedByte(),O.readUnsignedByte()<<8|O.readUnsignedByte()]}yt&&(yc=yt[0]/yt[1])}return{profileIdc:N,levelIdc:$,profileCompatibility:G,width:Math.ceil((16*(gt+1)-2*pc-2*fc)*yc),height:(2-_i)*(Ft+1)*16-2*mc-2*gc,sarRatio:yt}}}).prototype=new Rt;var ts,sf={H264Stream:Za,NalByteStream:Gn},of=function(l){return l[0]==="I".charCodeAt(0)&&l[1]==="D".charCodeAt(0)&&l[2]==="3".charCodeAt(0)},uf=function(l,p){var m=l[p+6]<<21|l[p+7]<<14|l[p+8]<<7|l[p+9];return(16&l[p+5])>>4?20+m:10+m},lf=function(l,p){var m=(224&l[p+5])>>5,g=l[p+4]<<3;return 6144&l[p+3]|g|m};(ts=function(){var l=new Uint8Array,p=0;ts.prototype.init.call(this),this.setTimestamp=function(m){p=m},this.push=function(m){var g,v,T,A,P=0,I=0;for(l.length?(A=l.length,(l=new Uint8Array(m.byteLength+A)).set(l.subarray(0,A)),l.set(m,A)):l=m;3<=l.length-I;)if(l[I]!=="I".charCodeAt(0)||l[I+1]!=="D".charCodeAt(0)||l[I+2]!=="3".charCodeAt(0))if((255&l[I])!=255||(240&l[I+1])!=240)I++;else{if(l.length-I<7||I+(P=lf(l,I))>l.length)break;T={type:"audio",data:l.subarray(I,I+P),pts:p,dts:p},this.trigger("data",T),I+=P}else{if(l.length-I<10||I+(P=uf(l,I))>l.length)break;v={type:"timed-metadata",data:l.subarray(I,I+P)},this.trigger("data",v),I+=P}g=l.length-I,l=0<g?l.subarray(I):new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Rt;function uc(l,p){var m;if(l.length!==p.length)return!1;for(m=0;m<l.length;m++)if(l[m]!==p[m])return!1;return!0}function lc(l,p,m,g,v,T){return{start:{dts:l,pts:l+(m-p)},end:{dts:l+(g-p),pts:l+(v-m)},prependedContentDuration:T,baseMediaDecodeTime:l}}var Xn,Ji,es,vi,cf=ts,hf=sf.H264Stream,df=of,pf=Qi,is=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ns=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];(Ji=function(l,p){var m=[],g=0,v=0,T=0,A=1/0;p=p||{},Ji.prototype.init.call(this),this.push=function(P){$a(l,P),l&&is.forEach(function(I){l[I]=P[I]}),m.push(P)},this.setEarliestDts=function(P){v=P-l.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(P){A=P},this.setAudioAppendStart=function(P){T=P},this.flush=function(){var P,I,O,N,$;m.length!==0&&(P=Wp(m,l,v),l.baseMediaDecodeTime=Zl(l,p.keepOriginalTimestamps),qp(l,P,T,A),l.samples=zp(P),O=Ql($p(P)),m=[],I=Jl(g,[l]),N=new Uint8Array(I.byteLength+O.byteLength),g++,N.set(I),N.set(O,I.byteLength),yi(l),$=Math.ceil(1024*pf/l.samplerate),P.length&&this.trigger("timingInfo",{start:P[0].dts,end:P[0].dts+P.length*$}),this.trigger("data",{track:l,boxes:N})),this.trigger("done","AudioSegmentStream")},this.reset=function(){yi(l),m=[],this.trigger("reset")}}).prototype=new Rt,(Xn=function(l,p){var m,g,v=0,T=[],A=[];p=p||{},Xn.prototype.init.call(this),delete l.minPTS,this.gopCache_=[],this.push=function(P){$a(l,P),P.nalUnitType!=="seq_parameter_set_rbsp"||m||(m=P.config,l.sps=[P.data],ns.forEach(function(I){l[I]=m[I]},this)),P.nalUnitType!=="pic_parameter_set_rbsp"||g||(g=P.data,l.pps=[P.data]),T.push(P)},this.flush=function(){for(var P,I,O,N,$,G,Q,ht,X=0;T.length&&T[0].nalUnitType!=="access_unit_delimiter_rbsp";)T.shift();if(T.length===0)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(P=Up(T),(O=Rp(P))[0][0].keyFrame||((I=this.getGopForFusion_(T[0],l))?(X=I.duration,O.unshift(I),O.byteLength+=I.byteLength,O.nalCount+=I.nalCount,O.pts=I.pts,O.dts=I.dts,O.duration+=I.duration):O=Mp(O)),A.length){var gt;if(!(gt=p.alignGopsAtEnd?this.alignGopsAtEnd_(O):this.alignGopsAtStart_(O)))return this.gopCache_.unshift({gop:O.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");yi(l),O=gt}$a(l,O),l.samples=Np(O),$=Ql(Bp(O)),l.baseMediaDecodeTime=Zl(l,p.keepOriginalTimestamps),this.trigger("processedGopsInfo",O.map(function(Ft){return{pts:Ft.pts,dts:Ft.dts,byteLength:Ft.byteLength}})),Q=O[0],ht=O[O.length-1],this.trigger("segmentTimingInfo",lc(l.baseMediaDecodeTime,Q.dts,Q.pts,ht.dts+ht.duration,ht.pts+ht.duration,X)),this.trigger("timingInfo",{start:O[0].dts,end:O[O.length-1].dts+O[O.length-1].duration}),this.gopCache_.unshift({gop:O.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.trigger("baseMediaDecodeTime",l.baseMediaDecodeTime),this.trigger("timelineStartInfo",l.timelineStartInfo),N=Jl(v,[l]),G=new Uint8Array(N.byteLength+$.byteLength),v++,G.set(N),G.set($,N.byteLength),this.trigger("data",{track:l,boxes:G}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),T=[],this.gopCache_.length=0,A.length=0,this.trigger("reset")},this.resetStream_=function(){yi(l),g=m=void 0},this.getGopForFusion_=function(P){var I,O,N,$,G,Q=1/0;for(G=0;G<this.gopCache_.length;G++)N=($=this.gopCache_[G]).gop,l.pps&&uc(l.pps[0],$.pps[0])&&l.sps&&uc(l.sps[0],$.sps[0])&&(N.dts<l.timelineStartInfo.dts||-1e4<=(I=P.dts-N.dts-N.duration)&&I<=45e3&&(!O||I<Q)&&(O=$,Q=I));return O?O.gop:null},this.alignGopsAtStart_=function(P){var I,O,N,$,G,Q,ht,X;for(G=P.byteLength,Q=P.nalCount,ht=P.duration,I=O=0;I<A.length&&O<P.length&&(N=A[I],$=P[O],N.pts!==$.pts);)$.pts>N.pts?I++:(O++,G-=$.byteLength,Q-=$.nalCount,ht-=$.duration);return O===0?P:O===P.length?null:((X=P.slice(O)).byteLength=G,X.duration=ht,X.nalCount=Q,X.pts=X[0].pts,X.dts=X[0].dts,X)},this.alignGopsAtEnd_=function(P){var I,O,N,$,G,Q,ht;for(I=A.length-1,O=P.length-1,G=null,Q=!1;0<=I&&0<=O;){if(N=A[I],$=P[O],N.pts===$.pts){Q=!0;break}N.pts>$.pts?I--:(I===A.length-1&&(G=O),O--)}if(!Q&&G===null)return null;if((ht=Q?O:G)===0)return P;var X=P.slice(ht),gt=X.reduce(function(Ft,_i){return Ft.byteLength+=_i.byteLength,Ft.duration+=_i.duration,Ft.nalCount+=_i.nalCount,Ft},{byteLength:0,duration:0,nalCount:0});return X.byteLength=gt.byteLength,X.duration=gt.duration,X.nalCount=gt.nalCount,X.pts=X[0].pts,X.dts=X[0].dts,X},this.alignGopsWith=function(P){A=P}}).prototype=new Rt,(vi=function(l,p){this.numberOfTracks=0,this.metadataStream=p,typeof(l=l||{}).remux!="undefined"?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vi.prototype.init.call(this),this.push=function(m){return m.text?this.pendingCaptions.push(m):m.frames?this.pendingMetadata.push(m):(this.pendingTracks.push(m.track),this.pendingBytes+=m.boxes.byteLength,m.track.type==="video"&&(this.videoTrack=m.track,this.pendingBoxes.push(m.boxes)),void(m.track.type==="audio"&&(this.audioTrack=m.track,this.pendingBoxes.unshift(m.boxes))))}}).prototype=new Rt,vi.prototype.flush=function(l){var p,m,g,v,T=0,A={captions:[],captionStreams:{},metadata:[],info:{}},P=0;if(this.pendingTracks.length<this.numberOfTracks){if(l!=="VideoSegmentStream"&&l!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(P=this.videoTrack.timelineStartInfo.pts,ns.forEach(function(I){A.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(P=this.audioTrack.timelineStartInfo.pts,is.forEach(function(I){A.info[I]=this.audioTrack[I]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?A.type=this.pendingTracks[0].type:A.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Dp(this.pendingTracks),A.initSegment=new Uint8Array(g.byteLength),A.initSegment.set(g),A.data=new Uint8Array(this.pendingBytes),v=0;v<this.pendingBoxes.length;v++)A.data.set(this.pendingBoxes[v],T),T+=this.pendingBoxes[v].byteLength;for(v=0;v<this.pendingCaptions.length;v++)(p=this.pendingCaptions[v]).startTime=za(p.startPts,P,this.keepOriginalTimestamps),p.endTime=za(p.endPts,P,this.keepOriginalTimestamps),A.captionStreams[p.stream]=!0,A.captions.push(p);for(v=0;v<this.pendingMetadata.length;v++)(m=this.pendingMetadata[v]).cueTime=za(m.pts,P,this.keepOriginalTimestamps),A.metadata.push(m);for(A.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",A),v=0;v<A.captions.length;v++)p=A.captions[v],this.trigger("caption",p);for(v=0;v<A.metadata.length;v++)m=A.metadata[v],this.trigger("id3Frame",m)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vi.prototype.setRemux=function(l){this.remuxTracks=l},(es=function(l){var p,m,g=this,v=!0;es.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};(this.transmuxPipeline_=T).type="aac",T.metadataStream=new he.MetadataStream,T.aacStream=new cf,T.audioTimestampRolloverStream=new he.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new he.TimestampRolloverStream("timed-metadata"),T.adtsStream=new oc,T.coalesceStream=new vi(l,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(A){T.aacStream.setTimestamp(A.timeStamp)}),T.aacStream.on("data",function(A){A.type!=="timed-metadata"||T.audioSegmentStream||(m=m||{timelineStartInfo:{baseMediaDecodeTime:g.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Ji(m,l),T.audioSegmentStream.on("timingInfo",g.trigger.bind(g,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),g.trigger("trackinfo",{hasAudio:!!m,hasVideo:!!p})}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var T={};(this.transmuxPipeline_=T).type="ts",T.metadataStream=new he.MetadataStream,T.packetStream=new he.TransportPacketStream,T.parseStream=new he.TransportParseStream,T.elementaryStream=new he.ElementaryStream,T.timestampRolloverStream=new he.TimestampRolloverStream,T.adtsStream=new oc,T.h264Stream=new hf,T.captionStream=new he.CaptionStream,T.coalesceStream=new vi(l,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(A){var P;if(A.type==="metadata"){for(P=A.tracks.length;P--;)p||A.tracks[P].type!=="video"?m||A.tracks[P].type!=="audio"||((m=A.tracks[P]).timelineStartInfo.baseMediaDecodeTime=g.baseMediaDecodeTime):(p=A.tracks[P]).timelineStartInfo.baseMediaDecodeTime=g.baseMediaDecodeTime;p&&!T.videoSegmentStream&&(T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new Xn(p,l),T.videoSegmentStream.on("timelineStartInfo",function(I){m&&(m.timelineStartInfo=I,T.audioSegmentStream.setEarliestDts(I.dts))}),T.videoSegmentStream.on("processedGopsInfo",g.trigger.bind(g,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",g.trigger.bind(g,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(I){m&&T.audioSegmentStream.setVideoBaseMediaDecodeTime(I)}),T.videoSegmentStream.on("timingInfo",g.trigger.bind(g,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream)),m&&!T.audioSegmentStream&&(T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Ji(m,l),T.audioSegmentStream.on("timingInfo",g.trigger.bind(g,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),g.trigger("trackinfo",{hasAudio:!!m,hasVideo:!!p})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(A){A.dispatchType=T.metadataStream.dispatchType,g.trigger("id3Frame",A)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(T){var A=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=T),m&&(m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,yi(m),l.keepOriginalTimestamps||(m.timelineStartInfo.baseMediaDecodeTime=T),A.audioTimestampRolloverStream&&A.audioTimestampRolloverStream.discontinuity()),p&&(A.videoSegmentStream&&(A.videoSegmentStream.gopCache_=[]),p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,yi(p),A.captionStream.reset(),l.keepOriginalTimestamps||(p.timelineStartInfo.baseMediaDecodeTime=T)),A.timestampRolloverStream&&A.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){m&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var A=this.transmuxPipeline_;l.remux=T,A&&A.coalesceStream&&A.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){p&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.push=function(T){if(v){var A=df(T);A&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():A||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),v=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){v=!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 Rt;var ff={Transmuxer:es,VideoSegmentStream:Xn,AudioSegmentStream:Ji,AUDIO_PROPERTIES:is,VIDEO_PROPERTIES:ns,generateVideoSegmentTimingInfo:lc};function cc(l,p){for(var m=0;m<p.length;m++){var g=p[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}var hc=(function(l,p,m){return p&&cc(l.prototype,p),m&&cc(l,m),l}(rs,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ff.Transmuxer(this.options),function(l,p){p.on("data",function(m){var g=m.initSegment;m.initSegment={data:g.buffer,byteOffset:g.byteOffset,byteLength:g.byteLength};var v=m.data;m.data=v.buffer,l.postMessage({action:"data",segment:m,byteOffset:v.byteOffset,byteLength:v.byteLength},[m.data])}),p.captionStream&&p.captionStream.on("data",function(m){l.postMessage({action:"caption",data:m})}),p.on("done",function(m){l.postMessage({action:"done"})}),p.on("gopInfo",function(m){l.postMessage({action:"gopInfo",gopInfo:m})}),p.on("videoSegmentTimingInfo",function(m){l.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:m})})}(this.self,this.transmuxer)}},{key:"push",value:function(l){var p=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(p)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(l){var p=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*p))}},{key:"setAudioAppendStart",value:function(l){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*l.appendStart))}},{key:"flush",value:function(l){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(l){this.transmuxer.alignGopsWith(l.gopsToAlignWith.slice())}}]),rs);function rs(l,p){(function(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")})(this,rs),this.options=p||{},this.self=l,this.init()}new function(l){l.onmessage=function(p){p.data.action==="init"&&p.data.options?this.messageHandlers=new hc(l,p.data.options):(this.messageHandlers||(this.messageHandlers=new hc(l)),p.data&&p.data.action&&p.data.action!=="init"&&this.messageHandlers[p.data.action]&&this.messageHandlers[p.data.action](p.data))}}(n)})()}),bl={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},pp=(ce(ci,w.EventTarget),ie(ci,[{key:"data_",value:function(t){var i=t.data.segment;i.data=new Uint8Array(i.data,t.data.byteOffset,t.data.byteLength),i.initSegment=new Uint8Array(i.initSegment.data,i.initSegment.byteOffset,i.initSegment.byteLength),function(n,e,r){var a=e.player_;if(r.captions&&r.captions.length){for(var s in n.inbandTextTracks_||(n.inbandTextTracks_={}),r.captionStreams)if(!n.inbandTextTracks_[s]){a.tech_.trigger({type:"usage",name:"hls-608"});var o=a.textTracks().getTrackById(s);n.inbandTextTracks_[s]=o||a.addRemoteTextTrack({kind:"captions",id:s,label:s},!1).track}}r.metadata&&r.metadata.length&&!n.metadataTrack_&&(n.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,n.metadataTrack_.inBandMetadataTrackDispatchType=r.metadata.dispatchType)}(this,this.mediaSource_,i),this.pendingBuffers_.push(i)}},{key:"done_",value:function(t){this.mediaSource_.readyState!=="closed"?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"videoSegmentTimingInfo_",value:function(t){var i={start:{decode:t.start.dts/9e4,presentation:t.start.pts/9e4},end:{decode:t.end.dts/9e4,presentation:t.end.pts/9e4},baseMediaDecodeTime:t.baseMediaDecodeTime/9e4};t.prependedContentDuration&&(i.prependedContentDuration=t.prependedContentDuration/9e4),this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}},{key:"createRealSourceBuffers_",value:function(){var t=this,i=["audio","video"];i.forEach(function(n){if(t[n+"Codec_"]&&!t[n+"Buffer_"]){var e=null;if(t.mediaSource_[n+"Buffer_"])(e=t.mediaSource_[n+"Buffer_"]).updating=!1;else{var r=n+'/mp4;codecs="'+t[n+"Codec_"]+'"';e=function(a,s){var o=a.addSourceBuffer(s),u=Object.create(null);function c(h){typeof o[h]=="function"?u[h]=function(){return o[h].apply(o,arguments)}:typeof u[h]=="undefined"&&Object.defineProperty(u,h,{get:function(){return o[h]},set:function(f){return o[h]=f}})}for(var d in u.updating=!1,u.realBuffer_=o)c(d);return u}(t.mediaSource_.nativeMediaSource_,r),t.mediaSource_[n+"Buffer_"]=e}t[n+"Buffer_"]=e,["update","updatestart","updateend"].forEach(function(a){e.addEventListener(a,function(){if(n!=="audio"||!t.audioDisabled_)return a==="updateend"&&(t[n+"Buffer_"].updating=!1),i.every(function(s){return!(s!=="audio"||!t.audioDisabled_)||n===s||!t[s+"Buffer_"]||!t[s+"Buffer_"].updating})?t.trigger(a):void 0})})}})}},{key:"appendBuffer",value:function(t){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var i=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:i.end(i.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:function(n,e,r){if(typeof e=="undefined"||e===null||!n.length)return[];var a=Math.ceil(9e4*(e-r+3)),s=void 0;for(s=0;s<n.length&&!(n[s].pts>a);s++);return n.slice(s)}(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},[t.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(t){this.gopBuffer_=function(i,n,e){if(!n.length)return i;if(e)return n.slice();for(var r=n[0].pts,a=0;a<i.length&&!(i[a].pts>=r);a++);return i.slice(0,a).concat(n)}(this.gopBuffer_,t.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(t,i){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(t,i),this.gopBuffer_=function(e,r,a,s){for(var o=Math.ceil(9e4*(r-s)),u=Math.ceil(9e4*(a-s)),c=e.slice(),d=e.length;d--&&!(e[d].pts<=u););if(d===-1)return c;for(var h=d+1;h--&&!(e[h].pts<=o););return h=Math.max(h,0),c.splice(h,d-h+1),c}(this.gopBuffer_,t,i,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(t,i)),oi(t,i,this.metadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)oi(t,i,this.inbandTextTracks_[n])}},{key:"processPendingSegments_",value:function(){var t={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};if(!this.pendingBuffers_.length)return this.trigger("updateend"),void(this.bufferUpdating_=!1);t=this.pendingBuffers_.reduce(function(n,e){var r=e.type,a=e.data,s=e.initSegment;return n[r].segments.push(a),n[r].bytes+=a.byteLength,n[r].initSegment=s,e.captions&&(n.captions=n.captions.concat(e.captions)),e.info&&(n[r].info=e.info),e.metadata&&(n.metadata=n.metadata.concat(e.metadata)),n},t),this.videoBuffer_||this.audioBuffer_||(t.video.bytes===0&&(this.videoCodec_=null),t.audio.bytes===0&&(this.audioCodec_=null),this.createRealSourceBuffers_()),t.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:t.audio.info}),t.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:t.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(t.audio.segments.unshift(t.audio.initSegment),t.audio.bytes+=t.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var i=!1;this.videoBuffer_&&t.video.bytes?(t.video.segments.unshift(t.video.initSegment),t.video.bytes+=t.video.initSegment.byteLength,this.concatAndAppendSegments_(t.video,this.videoBuffer_)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(i=!0),np(this,t.captions,t.metadata),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(t.audio,this.audioBuffer_),this.pendingBuffers_.length=0,i&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(t,i){var n=0,e=void 0;if(t.bytes){e=new Uint8Array(t.bytes),t.segments.forEach(function(r){e.set(r,n),n+=r.byteLength});try{i.updating=!0,i.appendBuffer(e)}catch(r){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:r.message,originalError:r})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),ci);function ci(t,i){Qt(this,ci);var n=ae(this,(ci.__proto__||Object.getPrototypeOf(ci)).call(this,w.EventTarget));n.timestampOffset_=0,n.pendingBuffers_=[],n.bufferUpdating_=!1,n.mediaSource_=t,n.codecs_=i,n.audioCodec_=null,n.videoCodec_=null,n.audioDisabled_=!1,n.appendAudioInitSegment_=!0,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=11<=w.browser.IE_VERSION;var e={remux:!1,alignGopsAtEnd:n.safeAppend_};return n.codecs_.forEach(function(r){vl(r)?n.audioCodec_=r:_l(r)&&(n.videoCodec_=r)}),n.transmuxer_=new dp,n.transmuxer_.postMessage({action:"init",options:e}),n.transmuxer_.onmessage=function(r){return r.data.action==="data"?n.data_(r):r.data.action==="done"?n.done_(r):r.data.action==="gopInfo"?n.appendGopInfo_(r):r.data.action==="videoSegmentTimingInfo"?n.videoSegmentTimingInfo_(r.data.videoSegmentTimingInfo):void 0},Object.defineProperty(n,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(r){typeof r=="number"&&0<=r&&(this.timestampOffset_=r,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:r}))}}),Object.defineProperty(n,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(r){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=r),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=r)}}),Object.defineProperty(n,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(n,"buffered",{get:function(){return function(r,a,s){var o=null,u=null,c=0,d=[],h=[];if(!r&&!a)return w.createTimeRange();if(!r)return a.buffered;if(!a||s)return r.buffered;if(r.buffered.length===0&&a.buffered.length===0)return w.createTimeRange();for(var f=r.buffered,y=a.buffered,b=f.length;b--;)d.push({time:f.start(b),type:"start"}),d.push({time:f.end(b),type:"end"});for(b=y.length;b--;)d.push({time:y.start(b),type:"start"}),d.push({time:y.end(b),type:"end"});for(d.sort(function(_,E){return _.time-E.time}),b=0;b<d.length;b++)d[b].type==="start"?++c==2&&(o=d[b].time):d[b].type==="end"&&--c==1&&(u=d[b].time),o!==null&&u!==null&&(h.push([o,u]),u=o=null);return w.createTimeRanges(h)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),n}var Oa=(ce(je,w.EventTarget),ie(je,[{key:"addSeekableRange_",value:function(t,i){var n=void 0;if(this.duration!==1/0)throw(n=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",n.code=11,n;(i>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=i)}},{key:"addSourceBuffer",value:function(t){var i=void 0,n=function(r){var a={type:"",parameters:{}},s=r.trim().split(";");return a.type=s.shift().trim(),s.forEach(function(o){var u=o.trim().split("=");if(1<u.length){var c=u[0].replace(/"/g,"").trim(),d=u[1].replace(/"/g,"").trim();a.parameters[c]=d}}),a}(t);if(/^(video|audio)\/mp2t$/i.test(n.type)){var e=[];n.parameters&&n.parameters.codecs&&(e=n.parameters.codecs.split(","),e=(e=yl(e)).filter(function(r){return vl(r)||_l(r)})),e.length===0&&(e=["avc1.4d400d","mp4a.40.2"]),i=new pp(this,e),this.sourceBuffers.length!==0&&(this.sourceBuffers[0].createRealSourceBuffers_(),i.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else i=this.nativeMediaSource_.addSourceBuffer(t);return this.sourceBuffers.push(i),i}}]),je);function je(){Qt(this,je);var t=ae(this,(je.__proto__||Object.getPrototypeOf(je)).call(this)),i=void 0;for(i in t.nativeMediaSource_=new k.MediaSource,t.nativeMediaSource_)i in je.prototype||typeof t.nativeMediaSource_[i]!="function"||(t[i]=t.nativeMediaSource_[i].bind(t.nativeMediaSource_));return t.duration_=NaN,Object.defineProperty(t,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(n){(this.duration_=n)===1/0||(this.nativeMediaSource_.duration=n)}}),Object.defineProperty(t,"seekable",{get:function(){return this.duration_===1/0?w.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(t,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(t,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),t.sourceBuffers=[],t.activeSourceBuffers_=[],t.updateActiveSourceBuffers_=function(){if(t.activeSourceBuffers_.length=0,t.sourceBuffers.length===1){var n=t.sourceBuffers[0];return n.appendAudioInitSegment_=!0,n.audioDisabled_=!n.audioCodec_,void t.activeSourceBuffers_.push(n)}for(var e=!1,r=!0,a=0;a<t.player_.audioTracks().length;a++){var s=t.player_.audioTracks()[a];if(s.enabled&&s.kind!=="main"){r=!(e=!0);break}}t.sourceBuffers.forEach(function(o,u){if(o.appendAudioInitSegment_=!0,o.videoCodec_&&o.audioCodec_)o.audioDisabled_=e;else if(o.videoCodec_&&!o.audioCodec_)o.audioDisabled_=!0,r=!1;else if(!o.videoCodec_&&o.audioCodec_&&(o.audioDisabled_=u?r:!r,o.audioDisabled_))return;t.activeSourceBuffers_.push(o)})},t.onPlayerMediachange_=function(){t.sourceBuffers.forEach(function(n){n.appendAudioInitSegment_=!0})},t.onHlsReset_=function(){t.sourceBuffers.forEach(function(n){n.transmuxer_&&n.transmuxer_.postMessage({action:"resetCaptions"})})},t.onHlsSegmentTimeMapping_=function(n){t.sourceBuffers.forEach(function(e){return e.timeMapping_=n.mapping})},["sourceopen","sourceclose","sourceended"].forEach(function(n){this.nativeMediaSource_.addEventListener(n,this.trigger.bind(this))},t),t.on("sourceopen",function(n){var e=U.querySelector('[src="'+t.url_+'"]');e&&(t.player_=w(e.parentNode),t.player_&&(t.player_.tech_.on("hls-reset",t.onHlsReset_),t.player_.tech_.on("hls-segment-time-mapping",t.onHlsSegmentTimeMapping_),t.player_.audioTracks&&t.player_.audioTracks()&&(t.player_.audioTracks().on("change",t.updateActiveSourceBuffers_),t.player_.audioTracks().on("addtrack",t.updateActiveSourceBuffers_),t.player_.audioTracks().on("removetrack",t.updateActiveSourceBuffers_)),t.player_.on("mediachange",t.onPlayerMediachange_)))}),t.on("sourceended",function(n){for(var e=hl(t.duration),r=0;r<t.sourceBuffers.length;r++){var a=t.sourceBuffers[r],s=a.metadataTrack_&&a.metadataTrack_.cues;s&&s.length&&(s[s.length-1].endTime=e)}}),t.on("sourceclose",function(n){this.sourceBuffers.forEach(function(e){e.transmuxer_&&e.transmuxer_.terminate()}),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))}),t}var Tl=0;w.mediaSources={};function Sl(t,i){var n=w.mediaSources[t];if(!n)throw new Error("Media Source not found (Video.js)");n.trigger({type:"sourceopen",swfId:i})}function xa(){return!!k.MediaSource&&!!k.MediaSource.isTypeSupported&&k.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')}function Xi(){if(this.MediaSource={open:Sl,supportsNativeMediaSources:xa},xa())return new Oa;throw new Error("Cannot use create a virtual MediaSource for this video")}Xi.open=Sl,Xi.supportsNativeMediaSources=xa;var kl={createObjectURL:function(t){var i=void 0;return t instanceof Oa?(i=k.URL.createObjectURL(t.nativeMediaSource_),t.url_=i):t instanceof Oa?(i="blob:vjs-media-source/"+Tl,Tl++,w.mediaSources[i]=t,i):(i=k.URL.createObjectURL(t),t.url_=i)}};w.MediaSource=Xi,w.URL=kl;function Cl(t,i){for(var n=void 0,e=Al(t,{duration:i.duration,minimumUpdatePeriod:i.minimumUpdatePeriod}),r=0;r<i.playlists.length;r++){var a=Sa(e,i.playlists[r]);a?e=a:n=!0}return Mn(i,function(s,o,u,c){if(s.playlists&&s.playlists.length){var d=s.playlists[0].uri,h=Sa(e,s.playlists[0]);h&&((e=h).mediaGroups[o][u][c].playlists[0]=e.playlists[d],n=!1)}}),n?null:e}function Da(t){var i=t.byterange.offset+t.byterange.length-1;return t.uri+"-"+t.byterange.offset+"-"+i}function El(t,i){var n,e,r={};for(var a in t){var s=t[a].sidx;if(s){var o=Da(s);if(!i[o])break;var u=i[o].sidxInfo;n=u,e=s,(Boolean(!n.map&&!e.map)||Boolean(n.map&&e.map&&n.map.byterange.offset===e.map.byterange.offset&&n.map.byterange.length===e.map.byterange.length))&&n.uri===e.uri&&n.byterange.offset===e.byterange.offset&&n.byterange.length===e.byterange.length&&(r[o]=i[o])}}return r}function wl(t,i,n,e,r){var a={uri:Rn(e.handleManifestRedirects,t.resolvedUri),byterange:t.byterange,playlist:i};return n(w.mergeOptions(a,{responseType:"arraybuffer",headers:wa(a)}),r)}var Al=w.mergeOptions,Ua=(ce(hi,w.EventTarget),ie(hi,[{key:"setupChildLoader",value:function(t,i){this.masterPlaylistLoader_=t,this.childPlaylist_=i}},{key:"dispose",value:function(){this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.clearTimeout(this.mediaUpdateTimeout)}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}},{key:"sidxRequestFinished_",value:function(t,i,n,e){var r=this;return function(a,s){if(r.request){if(r.request=null,a)return r.error={status:s.status,message:"DASH playlist request error at URL: "+t.uri,response:s.response,code:2},n&&(r.state=n),r.trigger("error"),e(i,null);var o=new Uint8Array(s.response),u=Ln.parseSidx(o.subarray(8));return e(i,u)}}}},{key:"media",value:function(t){var i=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if(typeof t=="string"){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}var e=!this.media_||t.uri!==this.media_.uri;if(e&&this.loadedPlaylists_[t.uri]&&this.loadedPlaylists_[t.uri].endList)return this.state="HAVE_METADATA",this.media_=t,void(e&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(e)if(this.media_&&this.trigger("mediachanging"),t.sidx){var r=void 0,a=void 0;a=this.masterPlaylistLoader_?(r=this.masterPlaylistLoader_.master,this.masterPlaylistLoader_.sidxMapping_):(r=this.master,this.sidxMapping_);var s=Da(t.sidx);a[s]={sidxInfo:t.sidx},this.request=wl(t.sidx,t,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(t,r,n,function(o,u){if(!o||!u)throw new Error("failed to request sidx");a[s].sidx=u,i.haveMetadata({startingState:n,playlist:o.playlists[t.uri]})}))}else this.mediaRequest_=k.setTimeout(this.haveMetadata.bind(this,{startingState:n,playlist:t}),0)}},{key:"haveMetadata",value:function(t){var i=t.startingState,n=t.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.uri]=n,this.mediaRequest_=null,this.refreshMedia_(n.uri),i==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")}},{key:"pause",value:function(){this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.minimumUpdatePeriodTimeout_),this.state==="HAVE_NOTHING"&&(this.started=!1)}},{key:"load",value:function(t){var i=this;k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.minimumUpdatePeriodTimeout_);var n=this.media();if(t){var e=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(function(){return i.load()},e)}else this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var t=Pu(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});t.uri=this.srcUrl;for(var i=0;i<t.playlists.length;i++){var n="placeholder-uri-"+i;t.playlists[i].uri=n,t.playlists[n]=t.playlists[i]}return Mn(t,function(e,r,a,s){if(e.playlists&&e.playlists.length){var o="placeholder-uri-"+r+"-"+a+"-"+s;e.playlists[0].uri=o,t.playlists[o]=e.playlists[0]}}),zu(t),$u(t),t}},{key:"start",value:function(){var t=this;this.started=!0,this.masterPlaylistLoader_?this.mediaRequest_=k.setTimeout(this.haveMaster_.bind(this),0):this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(i,n){if(t.request){if(t.request=null,i)return t.error={status:n.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:n.responseText,code:2},t.state==="HAVE_NOTHING"&&(t.started=!1),t.trigger("error");t.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.srcUrl=Rn(t.handleManifestRedirects,t.srcUrl,n),t.syncClientServerClock_(t.onClientServerClockSync_.bind(t))}})}},{key:"syncClientServerClock_",value:function(t){var i=this,n=Td(this.masterXml_);return n===null?(this.clientOffset_=this.masterLoaded_-Date.now(),t()):n.method==="DIRECT"?(this.clientOffset_=n.value-Date.now(),t()):void(this.request=this.hls_.xhr({uri:Ne(this.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},function(e,r){if(i.request){if(e)return i.clientOffset_=i.masterLoaded_-Date.now(),t();var a=void 0;a=n.method==="HEAD"?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):i.masterLoaded_:Date.parse(r.responseText),i.clientOffset_=a-Date.now(),t()}}))}},{key:"haveMaster_",value:function(){this.state="HAVE_MASTER",this.mediaRequest_=null,this.masterPlaylistLoader_?this.media_||this.media(this.childPlaylist_):(this.master=this.parseMasterXml(),this.trigger("loadedplaylist"))}},{key:"onClientServerClockSync_",value:function(){var t=this;this.haveMaster_(),this.hasPendingRequest()||this.media_||this.media(this.master.playlists[0]),this.master&&this.master.minimumUpdatePeriod&&(this.minimumUpdatePeriodTimeout_=k.setTimeout(function(){t.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod))}},{key:"refreshXml_",value:function(){var t=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(i,n){if(t.request){if(t.request=null,i)return t.error={status:n.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:n.responseText,code:2},t.state==="HAVE_NOTHING"&&(t.started=!1),t.trigger("error");t.masterXml_=n.responseText,t.sidxMapping_=function(u,c,d,h){var f=Pu(u,{manifestUri:c,clientOffset:d}),y=El(f.playlists,h);return Mn(f,function(b,_,E,S){if(b.playlists&&b.playlists.length){var C=b.playlists;y=Al(y,El(C,h))}}),y}(t.masterXml_,t.srcUrl,t.clientOffset_,t.sidxMapping_);var e=t.parseMasterXml(),r=Cl(t.master,e),a=t.media().sidx;if(r)if(a){var s=Da(a);if(!t.sidxMapping_[s]){var o=t.media();t.request=wl(o.sidx,o,t.hls_.xhr,{handleManifestRedirects:t.handleManifestRedirects},t.sidxRequestFinished_(o,e,t.state,function(u,c){if(!u||!c)throw new Error("failed to request sidx on minimumUpdatePeriod");t.sidxMapping_[s].sidx=c,t.minimumUpdatePeriodTimeout_=k.setTimeout(function(){t.trigger("minimumUpdatePeriod")},t.master.minimumUpdatePeriod),t.refreshMedia_(t.media().uri)}))}}else t.master=r;t.minimumUpdatePeriodTimeout_=k.setTimeout(function(){t.trigger("minimumUpdatePeriod")},t.master.minimumUpdatePeriod)}})}},{key:"refreshMedia_",value:function(t){var i=this;if(!t)throw new Error("refreshMedia_ must take a media uri");var n=void 0,e=void 0;e=this.masterPlaylistLoader_?(n=this.masterPlaylistLoader_.master,this.masterPlaylistLoader_.parseMasterXml()):(n=this.master,this.parseMasterXml());var r=Cl(n,e);r?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=r:this.master=r,this.media_=r.playlists[t]):(this.media_=e.playlists[t],this.trigger("playlistunchanged")),this.media().endList||(this.mediaUpdateTimeout=k.setTimeout(function(){i.trigger("mediaupdatetimeout")},Gu(this.media(),!!r))),this.trigger("loadedplaylist")}}]),hi);function hi(t,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},e=arguments[3];Qt(this,hi);var r=ae(this,(hi.__proto__||Object.getPrototypeOf(hi)).call(this)),a=n.withCredentials,s=a!==void 0&&a,o=n.handleManifestRedirects,u=o!==void 0&&o;if(r.hls_=i,r.withCredentials=s,r.handleManifestRedirects=u,!t)throw new Error("A non-empty playlist URL or playlist is required");return r.on("minimumUpdatePeriod",function(){r.refreshXml_()}),r.on("mediaupdatetimeout",function(){r.refreshMedia_(r.media().uri)}),r.state="HAVE_NOTHING",r.loadedPlaylists_={},typeof t=="string"?(r.srcUrl=t,r.sidxMapping_={},ae(r)):(r.setupChildLoader(e,t),r)}function Ki(t){return w.log.debug?w.log.debug.bind(w,"VHS:",t+" >"):function(){}}function di(){}var fp=(ie(Ra,[{key:"createSourceBuffer_",value:function(t,i){var n=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(t),this.logger_("created SourceBuffer"),i&&(i.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?i.on("sourcebufferadded",function(){n.start_()}):this.start_()}},{key:"start_",value:function(){var t=this;this.started_=!0,this.onUpdateendCallback_=function(){var i=t.pendingCallback_;t.pendingCallback_=null,t.sourceBuffer_.removing=!1,t.logger_("buffered ["+Aa(t.buffered())+"]"),i&&i(),t.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(t){var i=this;this.processedAppend_&&this.queueCallback_(function(){i.sourceBuffer_.abort()},t)}},{key:"appendBuffer",value:function(t,i){var n=this;this.processedAppend_=!0,this.queueCallback_(function(){t.videoSegmentTimingInfoCallback&&n.sourceBuffer_.addEventListener("videoSegmentTimingInfo",t.videoSegmentTimingInfoCallback),n.sourceBuffer_.appendBuffer(t.bytes)},function(){t.videoSegmentTimingInfoCallback&&n.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",t.videoSegmentTimingInfoCallback),i()})}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:w.createTimeRanges()}},{key:"remove",value:function(t,i,n){var e=this,r=2<arguments.length&&n!==void 0?n:di;this.processedAppend_&&this.queueCallback_(function(){e.logger_("remove ["+t+" => "+i+"]"),e.sourceBuffer_.removing=!0,e.sourceBuffer_.remove(t,i)},r)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==di}},{key:"timestampOffset",value:function(t){var i=this;return typeof t!="undefined"&&(this.queueCallback_(function(){i.sourceBuffer_.timestampOffset=t,i.runCallback_()}),this.timestampOffset_=t),this.timestampOffset_}},{key:"queueCallback_",value:function(t,i){this.callbacks_.push([t.bind(this),i]),this.runCallback_()}},{key:"runCallback_",value:function(){var t=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(t=this.callbacks_.shift(),this.pendingCallback_=t[1],t[0]())}},{key:"dispose",value:function(){function t(){i.sourceBuffer_&&i.mediaSource.readyState==="open"&&i.sourceBuffer_.abort(),i.sourceBuffer_.removeEventListener("updateend",t)}var i=this;this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_.removing?this.sourceBuffer_.addEventListener("updateend",t):t()}}]),Ra);function Ra(t,i,n,e){Qt(this,Ra),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=n,this.mimeType_=i,this.logger_=Ki("SourceUpdater["+n+"]["+i+"]"),t.readyState==="closed"?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,e)):this.createSourceBuffer_(i,e)}function Pl(t){t.forEach(function(i){i.abort()})}function Ma(t,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:Ol,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:xl,xhr:i}:t?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Fn,xhr:i}:null}function mp(t,i,n){var e=0,r=!1;return function(a,s){if(!r)return a?(r=!0,Pl(t),n(a,s)):(e+=1)===t.length?(s.endOfAllRequests=Date.now(),s.encryptedBytes?function(o,u,c){o.addEventListener("message",function h(f){if(f.data.source===u.requestId){o.removeEventListener("message",h);var y=f.data.decrypted;return u.bytes=new Uint8Array(y.bytes,y.byteOffset,y.byteLength),c(null,u)}});var d=void 0;d=u.key.bytes.slice?u.key.bytes.slice():new Uint32Array(Array.prototype.slice.call(u.key.bytes)),o.postMessage(nl({source:u.requestId,encrypted:u.encryptedBytes,key:d,iv:u.key.iv}),[u.encryptedBytes.buffer,d.buffer])}(i,s,n):n(null,s)):void 0}}function gp(t,i){return function(n){return t.stats=w.mergeOptions(t.stats,function(e){var r=e.target,a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-r.requestTime||0};return a.bytesReceived=e.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a}(n)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(n,t)}}function yp(t,i,n,e,r,a,s){var o=[],u=mp(o,n,s);if(r.key&&!r.key.bytes){var c=t(w.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),function(f,y){return function(b,_){var E=_.response,S=Ma(b,_);if(S)return y(S,f);if(E.byteLength!==16)return y({status:_.status,message:"Invalid HLS key at URL: "+_.uri,code:Fn,xhr:_},f);var C=new DataView(E);return f.key.bytes=new Uint32Array([C.getUint32(0),C.getUint32(4),C.getUint32(8),C.getUint32(12)]),y(null,f)}}(r,u));o.push(c)}if(r.map&&!r.map.bytes){var d=t(w.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:wa(r.map)}),function(f,y,b){return function(_,E){var S=E.response,C=Ma(_,E);return C?b(C,f):S.byteLength===0?b({status:E.status,message:"Empty HLS segment content at URL: "+E.uri,code:Fn,xhr:E},f):(f.map.bytes=new Uint8Array(E.response),y&&!y.isInitialized()&&y.init(),f.map.timescales=re.timescale(f.map.bytes),f.map.videoTrackIds=re.videoTrackIds(f.map.bytes),b(null,f))}}(r,e,u));o.push(d)}var h=t(w.mergeOptions(i,{uri:r.resolvedUri,responseType:"arraybuffer",headers:wa(r)}),function(f,y,b){return function(_,E){var S=E.response,C=Ma(_,E),L=void 0;return C?b(C,f):S.byteLength===0?b({status:E.status,message:"Empty HLS segment content at URL: "+E.uri,code:Fn,xhr:E},f):(f.stats=function(D){return{bandwidth:D.bandwidth,bytesReceived:D.bytesReceived||0,roundTripTime:D.roundTripTime||0}}(E),f.key?f.encryptedBytes=new Uint8Array(E.response):f.bytes=new Uint8Array(E.response),y&&f.map&&f.map.bytes&&(y.isInitialized()||y.init(),(L=y.parse(f.bytes,f.map.videoTrackIds,f.map.timescales))&&L.captions&&(f.captionStreams=L.captionStreams,f.fmp4Captions=L.captions)),b(null,f))}}(r,e,u));return h.addEventListener("progress",gp(r,a)),o.push(h),function(){return Pl(o)}}function Il(t,i){var n;return t&&(n=k.getComputedStyle(t))?n[i]:""}function Yi(t,i){var n=t.slice();t.sort(function(e,r){var a=i(e,r);return a===0?n.indexOf(e)-n.indexOf(r):a})}function Na(t,i){var n=void 0,e=void 0;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||k.Number.MAX_VALUE,i.attributes.BANDWIDTH&&(e=i.attributes.BANDWIDTH),n-(e=e||k.Number.MAX_VALUE)}function Ll(t){return typeof t=="number"&&isFinite(t)}var Vt={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},Fn=2,Ol=-101,xl=-102,Ba=(ce(pi,w.EventTarget),ie(pi,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_&&this.captionParser_.reset()}},{key:"abort",value:function(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(t){return typeof t!="undefined"&&(this.error_=t),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():w.createTimeRanges()}},{key:"initSegment",value:function(t,i){var n=1<arguments.length&&i!==void 0&&i;if(!t)return null;var e=jn(t),r=this.initSegments_[e];return n&&!r&&t.bytes&&(this.initSegments_[e]=r={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,timescales:t.timescales,videoTrackIds:t.videoTrackIds}),r||t}},{key:"segmentKey",value:function(t,i){var n=1<arguments.length&&i!==void 0&&i;if(!t)return null;var e=rl(t),r=this.keyCache_[e];this.cacheEncryptionKeys_&&n&&!r&&t.bytes&&(this.keyCache_[e]=r={resolvedUri:t.resolvedUri,bytes:t.bytes});var a={resolvedUri:(r||t).resolvedUri};return r&&(a.bytes=r.bytes),a}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&this.state==="INIT")&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new fp(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(t,i){var n=1<arguments.length&&i!==void 0?i:{};if(t){var e=this.playlist_,r=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=n,this.hasPlayed_()||(t.syncInfo={mediaSequence:t.mediaSequence,time:0});var a=null;if(e&&(e.id?a=e.id:e.uri&&(a=e.uri)),this.logger_("playlist update ["+a+" => "+(t.id||t.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(e&&e.uri===t.uri){var s=t.mediaSequence-e.mediaSequence;this.logger_("live window shift ["+s+"]"),this.mediaIndex!==null&&(this.mediaIndex-=s),r&&(r.mediaIndex-=s,0<=r.mediaIndex&&(r.segment=t.segments[r.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(e,t)}else this.mediaIndex!==null&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return this.checkBufferTimeout_===null}},{key:"mimeType",value:function(t,i){this.mimeType_||(this.mimeType_=t,this.sourceBufferEmitter_=i,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(t){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),t),this.captionParser_&&this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(t,i,n){if(this.sourceUpdater_&&this.sourceUpdater_.remove(t,i,n),oi(t,i,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var e in this.inbandTextTracks_)oi(t,i,this.inbandTextTracks_[e])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);t&&(this.isEndOfStream_(t.mediaIndex)?this.endOfStream():t.mediaIndex===this.playlist_.segments.length-1&&this.mediaSource_.readyState==="ended"&&!this.seeking_()||(t.timeline!==this.currentTimeline_&&(this.syncController_.reset(),t.timestampOffset=t.startOfSegment,this.captionParser_&&this.captionParser_.clearAllCaptions()),this.loadSegment_(t)))}}},{key:"isEndOfStream_",value:function(t,i){return function(n,e,r){if(!n||!e)return!1;var a=r===n.segments.length;return n.endList&&e.readyState==="open"&&a}(1<arguments.length&&i!==void 0?i:this.playlist_,this.mediaSource_,t)&&!this.sourceUpdater_.updating()}},{key:"checkBuffer_",value:function(t,i,n,e,r,a){var s=0,o=void 0;t.length&&(s=t.end(t.length-1));var u=Math.max(0,s-r);if(!i.segments.length||u>=this.goalBufferLength_()||!e&&1<=u)return null;if(a===null)return n=this.getSyncSegmentCandidate_(i),this.generateSegmentInfo_(i,n,null,!0);if(n!==null)return i.segments[n],o=s,this.generateSegmentInfo_(i,n+1,o,!1);if(this.fetchAtBuffer_){var c=Bt.getMediaInfoForTime(i,s,a.segmentIndex,a.time);n=c.mediaIndex,o=c.startTime}else{var d=Bt.getMediaInfoForTime(i,r,a.segmentIndex,a.time);n=d.mediaIndex,o=d.startTime}return this.generateSegmentInfo_(i,n,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(t){var i=this;if(this.currentTimeline_===-1)return 0;var n=t.segments.map(function(e,r){return{timeline:e.timeline,segmentIndex:r}}).filter(function(e){return e.timeline===i.currentTimeline_});return n.length?n[Math.min(n.length-1,1)].segmentIndex:Math.max(t.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(t,i,n,e){if(i<0||i>=t.segments.length)return null;var r=t.segments[i];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:i,isSyncRequest:e,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(t){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3)return!1;var i=this.currentTime_(),n=t.bandwidth,e=this.pendingSegment_.duration,r=Bt.estimateSegmentRequestTime(e,n,this.playlist_,t.bytesReceived),a=function(c,d,h){var f=2<arguments.length&&h!==void 0?h:1;return((c.length?c.end(c.length-1):0)-d)/f}(this.buffered_(),i,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=function(c){var d=c.master,h=c.currentTime,f=c.bandwidth,y=c.duration,b=c.segmentDuration,_=c.timeUntilRebuffer,E=c.currentTimeline,S=c.syncController,C=d.playlists.filter(function(B){return!Bt.isIncompatible(B)}),L=C.filter(Bt.isEnabled);L.length||(L=C.filter(function(B){return!Bt.isDisabled(B)}));var D=L.filter(Bt.hasAttribute.bind(null,"BANDWIDTH")).map(function(B){var H=S.getSyncPoint(B,y,E,h)?1:2;return{playlist:B,rebufferingImpact:Bt.estimateSegmentRequestTime(b,f,B)*H-_}}),F=D.filter(function(B){return B.rebufferingImpact<=0});return Yi(F,function(B,H){return Na(H.playlist,B.playlist)}),F.length?F[0]:(Yi(D,function(B,H){return B.rebufferingImpact-H.rebufferingImpact}),D[0]||null)}({master:this.hls_.playlists.master,currentTime:i,bandwidth:n,duration:this.duration_(),segmentDuration:e,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;return a<=1/30&&(u=1),!(!s.playlist||s.playlist.uri===this.playlist_.uri||o<u)&&(this.bandwidth=s.playlist.attributes.BANDWIDTH*Vt.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(t,i){this.pendingSegment_&&i.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(i.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(t){this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),t.abortRequests=yp(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(t),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(t){var i=function(n,e,r){var a=void 0;return a=n.length&&0<n.start(0)&&n.start(0)<e?n.start(0):e-30,Math.min(a,e-r)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);0<i&&this.remove(0,i)}},{key:"createSimplifiedSegmentObj_",value:function(t){var i=t.segment,n={resolvedUri:i.resolvedUri,byterange:i.byterange,requestId:t.requestId};if(i.key){var e=i.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);n.key=this.segmentKey(i.key),n.key.iv=e}return i.map&&(n.map=this.initSegment(i.map)),n}},{key:"segmentRequestFinished_",value:function(t,i){if(this.mediaRequests+=1,i.stats&&(this.mediaBytesTransferred+=i.stats.bytesReceived,this.mediaTransferDuration+=i.stats.roundTripTime),this.pendingSegment_){if(i.requestId===this.pendingSegment_.requestId){if(t)return this.pendingSegment_=null,this.state="READY",t.code===xl?void(this.mediaRequestsAborted+=1):(this.pause(),t.code===Ol?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error")));this.bandwidth=i.stats.bandwidth,this.roundTrip=i.stats.roundTripTime,i.map&&(i.map=this.initSegment(i.map,!0)),i.key&&this.segmentKey(i.key,!0),this.processSegmentResponse_(i)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(t){var i=this.pendingSegment_;i.bytes=t.bytes,t.map&&(i.segment.map.bytes=t.map.bytes),i.endOfAllRequests=t.endOfAllRequests,t.fmp4Captions&&(function(n,e,r){for(var a in r)if(!n[a]){e.trigger({type:"usage",name:"hls-608"});var s=e.textTracks().getTrackById(a);n[a]=s||e.addRemoteTextTrack({kind:"captions",id:a,label:a},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,t.captionStreams),function(n){var e=n.inbandTextTracks,r=n.captionArray,a=n.timestampOffset;if(r){var s=window.WebKitDataCue||window.VTTCue;r.forEach(function(o){var u=o.stream,c=o.startTime,d=o.endTime;e[u]&&(c+=a,d+=a,e[u].addCue(new s(c,d,o.text)))})}}({inbandTextTracks:this.inbandTextTracks_,captionArray:t.fmp4Captions,timestampOffset:0}),this.captionParser_&&this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_){var i=this.pendingSegment_,n=i.segment,e=this.syncController_.probeSegmentInfo(i);typeof this.startingMedia_=="undefined"&&e&&(e.containsAudio||e.containsVideo)&&(this.startingMedia_={containsAudio:e.containsAudio,containsVideo:e.containsVideo});var r=function(d,h,f){return d==="main"&&h&&f?f.containsAudio||f.containsVideo?h.containsVideo&&!f.containsVideo?"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.":!h.containsVideo&&f.containsVideo?"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.startingMedia_,e);if(r)return this.error({message:r,blacklistDuration:1/0}),void this.trigger("error");if(i.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");if(i.timestampOffset!==null&&i.timestampOffset!==this.sourceUpdater_.timestampOffset()){if(e&&e.segmentTimestampInfo){var a=e.segmentTimestampInfo[0].ptsTime,s=e.segmentTimestampInfo[0].dtsTime;i.timestampOffset-=a-s}this.sourceUpdater_.timestampOffset(i.timestampOffset),this.trigger("timestampoffset")}var o=this.syncController_.mappingForTimeline(i.timeline);if(o!==null&&this.trigger({type:"segmenttimemapping",mapping:o}),this.state="APPENDING",n.map){var u=jn(n.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==u){var c=this.initSegment(n.map);this.sourceUpdater_.appendBuffer({bytes:c.bytes},function(){t.activeInitSegmentId_=u})}}i.byteLength=i.bytes.byteLength,typeof n.start=="number"&&typeof n.end=="number"?this.mediaSecondsLoaded+=n.end-n.start:this.mediaSecondsLoaded+=n.duration,this.logger_(function(d){var h=d.segment,f=h.start,y=h.end,b=d.playlist,_=b.mediaSequence,E=b.id,S=b.segments,C=S===void 0?[]:S,L=d.mediaIndex,D=d.timeline;return["appending ["+L+"] of ["+_+", "+(_+C.length)+"] from playlist ["+E+"]","["+f+" => "+y+"] in timeline ["+D+"]"].join(" ")}(i)),this.sourceUpdater_.appendBuffer({bytes:i.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,i.requestId)},this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleVideoSegmentTimingInfo_",value:function(t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment;n.videoTimingInfo||(n.videoTimingInfo={}),n.videoTimingInfo.transmuxerPrependedSeconds=i.videoSegmentTimingInfo.prependedContentDuration||0,n.videoTimingInfo.transmuxedPresentationStart=i.videoSegmentTimingInfo.start.presentation,n.videoTimingInfo.transmuxedPresentationEnd=i.videoSegmentTimingInfo.end.presentation,n.videoTimingInfo.baseMediaDecodeTime=i.videoSegmentTimingInfo.baseMediaDecodeTime}}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_,i=t.segment,n=this.mediaIndex!==null;this.pendingSegment_=null,this.recordThroughput_(t),this.addSegmentMetadataCue_(t),this.state="READY",this.mediaIndex=t.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate"),i.end&&this.currentTime_()-i.end>3*t.playlist.targetDuration?this.resetEverything():(n&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.isEndOfStream_(t.mediaIndex+1,t.playlist)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(t){var i=this.throughput.rate,n=Date.now()-t.endOfAllRequests+1,e=Math.floor(t.byteLength/n*8*1e3);this.throughput.rate+=(e-i)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(this.segmentMetadataTrack_){var i=t.segment,n=i.start,e=i.end;if(Ll(n)&&Ll(e)){oi(n,e,this.segmentMetadataTrack_);var r=k.WebKitDataCue||k.VTTCue,a={custom:i.custom,dateTimeObject:i.dateTimeObject,dateTimeString:i.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.uri,start:n,end:e},s=new r(n,e,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}]),pi);function pi(t){Qt(this,pi);var i=ae(this,(pi.__proto__||Object.getPrototypeOf(pi)).call(this));if(!t)throw new TypeError("Initialization settings are required");if(typeof t.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.hls_=t.hls,i.loaderType_=t.loaderType,i.startingMedia_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.mimeType_=null,i.sourceUpdater_=null,i.xhrOptions_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.loaderType_==="main"?i.captionParser_=new Rd:i.captionParser_=null,i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.syncController_.on("syncinfoupdate",function(){return i.trigger("syncinfoupdate")}),i.mediaSource_.addEventListener("sourceopen",function(){return i.ended_=!1}),i.fetchAtBuffer_=!1,i.logger_=Ki("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(i,"state",{get:function(){return this.state_},set:function(n){n!==this.state_&&(this.logger_(this.state_+" -> "+n),this.state_=n)}}),i}function Dl(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))}var Ul=new Uint8Array(`
`.split("").map(function(t){return t.charCodeAt(0)})),vp=(ce(fi,Ba),ie(fi,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return w.createTimeRanges();var t=this.subtitlesTrack_.cues,i=t[0].startTime,n=t[t.length-1].startTime;return w.createTimeRanges([[i,n]])}},{key:"initSegment",value:function(t,i){var n=1<arguments.length&&i!==void 0&&i;if(!t)return null;var e=jn(t),r=this.initSegments_[e];if(n&&!r&&t.bytes){var a=Ul.byteLength+t.bytes.byteLength,s=new Uint8Array(a);s.set(t.bytes),s.set(Ul,t.bytes.byteLength),this.initSegments_[e]=r={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:s}}return r||t}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(t){return typeof t=="undefined"||(this.subtitlesTrack_=t,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(t,i){oi(t,i,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var t=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var i=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(i=this.skipEmptySegments_(i)){if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null)return this.syncController_.one("timestampoffset",function(){t.state="READY",t.paused()||t.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(i)}}},{key:"skipEmptySegments_",value:function(t){for(;t&&t.segment.empty;)t=this.generateSegmentInfo_(t.playlist,t.mediaIndex+1,t.startOfSegment+t.duration,t.isSyncRequest);return t}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var i=this.pendingSegment_,n=i.segment;if(typeof k.WebVTT!="function"&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){let a=function(){t.subtitlesTrack_.tech_.off("vttjsloaded",e),t.error({message:"Error loading vtt.js"}),t.state="READY",t.pause(),t.trigger("error")};var r=a,e=void 0;return e=function(){t.subtitlesTrack_.tech_.off("vttjserror",a),t.handleSegment_()},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",e),void this.subtitlesTrack_.tech_.one("vttjserror",a)}n.requested=!0;try{this.parseVTTCues_(i)}catch(a){return this.error({message:a.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,i.cues.length&&this.remove(i.cues[0].endTime,i.cues[i.cues.length-1].endTime),i.cues.forEach(function(a){t.subtitlesTrack_.addCue(a)}),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(t){var i=void 0,n=!1;typeof k.TextDecoder=="function"?i=new k.TextDecoder("utf8"):(i=k.WebVTT.StringDecoder(),n=!0);var e=new k.WebVTT.Parser(k,k.vttjs,i);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},e.oncue=t.cues.push.bind(t.cues),e.ontimestampmap=function(s){return t.timestampmap=s},e.onparsingerror=function(s){w.log.warn("Error encountered when parsing cues: "+s.message)},t.segment.map){var r=t.segment.map.bytes;n&&(r=Dl(r)),e.parse(r)}var a=t.bytes;n&&(a=Dl(a)),e.parse(a),e.flush()}},{key:"updateTimeMapping_",value:function(t,i,n){var e=t.segment;if(i)if(t.cues.length){var r=t.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+i.mapping;if(t.cues.forEach(function(u){u.startTime+=a,u.endTime+=a}),!n.syncInfo){var s=t.cues[0].startTime,o=t.cues[t.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+t.mediaIndex,time:Math.min(s,o-e.duration)}}}else e.empty=!0}}]),fi);function fi(t){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};Qt(this,fi);var n=ae(this,(fi.__proto__||Object.getPrototypeOf(fi)).call(this,t,i));return n.mediaSource_=null,n.subtitlesTrack_=null,n}function _p(t,i){for(var n=t.cues,e=0;e<n.length;e++){var r=n[e];if(i>=r.adStartTime&&i<=r.adEndTime)return r}return null}var bp=Xd,Rl=[{name:"VOD",run:function(t,i,n,e,r){return n===1/0?null:{time:0,segmentIndex:0}}},{name:"ProgramDateTime",run:function(t,i,n,e,r){if(!t.datetimeToDisplayTime)return null;var a=i.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var c=a[u];if(c.dateTimeObject){var d=c.dateTimeObject.getTime()/1e3+t.datetimeToDisplayTime,h=Math.abs(r-d);if(o!==null&&(h===0||o<h))break;o=h,s={time:d,segmentIndex:u}}}return s}},{name:"Segment",run:function(t,i,n,e,r){var a=i.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var c=a[u];if(c.timeline===e&&typeof c.start!="undefined"){var d=Math.abs(r-c.start);if(o!==null&&o<d)break;(!s||o===null||d<=o)&&(o=d,s={time:c.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(t,i,n,e,r){var a=null;if(r=r||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var s=null,o=0;o<i.discontinuityStarts.length;o++){var u=i.discontinuityStarts[o],c=i.discontinuitySequence+o+1,d=t.discontinuities[c];if(d){var h=Math.abs(r-d.time);if(s!==null&&s<h)break;(!a||s===null||h<=s)&&(s=h,a={time:d.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(t,i,n,e,r){return i.syncInfo?{time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence}:null}}],Tp=(ce(mi,w.EventTarget),ie(mi,[{key:"getSyncPoint",value:function(t,i,n,e){var r=this.runStrategies_(t,i,n,e);return r.length?this.selectSyncPoint_(r,{key:"time",value:e}):null}},{key:"getExpiredTime",value:function(t,i){if(!t||!t.segments)return null;var n=this.runStrategies_(t,i,t.discontinuitySequence,0);if(!n.length)return null;var e=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return 0<e.segmentIndex&&(e.time*=-1),Math.abs(e.time+$i(t,e.segmentIndex,0))}},{key:"runStrategies_",value:function(t,i,n,e){for(var r=[],a=0;a<Rl.length;a++){var s=Rl[a],o=s.run(this,t,i,n,e);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(t,i){for(var n=t[0].syncPoint,e=Math.abs(t[0].syncPoint[i.key]-i.value),r=t[0].strategy,a=1;a<t.length;a++){var s=Math.abs(t[a].syncPoint[i.key]-i.value);s<e&&(e=s,n=t[a].syncPoint,r=t[a].strategy)}return this.logger_("syncPoint for ["+i.key+": "+i.value+"] chosen with strategy ["+r+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+"]"),n}},{key:"saveExpiredSegmentInfo",value:function(t,i){for(var n=i.mediaSequence-t.mediaSequence-1;0<=n;n--){var e=t.segments[n];if(e&&typeof e.start!="undefined"){i.syncInfo={mediaSequence:t.mediaSequence+n,time:e.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+", mediaSequence: "+i.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(t){if(!this.datetimeToDisplayTime&&t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var i=t.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-i}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(t){var i=t.segment,n=t.playlist,e=void 0;return(e=i.map?this.probeMp4Segment_(t):this.probeTsSegment_(t))&&this.calculateSegmentTimeMapping_(t,e)&&(this.saveDiscontinuitySyncInfo_(t),n.syncInfo||(n.syncInfo={mediaSequence:n.mediaSequence+t.mediaIndex,time:i.start})),e}},{key:"probeMp4Segment_",value:function(t){var i=t.segment,n=re.timescale(i.map.bytes),e=re.startTime(n,t.bytes);return t.timestampOffset!==null&&(t.timestampOffset-=e),{start:e,end:e+i.duration}}},{key:"probeTsSegment_",value:function(t){var i=bp(t.bytes,this.inspectCache_),n=void 0,e=void 0,r=void 0;return i?(i.video&&i.video.length===2?(this.inspectCache_=i.video[1].dts,n=i.video[0].dtsTime,e=i.video[1].dtsTime,r=i.video):i.audio&&i.audio.length===2&&(this.inspectCache_=i.audio[1].dts,n=i.audio[0].dtsTime,e=i.audio[1].dtsTime,r=i.audio),{segmentTimestampInfo:r,start:n,end:e,containsVideo:i.video&&i.video.length===2,containsAudio:i.audio&&i.audio.length===2}):null}},{key:"timestampOffsetForTimeline",value:function(t){return typeof this.timelines[t]=="undefined"?null:this.timelines[t].time}},{key:"mappingForTimeline",value:function(t){return typeof this.timelines[t]=="undefined"?null:this.timelines[t].mapping}},{key:"calculateSegmentTimeMapping_",value:function(t,i){var n=t.segment,e=this.timelines[t.timeline];if(t.timestampOffset!==null)e={time:t.startOfSegment,mapping:t.startOfSegment-i.start},this.timelines[t.timeline]=e,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+e.time+"] [mapping: "+e.mapping+"]"),n.start=t.startOfSegment,n.end=i.end+e.mapping;else{if(!e)return!1;n.start=i.start+e.mapping,n.end=i.end+e.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(t){var i=t.playlist,n=t.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(i.discontinuityStarts&&i.discontinuityStarts.length)for(var e=0;e<i.discontinuityStarts.length;e++){var r=i.discontinuityStarts[e],a=i.discontinuitySequence+e+1,s=r-t.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?n.start-$i(i,t.mediaIndex,r):n.end+$i(i,t.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}}]),mi);function mi(){Qt(this,mi);var t=ae(this,(mi.__proto__||Object.getPrototypeOf(mi)).call(this));return t.inspectCache_=void 0,t.timelines=[],t.discontinuities=[],t.datetimeToDisplayTime=null,t.logger_=Ki("SyncController"),t}function Hn(t,i){t.abort(),t.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)}function Ml(t,i){(i.activePlaylistLoader=t).load()}function Sp(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(c){Cp[c](c,t)});var i=t.mediaTypes,n=t.masterPlaylistLoader,e=t.tech,r=t.hls;["AUDIO","SUBTITLES"].forEach(function(c){i[c].activeGroup=function(d,h){return function(f){var y=h.masterPlaylistLoader,b=h.mediaTypes[d].groups,_=y.media();if(!_)return null;var E=null;return _.attributes[d]&&(E=b[_.attributes[d]]),E=E||b.main,typeof f=="undefined"?E:f===null?null:E.filter(function(S){return S.id===f.id})[0]||null}}(c,t),i[c].activeTrack=Ep[c](c,t),i[c].onGroupChanged=function(d,h){return function(){var f=h.segmentLoaders,y=f[d],b=f.main,_=h.mediaTypes[d],E=_.activeTrack(),S=_.activeGroup(E),C=_.activePlaylistLoader;Hn(y,_),S&&(S.playlistLoader?(y.resyncLoader(),Ml(S.playlistLoader,_)):C&&b.resetEverything())}}(c,t),i[c].onTrackChanged=function(d,h){return function(){var f=h.segmentLoaders,y=f[d],b=f.main,_=h.mediaTypes[d],E=_.activeTrack(),S=_.activeGroup(E),C=_.activePlaylistLoader;Hn(y,_),S&&(S.playlistLoader?(C!==S.playlistLoader&&(y.track&&y.track(E),y.resetEverything()),Ml(S.playlistLoader,_)):b.resetEverything())}}(c,t)});var a=i.AUDIO.activeGroup(),s=(a.filter(function(c){return c.default})[0]||a[0]).id;function o(){i.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"hls-audio-change"})}for(var u in i.AUDIO.tracks[s].enabled=!0,i.AUDIO.onTrackChanged(),n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(c){return i[c].onGroupChanged()})}),e.audioTracks().addEventListener("change",o),e.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged),r.on("dispose",function(){e.audioTracks().removeEventListener("change",o),e.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)}),e.clearTracks("audio"),i.AUDIO.tracks)e.audioTracks().addTrack(i.AUDIO.tracks[u])}var kp=new pl("./decrypter-worker.worker.js",function(t,i){var n,e,r,a,s,o,u,c=this;n=function(S,C,L){return C&&h(S.prototype,C),L&&h(S,L),S},e=null,f.prototype.decrypt=function(S,C,L,D,F,B){var H=this._key[1],V=S^H[0],R=D^H[1],W=L^H[2],et=C^H[3],tt=void 0,Tt=void 0,St=void 0,qt=H.length/4-2,Y=void 0,ot=4,ut=this._tables[1],mt=ut[0],kt=ut[1],rt=ut[2],se=ut[3],Ut=ut[4];for(Y=0;Y<qt;Y++)tt=mt[V>>>24]^kt[R>>16&255]^rt[W>>8&255]^se[255&et]^H[ot],Tt=mt[R>>>24]^kt[W>>16&255]^rt[et>>8&255]^se[255&V]^H[ot+1],St=mt[W>>>24]^kt[et>>16&255]^rt[V>>8&255]^se[255&R]^H[ot+2],et=mt[et>>>24]^kt[V>>16&255]^rt[R>>8&255]^se[255&W]^H[ot+3],ot+=4,V=tt,R=Tt,W=St;for(Y=0;Y<4;Y++)F[(3&-Y)+B]=Ut[V>>>24]<<24^Ut[R>>16&255]<<16^Ut[W>>8&255]<<8^Ut[255&et]^H[ot++],tt=V,V=R,R=W,W=et,et=tt},r=f,y.prototype.on=function(S,C){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push(C)},y.prototype.off=function(S,C){if(!this.listeners[S])return!1;var L=this.listeners[S].indexOf(C);return this.listeners[S].splice(L,1),-1<L},y.prototype.trigger=function(S,C){var L=this.listeners[S];if(L)if(arguments.length===2)for(var D=L.length,F=0;F<D;++F)L[F].call(this,C);else for(var B=Array.prototype.slice.call(arguments,1),H=L.length,V=0;V<H;++V)L[V].apply(this,B)},y.prototype.dispose=function(){this.listeners={}},y.prototype.pipe=function(S){this.on("data",function(C){S.push(C)})},function(S,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);S.prototype=Object.create(C&&C.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(S,C):S.__proto__=C)}(b,s=a=y),b.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},b.prototype.push=function(S){this.jobs.push(S),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},o=b,E.prototype.decryptChunk_=function(S,C,L,D){return function(){var F=function(B,H,V){var R=new Int32Array(B.buffer,B.byteOffset,B.byteLength>>2),W=new r(Array.prototype.slice.call(H)),et=new Uint8Array(B.byteLength),tt=new Int32Array(et.buffer),Tt=void 0,St=void 0,qt=void 0,Y=void 0,ot=void 0,ut=void 0,mt=void 0,kt=void 0,rt=void 0;for(Tt=V[0],St=V[1],qt=V[2],Y=V[3],rt=0;rt<R.length;rt+=4)ot=_(R[rt]),ut=_(R[rt+1]),mt=_(R[rt+2]),kt=_(R[rt+3]),W.decrypt(ot,ut,mt,kt,tt,rt),tt[rt]=_(tt[rt]^Tt),tt[rt+1]=_(tt[rt+1]^St),tt[rt+2]=_(tt[rt+2]^qt),tt[rt+3]=_(tt[rt+3]^Y),Tt=ot,St=ut,qt=mt,Y=kt;return et}(S,C,L);D.set(F,S.byteOffset)}},n(E,null,[{key:"STEP",get:function(){return 32e3}}]),u=E,new function(S){S.onmessage=function(C){var L=C.data,D=new Uint8Array(L.encrypted.bytes,L.encrypted.byteOffset,L.encrypted.byteLength),F=new Uint32Array(L.key.bytes,L.key.byteOffset,L.key.byteLength/4),B=new Uint32Array(L.iv.bytes,L.iv.byteOffset,L.iv.byteLength/4);new u(D,F,B,function(H,V){S.postMessage(function(R){var W={};return Object.keys(R).forEach(function(et){var tt=R[et];ArrayBuffer.isView(tt)?W[et]={bytes:tt.buffer,byteOffset:tt.byteOffset,byteLength:tt.byteLength}:W[et]=tt}),W}({source:L.source,decrypted:V}),[V.buffer])})}}(c);function d(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function h(S,C){for(var L=0;L<C.length;L++){var D=C[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(S,D.key,D)}}function f(S){d(this,f),e=e||function(){var et=[[[],[],[],[],[]],[[],[],[],[],[]]],tt=et[0],Tt=et[1],St=tt[4],qt=Tt[4],Y=void 0,ot=void 0,ut=void 0,mt=[],kt=[],rt=void 0,se=void 0,Ut=void 0,Fe=void 0,He=void 0;for(Y=0;Y<256;Y++)kt[(mt[Y]=Y<<1^283*(Y>>7))^Y]=Y;for(ot=ut=0;!St[ot];ot^=rt||1,ut=kt[ut]||1)for(Ut=(Ut=ut^ut<<1^ut<<2^ut<<3^ut<<4)>>8^255&Ut^99,He=16843009*mt[se=mt[rt=mt[qt[St[ot]=Ut]=ot]]]^65537*se^257*rt^16843008*ot,Fe=257*mt[Ut]^16843008*Ut,Y=0;Y<4;Y++)tt[Y][ot]=Fe=Fe<<24^Fe>>>8,Tt[Y][Ut]=He=He<<24^He>>>8;for(Y=0;Y<5;Y++)tt[Y]=tt[Y].slice(0),Tt[Y]=Tt[Y].slice(0);return et}(),this._tables=[[e[0][0].slice(),e[0][1].slice(),e[0][2].slice(),e[0][3].slice(),e[0][4].slice()],[e[1][0].slice(),e[1][1].slice(),e[1][2].slice(),e[1][3].slice(),e[1][4].slice()]];var C=void 0,L=void 0,D=void 0,F=void 0,B=void 0,H=this._tables[0][4],V=this._tables[1],R=S.length,W=1;if(R!==4&&R!==6&&R!==8)throw new Error("Invalid aes key size");for(F=S.slice(0),B=[],this._key=[F,B],C=R;C<4*R+28;C++)D=F[C-1],(C%R==0||R===8&&C%R==4)&&(D=H[D>>>24]<<24^H[D>>16&255]<<16^H[D>>8&255]<<8^H[255&D],C%R==0&&(D=D<<8^D>>>24^W<<24,W=W<<1^283*(W>>7))),F[C]=F[C-R]^D;for(L=0;C;L++,C--)D=F[3&L?C:C-4],B[L]=C<=4||L<4?D:V[0][H[D>>>24]]^V[1][H[D>>16&255]]^V[2][H[D>>8&255]]^V[3][H[255&D]]}function y(){d(this,y),this.listeners={}}function b(){d(this,b);var S=function(C,L){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!L||typeof L!="object"&&typeof L!="function"?C:L}(this,s.call(this,a));return S.jobs=[],S.delay=1,S.timeout_=null,S}function _(S){return S<<24|(65280&S)<<8|(16711680&S)>>8|S>>>24}function E(S,C,L,D){d(this,E);var F=E.STEP,B=new Int32Array(S.buffer),H=new Uint8Array(S.byteLength),V=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(B.subarray(V,V+F),C,L,H)),V=F;V<B.length;V+=F)L=new Uint32Array([_(B[V-4]),_(B[V-3]),_(B[V-2]),_(B[V-1])]),this.asyncStream_.push(this.decryptChunk_(B.subarray(V,V+F),C,L,H));this.asyncStream_.push(function(){D(null,function(R){return R.subarray(0,R.byteLength-R[R.byteLength-1])}(H))})}}),Vn={AUDIO:function(t,i){return function(){var n=i.segmentLoaders[t],e=i.mediaTypes[t],r=i.blacklistCurrentPlaylist;Hn(n,e);var a=e.activeTrack(),s=e.activeGroup(),o=(s.filter(function(d){return d.default})[0]||s[0]).id,u=e.tracks[o];if(a!==u){for(var c in w.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[c].enabled=e.tracks[c]===u;e.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(t,i){return function(){var n=i.segmentLoaders[t],e=i.mediaTypes[t];w.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Hn(n,e);var r=e.activeTrack();r&&(r.mode="disabled"),e.onTrackChanged()}}},Nl={AUDIO:function(t,i,n){if(i){var e=n.tech,r=n.requestOptions,a=n.segmentLoaders[t];i.on("loadedmetadata",function(){var s=i.media();a.playlist(s,r),(!e.paused()||s.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),r),e.paused()||a.load()}),i.on("error",Vn[t](t,n))}},SUBTITLES:function(t,i,n){var e=n.tech,r=n.requestOptions,a=n.segmentLoaders[t],s=n.mediaTypes[t];i.on("loadedmetadata",function(){var o=i.media();a.playlist(o,r),a.track(s.activeTrack()),(!e.paused()||o.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),r),e.paused()||a.load()}),i.on("error",Vn[t](t,n))}},Cp={AUDIO:function(t,i){var n,e,r=i.hls,a=i.sourceType,s=i.segmentLoaders[t],o=i.requestOptions,u=i.master.mediaGroups,c=i.mediaTypes[t],d=c.groups,h=c.tracks,f=i.masterPlaylistLoader;for(var y in u[t]&&Object.keys(u[t]).length!==0||(u[t]={main:{default:{default:!0}}}),u[t])for(var b in d[y]||(d[y]=[]),u[t][y]){var _=u[t][y][b],E=void 0;if(E=_.resolvedUri?new Nn(_.resolvedUri,r,o):_.playlists&&a==="dash"?new Ua(_.playlists[0],r,o,f):null,_=w.mergeOptions({id:b,playlistLoader:E},_),Nl[t](t,_.playlistLoader,i),d[y].push(_),typeof h[b]=="undefined"){var S=new w.AudioTrack({id:b,kind:(n=_,e=void 0,e=n.default?"main":"alternative",n.characteristics&&0<=n.characteristics.indexOf("public.accessibility.describes-video")&&(e="main-desc"),e),enabled:!1,language:_.language,default:_.default,label:b});h[b]=S}}s.on("error",Vn[t](t,i))},SUBTITLES:function(t,i){var n=i.tech,e=i.hls,r=i.sourceType,a=i.segmentLoaders[t],s=i.requestOptions,o=i.master.mediaGroups,u=i.mediaTypes[t],c=u.groups,d=u.tracks,h=i.masterPlaylistLoader;for(var f in o[t])for(var y in c[f]||(c[f]=[]),o[t][f])if(!o[t][f][y].forced){var b=o[t][f][y],_=void 0;if(r==="hls"?_=new Nn(b.resolvedUri,e,s):r==="dash"&&(_=new Ua(b.playlists[0],e,s,h)),b=w.mergeOptions({id:y,playlistLoader:_},b),Nl[t](t,b.playlistLoader,i),c[f].push(b),typeof d[y]=="undefined"){var E=n.addRemoteTextTrack({id:y,kind:"subtitles",default:b.default&&b.autoselect,language:b.language,label:y},!1).track;d[y]=E}}a.on("error",Vn[t](t,i))},"CLOSED-CAPTIONS":function(t,i){var n=i.tech,e=i.master.mediaGroups,r=i.mediaTypes[t],a=r.groups,s=r.tracks;for(var o in e[t])for(var u in a[o]||(a[o]=[]),e[t][o]){var c=e[t][o][u];if(c.instreamId.match(/CC\d/)&&(a[o].push(w.mergeOptions({id:u},c)),typeof s[u]=="undefined")){var d=n.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default&&c.autoselect,language:c.language,label:u},!1).track;s[u]=d}}}},Ep={AUDIO:function(t,i){return function(){var n=i.mediaTypes[t].tracks;for(var e in n)if(n[e].enabled)return n[e];return null}},SUBTITLES:function(t,i){return function(){var n=i.mediaTypes[t].tracks;for(var e in n)if(n[e].mode==="showing")return n[e];return null}}},ve=void 0,wp=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],Ap=(ce(gi,w.EventTarget),ie(gi,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var i=t.masterPlaylistLoader_.media(),n=1.5*i.targetDuration*1e3;Ea(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=n,i.endList&&t.tech_.preload()!=="none"&&(t.mainSegmentLoader_.playlist(i,t.requestOptions_),t.mainSegmentLoader_.load()),Sp({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,hls:t.hls_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)}),t.triggerPresenceUsage_(t.master(),i);try{t.setupSourceBuffers_()}catch(e){return w.log.warn("Failed to create SourceBuffers",e),t.mediaSource.endOfStream("decode")}t.setupFirstPlay(),!t.mediaTypes_.AUDIO.activePlaylistLoader||t.mediaTypes_.AUDIO.activePlaylistLoader.media()?t.trigger("selectedinitialmedia"):t.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){t.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var i=t.masterPlaylistLoader_.media();if(!i){t.excludeUnsupportedVariants_();var n=void 0;return t.enableLowInitialPlaylist&&(n=t.selectInitialPlaylist()),n=n||t.selectPlaylist(),t.initialMedia_=n,void t.masterPlaylistLoader_.media(t.initialMedia_)}if(t.useCueTags_&&t.updateAdCues_(i),t.mainSegmentLoader_.playlist(i,t.requestOptions_),t.updateDuration(),t.tech_.paused()||(t.mainSegmentLoader_.load(),t.audioSegmentLoader_&&t.audioSegmentLoader_.load()),!i.endList){let r=function(){var a=t.seekable();a.length!==0&&t.mediaSource.addSeekableRange_(a.start(0),a.end(0))};var e=r;t.duration()!==1/0?t.tech_.one("durationchange",function a(){t.duration()===1/0?r():t.tech_.one("durationchange",a)}):r()}}),this.masterPlaylistLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){t.mainSegmentLoader_.abort(),t.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var i=t.masterPlaylistLoader_.media(),n=1.5*i.targetDuration*1e3;Ea(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=n,t.mainSegmentLoader_.playlist(i,t.requestOptions_),t.mainSegmentLoader_.load(),t.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var i=t.masterPlaylistLoader_.media();t.stuckAtPlaylistEnd_(i)&&(t.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),t.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function(t,i){var n=t.mediaGroups||{},e=!0,r=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a])n.AUDIO[a][s].uri||(e=!1);e&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),ve.Playlist.isAes(i)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),ve.Playlist.isFmp4(i)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&1<Object.keys(n.AUDIO[r[0]]).length&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var t=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var i=t.selectPlaylist(),n=t.masterPlaylistLoader_.media(),e=t.tech_.buffered(),r=e.length?e.end(e.length-1)-t.tech_.currentTime():0,a=t.bufferLowWaterLine();(!n.endList||t.duration()<Vt.MAX_BUFFER_LOW_WATER_LINE||i.attributes.BANDWIDTH<n.attributes.BANDWIDTH||a<=r)&&t.masterPlaylistLoader_.media(i),t.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){t.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(){t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)}),this.mainSegmentLoader_.on("reseteverything",function(){t.tech_.trigger("hls-reset")}),this.mainSegmentLoader_.on("segmenttimemapping",function(i){t.tech_.trigger({type:"hls-segment-time-mapping",mapping:i.mapping})}),this.audioSegmentLoader_.on("ended",function(){t.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var t=this,i=this.selectPlaylist();i!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(i),this.mainSegmentLoader_.resetEverything(function(){w.browser.IE_VERSION||w.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.seekTo_(t.end(t.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var t=this,i=this.masterPlaylistLoader_.media();if(!i||this.tech_.paused()||this.hasPlayed_())return!1;if(!i.endList){var n=this.seekable();if(!n.length)return!1;if(w.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){t.trigger("firstplay"),t.seekTo_(n.end(0)),t.hasPlayed_=function(){return!0}}),!1;this.trigger("firstplay"),this.seekTo_(n.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(i){return w.log.warn("Failed to create Source Buffers",i),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var t=this.tech_.play();typeof t!="undefined"&&typeof t.then=="function"&&t.then(null,function(i){})}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?t&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),t){this.logger_("calling mediaSource.endOfStream()");try{this.mediaSource.endOfStream()}catch(i){w.log.warn("Failed to call media source endOfStream",i)}}}},{key:"stuckAtPlaylistEnd_",value:function(t){if(!this.seekable().length)return!1;var i=this.syncController_.getExpiredTime(t,this.mediaSource.duration);if(i===null)return!1;var n=ve.Playlist.playlistEnd(t,i),e=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return n-e<=.1;var a=r.end(r.length-1);return a-e<=.1&&n-a<=.1}},{key:"blacklistCurrentPlaylist",value:function(t,i){var n,e=0<arguments.length&&t!==void 0?t:{},r=i,a=void 0;if(a=e.playlist||this.masterPlaylistLoader_.media(),r=r||e.blacklistDuration||this.blacklistDuration,!a){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(u){return this.trigger("error")}}var s=this.masterPlaylistLoader_.master.playlists.filter(Bn).length===1,o=this.masterPlaylistLoader_.master.playlists;return o.length===1?(w.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s)):(s&&(w.log.warn("Removing all playlists from the blacklist because the last rendition is about to be blacklisted."),o.forEach(function(u){u.excludeUntil!==1/0&&delete u.excludeUntil}),this.tech_.trigger("retryplaylist")),a.excludeUntil=Date.now()+1e3*r,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),w.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n,s))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(t){var i=ul(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?i&&i.length?t:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:ve.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var t=void 0,i=void 0;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var e=this.syncController_.getExpiredTime(n,this.mediaSource.duration);if(e!==null&&(t=ve.Playlist.seekable(n,e)).length!==0){if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),(e=this.syncController_.getExpiredTime(n,this.mediaSource.duration))===null||(i=ve.Playlist.seekable(n,e)).length===0))return;var r=void 0,a=void 0;this.seekable_&&this.seekable_.length&&(r=this.seekable_.end(0),a=this.seekable_.start(0)),i?i.start(0)>t.end(0)||t.start(0)>i.end(0)?this.seekable_=t:this.seekable_=w.createTimeRanges([[i.start(0)>t.start(0)?i.start(0):t.start(0),i.end(0)<t.end(0)?i.end(0):t.end(0)]]):this.seekable_=t,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===r&&this.seekable_.start(0)===a||(this.logger_("seekable updated ["+Aa(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},{key:"updateDuration",value:function(){function t(){i.logger_("Setting duration from "+i.mediaSource.duration+" => "+e);try{i.mediaSource.duration=e}catch(a){w.log.warn("Failed to set media source duration",a)}i.tech_.trigger("durationchange"),i.mediaSource.removeEventListener("sourceopen",t)}var i=this,n=this.mediaSource.duration,e=ve.Playlist.duration(this.masterPlaylistLoader_.media()),r=this.tech_.buffered();0<r.length&&(e=Math.max(e,r.end(r.length-1))),n!==e&&(this.mediaSource.readyState!=="open"?this.mediaSource.addEventListener("sourceopen",t):t())}},{key:"dispose",value:function(){var t=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach(function(i){var n=t.mediaTypes_[i].groups;for(var e in n)n[e].forEach(function(r){r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var t,i=this.masterPlaylistLoader_.media();if(i&&this.mediaSource.readyState==="open"){if((t=hp(this.masterPlaylistLoader_.master,i)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+i.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(t),this.excludeIncompatibleVariants_(i)}}},{key:"configureLoaderMimeTypes_",value:function(t){var i=1<t.length&&t[0].indexOf(",")===-1&&t[0]!==t[1]?new w.EventTarget:null;this.mainSegmentLoader_.mimeType(t[0],i),t[1]&&this.audioSegmentLoader_.mimeType(t[1],i)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach(function(t){t.attributes.CODECS&&k.MediaSource&&k.MediaSource.isTypeSupported&&!k.MediaSource.isTypeSupported('video/mp4; codecs="'+function(i){return i.replace(/avc1\.(\d+)\.(\d+)/i,function(n){return yl([n])[0]})}(t.attributes.CODECS)+'"')&&(t.excludeUntil=1/0)})}},{key:"excludeIncompatibleVariants_",value:function(t){var i=2,n=null,e=void 0;t.attributes.CODECS&&(e=Gi(t.attributes.CODECS),n=e.videoCodec,i=e.codecCount),this.master().playlists.forEach(function(r){var a={codecCount:2,videoCodec:null};r.attributes.CODECS&&(a=Gi(r.attributes.CODECS)),a.codecCount!==i&&(r.excludeUntil=1/0),a.videoCodec!==n&&(r.excludeUntil=1/0)})}},{key:"updateAdCues_",value:function(t){var i=0,n=this.seekable();n.length&&(i=n.start(0)),function(e,r,a){var s=2<arguments.length&&a!==void 0?a:0;if(e.segments)for(var o=s,u=void 0,c=0;c<e.segments.length;c++){var d=e.segments[c];if(u=u||_p(r,o+d.duration/2)){if("cueIn"in d){u.endTime=o,u.adEndTime=o,o+=d.duration,u=null;continue}if(o<u.endTime){o+=d.duration;continue}u.endTime+=d.duration}else if("cueOut"in d&&((u=new k.VTTCue(o,o+d.duration,d.cueOut)).adStartTime=o,u.adEndTime=o+parseFloat(d.cueOut),r.addCue(u)),"cueOutCont"in d){var h,f,y=d.cueOutCont.split("/").map(parseFloat),b=Jd(y,2);h=b[0],f=b[1],(u=new k.VTTCue(o,o+d.duration,"")).adStartTime=o-h,u.adEndTime=u.adStartTime+f,r.addCue(u)}o+=d.duration}}(t,this.cueTagsTrack_,i)}},{key:"goalBufferLength",value:function(){var t=this.tech_.currentTime(),i=Vt.GOAL_BUFFER_LENGTH,n=Vt.GOAL_BUFFER_LENGTH_RATE,e=Math.max(i,Vt.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+t*n,e)}},{key:"bufferLowWaterLine",value:function(){var t=this.tech_.currentTime(),i=Vt.BUFFER_LOW_WATER_LINE,n=Vt.BUFFER_LOW_WATER_LINE_RATE,e=Math.max(i,Vt.MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+t*n,e)}}]),gi);function gi(t){Qt(this,gi);var i=ae(this,(gi.__proto__||Object.getPrototypeOf(gi)).call(this)),n=t.url,e=t.handleManifestRedirects,r=t.withCredentials,a=t.tech,s=t.bandwidth,o=t.externHls,u=t.useCueTags,c=t.blacklistDuration,d=t.enableLowInitialPlaylist,h=t.sourceType,f=t.seekTo,y=t.cacheEncryptionKeys;if(!n)throw new Error("A non-empty playlist URL is required");ve=o,i.withCredentials=r,i.tech_=a,i.hls_=a.hls,i.seekTo_=f,i.sourceType_=h,i.useCueTags_=u,i.blacklistDuration=c,i.enableLowInitialPlaylist=d,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:r,handleManifestRedirects:e,timeout:null},i.mediaTypes_=function(){var _={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(E){_[E]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:di,activeTrack:di,onGroupChanged:di,onTrackChanged:di}}),_}(),i.mediaSource=new w.MediaSource,i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_.bind(i)),i.seekable_=w.createTimeRanges(),i.hasPlayed_=function(){return!1},i.syncController_=new Tp(t),i.segmentMetadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new kp,i.inbandTextTracks_={};var b={hls:i.hls_,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.mediaSource.duration},hasPlayed:function(){return i.hasPlayed_()},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:s,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:y};return i.masterPlaylistLoader_=i.sourceType_==="dash"?new Ua(n,i.hls_,i.requestOptions_):new Nn(n,i.hls_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new Ba(w.mergeOptions(b,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new Ba(w.mergeOptions(b,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new vp(w.mergeOptions(b,{loaderType:"vtt"}),t),i.setupSegmentLoaderListeners_(),wp.forEach(function(_){i[_+"_"]=function(E){return this.audioSegmentLoader_[E]+this.mainSegmentLoader_[E]}.bind(i,_)}),i.logger_=Ki("MPC"),i.masterPlaylistLoader_.load(),i}function Bl(t,i,n){Qt(this,Bl);var e=t.masterPlaylistController_,r=e[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(e);if(i.attributes.RESOLUTION){var a=i.attributes.RESOLUTION;this.width=a.width,this.height=a.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=n,this.enabled=function(s,o,u){return function(c){var d=s.master.playlists[o],h=Ca(d),f=Bn(d);return typeof c=="undefined"?f:(c?delete d.disabled:d.disabled=!0,c===f||h||(u(),c?s.trigger("renditionenabled"):s.trigger("renditiondisabled")),c)}}(t.playlists,i.uri,r)}var jl=["seeking","seeked","pause","playing","error"],Pp=(ie(ja,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var t=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===t&&(!i.length||t+.1>=i.end(i.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=t)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){if(!this.tech_.seeking())return!1;var t=this.seekable(),i=this.tech_.currentTime(),n=void 0;return this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)&&(n=t.start(0)+.1),typeof n!="undefined"&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Aa(t)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var t=this.tech_.currentTime(),i=this.tech_.buffered(),n=ul(i,t);return n.length&&t+3<=n.end(0)?(this.cancelTimer_(),this.seekTo(t),this.logger_("Stopped at "+t+" 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:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var t=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()||this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(t,i)){var n=t.end(t.length-1);return this.logger_("Fell out of live window at time "+i+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.seekTo(n),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var e=this.tech_.buffered(),r=ll(e,i);if(this.videoUnderflow_(r,e,i))return this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(0<r.length){var a=r.start(0)-i;return this.logger_("Stopped at "+i+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,i),!0}return!1}},{key:"afterSeekableWindow_",value:function(t,i,n,e){var r=3<arguments.length&&e!==void 0&&e;if(!t.length)return!1;var a=t.end(t.length-1)+.1;return!n.endList&&r&&(a=t.end(t.length-1)+3*n.targetDuration),a<i}},{key:"beforeSeekableWindow_",value:function(t,i){return!!(t.length&&0<t.start(0)&&i<t.start(0)-.1)}},{key:"videoUnderflow_",value:function(t,i,n){if(t.length===0){var e=this.gapFromVideoUnderflow_(i,n);if(e)return this.logger_("Encountered a gap in video from "+e.start+" to "+e.end+". Seeking to current time "+n),!0}return!1}},{key:"skipTheGap_",value:function(t){var i=this.tech_.buffered(),n=this.tech_.currentTime(),e=ll(i,n);this.cancelTimer_(),e.length!==0&&n===t&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",t,"nextRange start:",e.start(0)),this.seekTo(e.start(0)+1/30),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(t,i){for(var n=function(s){if(s.length<2)return w.createTimeRanges();for(var o=[],u=1;u<s.length;u++){var c=s.end(u-1),d=s.start(u);o.push([c,d])}return w.createTimeRanges(o)}(t),e=0;e<n.length;e++){var r=n.start(e),a=n.end(e);if(i-r<4&&2<i-r)return{start:r,end:a}}return null}}]),ja);function ja(t){var i=this;Qt(this,ja),this.tech_=t.tech,this.seekable=t.seekable,this.seekTo=t.seekTo,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ki("PlaybackWatcher"),this.logger_("initialize");function n(){return i.monitorCurrentTime_()}function e(){return i.techWaiting_()}function r(){return i.cancelTimer_()}function a(){return i.fixesBadSeeks_()}this.tech_.on("seekablechanged",a),this.tech_.on("waiting",e),this.tech_.on(jl,r),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",a),i.tech_.off("waiting",e),i.tech_.off(jl,r),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&k.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}function Fl(t){(function i(n,e){var r=0,a=0,s=w.mergeOptions(Ip,e);n.ready(function(){n.trigger({type:"usage",name:"hls-error-reload-initialized"})});function o(){a&&n.currentTime(a)}function u(h){h!=null&&(a=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",o),n.src(h),n.trigger({type:"usage",name:"hls-error-reload"}),n.play())}function c(){if(Date.now()-r<1e3*s.errorInterval)n.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(s.getSource&&typeof s.getSource=="function")return r=Date.now(),s.getSource.call(n,u);w.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}}function d(){n.off("loadedmetadata",o),n.off("error",c),n.off("dispose",d)}n.on("error",c),n.on("dispose",d),n.reloadSourceOnError=function(h){d(),i(n,h)}})(this,t)}var Ip={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}};w.use("*",function(t){return{setSource:function(i,n){n(null,i)},setCurrentTime:function(i){return t.vhs&&t.currentSource().src===t.vhs.source_.src&&t.vhs.setCurrentTime(i),i},play:function(){t.vhs&&t.currentSource().src===t.vhs.source_.src&&t.vhs.setCurrentTime(t.tech_.currentTime())}}});var jt={PlaylistLoader:Nn,Playlist:Bt,Decrypter:Qd,AsyncStream:Vu,decrypt:qu,utils:up,STANDARD_PLAYLIST_SELECTOR:function(){return function(t,i,n,e,r){var a=t.playlists.map(function(C){var L,D;return L=C.attributes.RESOLUTION&&C.attributes.RESOLUTION.width,D=C.attributes.RESOLUTION&&C.attributes.RESOLUTION.height,{bandwidth:C.attributes.BANDWIDTH||k.Number.MAX_VALUE,width:L,height:D,playlist:C}});Yi(a,function(C,L){return C.bandwidth-L.bandwidth});var s=(a=a.filter(function(C){return!Bt.isIncompatible(C.playlist)})).filter(function(C){return Bt.isEnabled(C.playlist)});s.length||(s=a.filter(function(C){return!Bt.isDisabled(C.playlist)}));var o=s.filter(function(C){return C.bandwidth*Vt.BANDWIDTH_VARIANCE<i}),u=o[o.length-1],c=o.filter(function(C){return C.bandwidth===u.bandwidth})[0];if(r===!1){var d=c||s[0]||a[0];return d?d.playlist:null}var h=o.filter(function(C){return C.width&&C.height});Yi(h,function(C,L){return C.width-L.width});var f=h.filter(function(C){return C.width===n&&C.height===e});u=f[f.length-1];var y=f.filter(function(C){return C.bandwidth===u.bandwidth})[0],b=void 0,_=void 0,E=void 0;y||(_=(b=h.filter(function(C){return C.width>n||C.height>e})).filter(function(C){return C.width===b[0].width&&C.height===b[0].height}),u=_[_.length-1],E=_.filter(function(C){return C.bandwidth===u.bandwidth})[0]);var S=E||y||c||s[0]||a[0];return S?S.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(Il(this.tech_.el(),"width"),10),parseInt(Il(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var t=this.playlists.master.playlists.filter(Bt.isEnabled);return Yi(t,function(i,n){return Na(i,n)}),t.filter(function(i){return Gi(i.attributes.CODECS).videoCodec})[0]||null},comparePlaylistBandwidth:Na,comparePlaylistResolution:function(t,i){var n=void 0,e=void 0;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||k.Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(e=i.attributes.RESOLUTION.width),n===(e=e||k.Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?t.attributes.BANDWIDTH-i.attributes.BANDWIDTH:n-e},xhr:il()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(t){Object.defineProperty(jt,t,{get:function(){return w.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),Vt[t]},set:function(i){w.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0?w.log.warn("value of Hls."+t+" must be greater than or equal to 0"):Vt[t]=i}})});function Hl(t){return/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(t)?"hls":/^application\/dash\+xml/i.test(t)?"dash":null}function Vl(t,i){for(var n=i.media(),e=-1,r=0;r<t.length;r++)if(t[r].id===n.uri){e=r;break}t.selectedIndex_=e,t.trigger({selectedIndex:e,type:"change"})}var ql="videojs-vhs";jt.canPlaySource=function(){return w.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};function Lp(t){if(t.options_.sourceType==="dash"){var i=w.players[t.tech_.options_.playerId];if(i.eme){var n=function(e,r,a){if(!e)return e;var s={};for(var o in e)s[o]={audioContentType:'audio/mp4; codecs="'+a.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+r.attributes.CODECS+'"'},r.contentProtection&&r.contentProtection[o]&&r.contentProtection[o].pssh&&(s[o].pssh=r.contentProtection[o].pssh),typeof e[o]=="string"&&(s[o].url=e[o]);return w.mergeOptions(e,s)}(t.source_.keySystems,t.playlists.media(),t.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());n&&(i.currentSource().keySystems=n,i.eme.initializeMediaKeys&&i.eme.initializeMediaKeys())}}}function Wl(){if(!window.localStorage)return null;var t=window.localStorage.getItem(ql);if(!t)return null;try{return JSON.parse(t)}catch(i){return null}}jt.supportsNativeHls=function(){var t=U.createElement("video");return w.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(t.canPlayType(i))}):!1}(),jt.supportsNativeDash=!!w.getTech("Html5").isSupported()&&/maybe|probably/i.test(U.createElement("video").canPlayType("application/dash+xml")),jt.supportsTypeNatively=function(t){return t==="hls"?jt.supportsNativeHls:t==="dash"&&jt.supportsNativeDash},jt.isSupported=function(){return w.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Op=w.getComponent("Component"),zl=(ce(_e,Op),ie(_e,[{key:"setOptions_",value:function(){var t=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var i=Wl();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Vt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Vt.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys"].forEach(function(n){typeof t.source_[n]!="undefined"&&(t.options_[n]=t.source_[n])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(t,i){var n=this;t&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=jt,this.options_.sourceType=Hl(i),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e),n.setCurrentTime(e)},this.masterPlaylistController_=new Ap(this.options_),this.playbackWatcher_=new Pp(w.mergeOptions(this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()}})),this.masterPlaylistController_.on("error",function(){w.players[n.tech_.options_.playerId].error(n.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):jt.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=jt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),r=void 0;return r=0<this.throughput?1/this.throughput:0,Math.floor(1/(e+r))},set:function(){w.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:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return cl(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return cl(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(window.localStorage){var r=Wl();r=r?w.mergeOptions(r,e):e;try{window.localStorage.setItem(ql,JSON.stringify(r))}catch(a){return}}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){(function(e){var r=e.playlists;e.representations=function(){return r.master.playlists.filter(function(a){return!Ca(a)}).map(function(a,s){return new Bl(e,a,a.uri)})}})(n),Lp(n)}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.tech_.ready(function(){return n.setupQualityLevels_()}),this.tech_.el()&&this.tech_.src(w.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var t=this,i=w.players[this.tech_.options_.playerId];i&&i.qualityLevels&&(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){(function(n,e){e.representations().forEach(function(r){n.addQualityLevel(r)}),Vl(n,e.playlists)})(t.qualityLevels_,t)}),this.playlists.on("mediachange",function(){Vl(t.qualityLevels_,t.playlists)}))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(t){this.masterPlaylistController_.setCurrentTime(t)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,function t(i,n,e){i===null&&(i=Function.prototype);var r=Object.getOwnPropertyDescriptor(i,n);if(r===void 0){var a=Object.getPrototypeOf(i);return a===null?void 0:t(a,n,e)}if("value"in r)return r.value;var s=r.get;return s!==void 0?s.call(e):void 0}(_e.prototype.__proto__||Object.getPrototypeOf(_e.prototype),"dispose",this).call(this)}},{key:"convertToProgramTime",value:function(t,i){return ip({playlist:this.masterPlaylistController_.media(),time:t,callback:i})}},{key:"seekToProgramTime",value:function(t,i,n,e){var r=!(2<arguments.length&&n!==void 0)||n,a=3<arguments.length&&e!==void 0?e:2;return sl({programTime:t,playlist:this.masterPlaylistController_.media(),retryCount:a,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}}]),_e);function _e(t,i,n){Qt(this,_e);var e=ae(this,(_e.__proto__||Object.getPrototypeOf(_e)).call(this,i,n.hls));if(i.options_&&i.options_.playerId){var r=w(i.options_.playerId);r.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return w.log.warn("player.hls is deprecated. Use player.tech().hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),e},configurable:!0}),r.vhs=e,(r.dash=e).player_=r}if(e.tech_=i,e.source_=t,e.stats={},e.setOptions_(),e.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(e.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return e.on(U,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(a){var s=U.fullscreenElement||U.webkitFullscreenElement||U.mozFullScreenElement||U.msFullscreenElement;s&&s.contains(e.tech_.el())&&e.masterPlaylistController_.smoothQualityChange_()}),e.on(e.tech_,"seeking",function(){this.tech_.currentTime()===0&&this.tech_.player_.loop()&&this.setCurrentTime(0)}),e.on(e.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),e.on(e.tech_,"play",e.play),e}var Fa={name:"videojs-http-streaming",VERSION:"1.10.6",canHandleSource:function(t,i){var n=w.mergeOptions(w.options,1<arguments.length&&i!==void 0?i:{});return Fa.canPlayType(t.type,n)},handleSource:function(t,i,n){var e=w.mergeOptions(w.options,2<arguments.length&&n!==void 0?n:{});return i.hls=new zl(t,i,e),i.hls.xhr=il(),i.hls.src(t.src,t.type),i.hls},canPlayType:function(t,i){var n=w.mergeOptions(w.options,1<arguments.length&&i!==void 0?i:{}).hls.overrideNative,e=Hl(t);return e&&(!jt.supportsTypeNatively(e)||n)?"maybe":""}};return typeof w.MediaSource!="undefined"&&typeof w.URL!="undefined"||(w.MediaSource=Xi,w.URL=kl),Xi.supportsNativeMediaSources()&&w.getTech("Html5").registerSourceHandler(Fa,0),w.HlsHandler=zl,w.HlsSourceHandler=Fa,w.Hls=jt,w.use||w.registerComponent("Hls",jt),w.options.hls=w.options.hls||{},w.registerPlugin?w.registerPlugin("reloadSourceOnError",Fl):w.plugin("reloadSourceOnError",Fl),w});