PageSourceSearch

https://www.ch14i9.vip/_next/static/chunks/2101-a1e9e0c0c97a7391.js

js ch14i9.vip collected 2026-10-09 23:29:09 UTC 720,066 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2101],{1875:function(e,t,i){"use strict";var n=i(66419),r=i(7163);e.exports=function(e){var t=e.getComponent("MenuItem");return e.extend(t,{constructor:function(e,i){var r=i.source;if(!n.isObject(r))throw new Error('was not provided a "source" object, but rather: '+typeof r);i=n.extend({selectable:!0,label:r.label},i),t.call(this,e,i),this.source=r},handleClick:function(e){t.prototype.handleClick.call(this,e),this.player().trigger(r.QUALITY_REQUESTED,this.source)}})}},62864:function(e,t,i){"use strict";var n=i(66419),r=i(7163),s=i(1875),a="vjs-quality-changing";e.exports=function(e){var t,i=e.getComponent("MenuButton"),o=s(e);return t=e.extend(i,{constructor:function(e,t){i.call(this,e,t),e.on(r.QUALITY_REQUESTED,function(t,i){this.setSelectedSource(i),e.addClass(a),e.one("loadeddata",(function(){e.removeClass(a)}))}.bind(this)),e.on(r.PLAYER_SOURCES_CHANGED,function(){this.update()}.bind(this)),e.on(r.QUALITY_SELECTED,function(e,t){this.setSelectedSource(t)}.bind(this)),e.one("ready",function(){this.selectedSrc=e.src(),this.update()}.bind(this)),this.controlText("Open quality selector menu")},setSelectedSource:function(e){var t=e?e.src:void 0;this.selectedSrc!==t&&(this.selectedSrc=t,n.each(this.items,(function(e){e.selected(e.source.src===t)})))},createItems:function(){var e=this.player(),t=e.currentSources();return!t||t.length<2?[]:n.map(t,function(t){return new o(e,{source:t,selected:t.src===this.selectedSrc})}.bind(this))},buildWrapperCSSClass:function(){return"vjs-quality-selector "+i.prototype.buildWrapperCSSClass.call(this)}}),e.registerComponent("QualitySelector",t),t}},7163:function(e){"use strict";e.exports={QUALITY_REQUESTED:"qualityRequested",QUALITY_SELECTED:"qualitySelected",PLAYER_SOURCES_CHANGED:"playerSourcesChanged"}},61470:function(e,t,i){"use strict";var n=i(66419),r=i(7163),s=i(62864),a=i(69006),o=i(31527);e.exports=function(e){e=e||window.videojs,s(e),a(e),e.hook("setup",(function(e){e.on(r.QUALITY_REQUESTED,(function(t,i){var r=e.currentSources(),s=e.currentTime(),a=e.playbackRate(),u=e.paused();n.each(r,(function(e){e.selected=!1})),n.findWhere(r,{src:i.src}).selected=!0,e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onQualitySelectionChange(),e.src(r),e.ready((function(){e._qualitySelectorSafeSeek&&!e._qualitySelectorSafeSeek.hasFinished()||(e._qualitySelectorSafeSeek=new o(e,s),e.playbackRate(a)),u||e.play()}))}))}))},e.exports.EVENTS=r},69006:function(e,t,i){"use strict";var n=i(66419),r=i(7163);e.exports=function(e){e.use("*",(function(e){return{setSource:function(t,i){var s,a=e.currentSources();e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onPlayerSourcesChange(),n.isEqual(a,e._qualitySelectorPreviousSources)||(e.trigger(r.PLAYER_SOURCES_CHANGED,a),e._qualitySelectorPreviousSources=a),s=n.find(a,(function(e){return!0===e.selected||"true"===e.selected||"selected"===e.selected}))||t,e.trigger(r.QUALITY_SELECTED,s),i(null,s)}}}))}},31527:function(e,t,i){"use strict";var n=i(219);e.exports=n.extend({init:function(e,t){this._player=e,this._seekToTime=t,this._hasFinished=!1,this._keepThisInstanceWhenPlayerSourcesChange=!1,this._seekWhenSafe()},_seekWhenSafe:function(){this._player.readyState()<3?(this._seekFn=this._seek.bind(this),this._player.one("canplay",this._seekFn)):this._seek()},onPlayerSourcesChange:function(){this._keepThisInstanceWhenPlayerSourcesChange?this._keepThisInstanceWhenPlayerSourcesChange=!1:this.cancel()},onQualitySelectionChange:function(){this.hasFinished()||(this._keepThisInstanceWhenPlayerSourcesChange=!0)},_seek:function(){this._player.currentTime(this._seekToTime),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0},hasFinished:function(){return this._hasFinished},cancel:function(){this._player.off("canplay",this._seekFn),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}})},23316:function(e,t,i){"use strict";var n=i(58908),r=i(10434),s=i(27376);function a(e,t,i){var n=e;return s(t)?(i=t,"string"===typeof e&&(n={uri:e})):n=r({},t,{uri:e}),n.callback=i,n}function o(e,t,i){return u(t=a(e,t,i))}function u(e){if("undefined"===typeof e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=l.response?l.response:l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(i){}return null}(l),g)try{e=JSON.parse(e)}catch(t){}return e}function r(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,_)}function s(){if(!u){var t;clearTimeout(h),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=_,s=null;return 0!==t?(r={body:n(),statusCode:t,method:c,headers:{},url:d,rawRequest:l},l.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();"undefined"===typeof t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t}(l.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var a,u,l=e.xhr||null;l||(l=e.cors||e.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var h,d=l.url=e.uri||e.url,c=l.method=e.method||"GET",f=e.body||e.data,p=l.headers=e.headers||{},m=!!e.sync,g=!1,_={body:void 0,headers:{},statusCode:0,method:c,url:d,rawRequest:l};if("json"in e&&!1!==e.json&&(g=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(s,0)},l.onload=s,l.onerror=r,l.onprogress=function(){},l.onabort=function(){u=!0},l.ontimeout=r,l.open(c,d,!m,e.username,e.password),m||(l.withCredentials=!!e.withCredentials),!m&&e.timeout>0&&(h=setTimeout((function(){if(!u){u=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),l.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&l.setRequestHeader(a,p[a]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(l),l.send(f||null),l}e.exports=o,e.exports.default=o,o.XMLHttpRequest=n.XMLHttpRequest||function(){},o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){o["delete"===e?"del":e]=function(t,i,n){return(i=a(t,i,n)).method=e.toUpperCase(),u(i)}}))},219:function(e){!function(){var t=!1,i=/xyz/.test((function(){xyz}))?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(e){var n=this.prototype;t=!0;var r=new this;for(var s in t=!1,e)r[s]="function"==typeof e[s]&&"function"==typeof n[s]&&i.test(e[s])?function(e,t){return function(){var i=this._super;this._super=n[e];var r=t.apply(this,arguments);return this._super=i,r}}(s,e[s]):e[s];function a(){!t&&this.init&&this.init.apply(this,arguments)}return a.prototype=r,a.prototype.constructor=a,a.extend=arguments.callee,a},e.exports=Class}()},82702:function(e,t,i){var n=i(34155);e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"===typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=0,a=void 0,o=void 0,u=function(e,t){T[s]=e,T[s+1]=t,2===(s+=2)&&(o?o(S):w())};function l(e){o=e}function h(e){u=e}var d="undefined"!==typeof window?window:void 0,c=d||{},f=c.MutationObserver||c.WebKitMutationObserver,p="undefined"===typeof self&&"undefined"!==typeof n&&"[object process]"==={}.toString.call(n),m="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;function g(){return function(){return n.nextTick(S)}}function _(){return"undefined"!==typeof a?function(){a(S)}:b()}function v(){var e=0,t=new f(S),i=document.createTextNode("");return t.observe(i,{characterData:!0}
vendor: 4,390 bytes, line 1
1),function(){i.data=e=++e%2}}function y(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var T=new Array(1e3);function S(){for(var e=0;e<s;e+=2)(0,T[e])(T[e+1]),T[e]=void 0,T[e+1]=void 0;s=0}function E(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,_()}catch(t){return b()}}var w=void 0;function k(e,t){var i=this,n=new this.constructor(I);void 0===n[A]&&X(n);var r=i._state;if(r){var s=arguments[r-1];u((function(){return G(r,n,s,i._result)}))}else H(i,n,e,t);return n}function C(e){var t=this;if(e&&"object"===typeof e&&e.constructor===t)return e;var i=new t(I);return B(i,e),i}w=p?g():f?v():m?y():void 0===d?E():b();var A=Math.random().toString(36).substring(2);function I(){}var L=void 0,x=1,R=2;function D(){return new TypeError("You cannot resolve a promise with itself")}function O(){return new TypeError("A promises callback cannot return that same promise.")}function P(e,t,i,n){try{e.call(t,i,n)}catch(r){return r}}function M(e,t,i){u((function(e){var n=!1,r=P(i,t,(function(i){n||(n=!0,t!==i?B(e,i):j(e,i))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&r&&(n=!0,V(e,r))}),e)}function N(e,t){t._state===x?j(e,t._result):t._state===R?V(e,t._result):H(t,void 0,(function(t){return B(e,t)}),(function(t){return V(e,t)}))}function U(e,i,n){i.constructor===e.constructor&&n===k&&i.constructor.resolve===C?N(e,i):void 0===n?j(e,i):t(n)?M(e,i,n):j(e,i)}function B(t,i){if(t===i)V(t,D());else if(e(i)){var n=void 0;try{n=i.then}catch(r){return void V(t,r)}U(t,i,n)}else j(t,i)}function F(e){e._onerror&&e._onerror(e._result),q(e)}function j(e,t){e._state===L&&(e._result=t,e._state=x,0!==e._subscribers.length&&u(q,e))}function V(e,t){e._state===L&&(e._state=R,e._result=t,u(F,e))}function H(e,t,i,n){var r=e._subscribers,s=r.length;e._onerror=null,r[s]=t,r[s+x]=i,r[s+R]=n,0===s&&e._state&&u(q,e)}function q(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,r=void 0,s=e._result,a=0;a<t.length;a+=3)n=t[a],r=t[a+i],n?G(i,n,r,s):r(s);e._subscribers.length=0}}function G(e,i,n,r){var s=t(n),a=void 0,o=void 0,u=!0;if(s){try{a=n(r)}catch(l){u=!1,o=l}if(i===a)return void V(i,O())}else a=r;i._state!==L||(s&&u?B(i,a):!1===u?V(i,o):e===x?j(i,a):e===R&&V(i,a))}function W(e,t){try{t((function(t){B(e,t)}),(function(t){V(e,t)}))}catch(i){V(e,i)}}var z=0;function K(){return z++}function X(e){e[A]=z++,e._state=void 0,e._result=void 0,e._subscribers=[]}function Z(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(I),this.promise[A]||X(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):V(this.promise,Z())}return e.prototype._enumerate=function(e){for(var t=0;this._state===L&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===C){var r=void 0,s=void 0,a=!1;try{r=e.then}catch(u){a=!0,s=u}if(r===k&&e._state!==L)this._settledAt(e._state,t,e._result);else if("function"!==typeof r)this._remaining--,this._result[t]=e;else if(i===ie){var o=new i(I);a?V(o,s):U(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new i((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.promise;n._state===L&&(this._remaining--,e===R?V(n,i):this._result[t]=i),0===this._remaining&&j(n,this._result)},e.prototype._willSettleAt=function(e,t){var i=this;H(e,void 0,(function(e){return i._settledAt(x,t,e)}),(function(e){return i._settledAt(R,t,e)}))},e}();function $(e){return new Y(this,e).promise}function Q(e){var t=this;return r(e)?new t((function(i,n){for(var r=e.length,s=0;s<r;s++)t.resolve(e[s]).then(i,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function J(e){var t=new this(I);return V(t,e),t}function ee(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function te(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
1onstructor cannot be called as a function.")}var ie=function(){function e(t){this[A]=K(),this._result=this._state=void 0,this._subscribers=[],I!==t&&("function"!==typeof t&&ee(),this instanceof e?W(this,t):te())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var i=this,n=i.constructor;return t(e)?i.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):i.then(e,e)},e}();function ne(){var e=void 0;if("undefined"!==typeof i.g)e=i.g;else if("undefined"!==typeof self)e=self;else try{e=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(r){}if("[object Promise]"===n&&!t.cast)return}e.Promise=ie}return ie.prototype.then=k,ie.all=$,ie.race=Q,ie.resolve=C,ie.reject=J,ie._setScheduler=l,ie._setAsap=h,ie._asap=u,ie.polyfill=ne,ie.Promise=ie,ie}()},17187:function(e){"use strict";var t,i="object"===typeof Reflect?Reflect:null,n=i&&"function"===typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,s),n(i)}function s(){"function"===typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,i){"function"===typeof e.on&&m(e,"error",t,i)}(e,r,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,i,n){var r,s,a,l;if(o(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"===typeof a?a=s[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,l=h,console&&console.warn&&console.warn(l)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=h.bind(n);return r.listener=i,n.wrapFn=r,r}function c(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"===typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):p(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"===typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"===typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(s){n.once&&e.removeEventListener(t,r),i(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
1,set:function(e){if("number"!==typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var l=u.length,h=p(u,l);for(i=0;i<l;++i)n(h[i],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var i,n,r,s,a;if(o(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!==typeof i){for(r=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var r,s=Object.keys(i);for(n=0;n<s.length;++n)"removeListener"!==(r=s[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return c(this,e,!0)},s.prototype.rawListeners=function(e){return c(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},89144:function(e,t,i){var n,r="undefined"!==typeof i.g?i.g:"undefined"!==typeof window?window:{},s=i(25893);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"])||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=s),e.exports=n},58908:function(e,t,i){var n;n="undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},e.exports=n},27376:function(e){e.exports=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"===typeof e&&"[object RegExp]"!==i||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},27537:function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"===typeof e)return a[e];var i,s=String(e);return(i=n[s.toLowerCase()])?i:(i=r[s.toLowerCase()])||(1===s.length?s.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"===typeof e){var i=e.which||e.keyCode||e.charCode;if(null===i||void 0===i)return!1;if("string"===typeof t){var s;if(s=n[t.toLowerCase()])return s===i;if(s=r[t.toLowerCase()])return s===i}else if("number"===typeof t)return t===i;return!1}};
vendor: 25,346 bytes, line 1
1var n=(t=e.exports=i).code=t.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=t.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(s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a=t.names=t.title={};for(s in n)a[n[s]]=s;for(var o in r)n[o]=r[o]},84221:function(e){var t=Math.pow(2,32);e.exports=function(e){var i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},r=12;0===n.version?(n.earliestPresentationTime=i.getUint32(r),n.firstOffset=i.getUint32(r+4),r+=8):(n.earliestPresentationTime=i.getUint32(r)*t+i.getUint32(r+4),n.firstOffset=i.getUint32(r+8)*t+i.getUint32(r+12),r+=16),r+=2;var s=i.getUint16(r);for(r+=2;s>0;r+=12,s--)n.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&i.getUint32(r),subsegmentDuration:i.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&i.getUint32(r+8)});return n}},51489:function(e){var t,i,n,r,s,a,o,u=9e4;t=function(e){return e*u},i=function(e,t){return e*t},n=function(e){return e/u},r=function(e,t){return e/t},s=function(e,i){return t(r(e,i))},a=function(e,t){return i(n(e),t)},o=function(e,t,i){return n(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:s,videoTsToAudioTs:a,metadataTsToSeconds:o}},8523:function(){},75974:function(e){e.exports=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(r){n=r}return[n,i]}},49945:function(e){!function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var h=o.path,d=h.substring(0,h.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(d)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(s,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a}()},10870:function(e,t,i){"use strict";i.d(t,{Z:function(){return ql}});var n=i(58908),r=i.n(n),s=i(89144),a=i.n(s),o=i(87462),u=i(97326),l=i(94578),h=i(75974),d=i.n(h),c=i(27537),f=i.n(c),p=i(23316),m=i.n(p),g=i(13407),_=i.n(g),v=i(5647),y=i(60136),b=i(49945),T=i.n(b),S="http://example.com",E=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=r().location&&r().location.href||"");var i="function"===typeof r().URL,n=/^\/\//.test(e),s=!r().location&&!/\/\//i.test(e);if(i?e=new(r().URL)(e,r().location||S):/\/\//i.test(e)||(e=T().buildAbsoluteURL(r().location&&r().location.href||"",e)),i){var a=new URL(t,e);return s?a.href.slice(S.length):n?a.href.slice(a.protocol.length):a.href}return T().buildAbsoluteURL(e,t)},w=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),k=i(48764).Buffer;function C(e){for(var t,i=(t=e,r().atob?r().atob(t):k.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),s=0;s<i.length;s++)n[s]=i.charCodeAt(s);return n}var A,I=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return(0,l.Z)(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(w),L=String.fromCharCode(9),x=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},R=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},D=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}(0,l.Z)(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r<n.customParsers.length;r++)if(n.customParsers[r].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return i=(0,o.Z)(x(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var s=R(t[1]);s.URI&&(i.uri=s.URI),s.BYTERANGE&&(i.byterange=x(s.BYTERANGE))}n.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=R(t[1]),i.attributes.RESOLUTION){var a=i.attributes.RESOLUTION.split("x"),u={};a[0]&&(u.width=parseInt(a[0],10)),a[1]&&(u.height=parseInt(a[1],10)),i.attributes.RESOLUTION=u}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}n.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=R(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))n.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=R(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void n.trigger("data",i);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=R(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void n.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"skip"}).attributes=R(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(L)),void n.trigger("data",i);if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"part"}).attributes=R(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=x(i.attributes.BYTERANGE)),void n.trigger("data",i);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"server-control"}).attributes=R(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void n.trigger("data",i);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"part-inf"}).attributes=R(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void n.trigger("data",i);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"preload-hint"}).attributes=R(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void n.trigger("data",i);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(i={type:"tag",tagType:"rendition-report"}).attributes=R(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void n.trigger("data",i);n.trigger("data",{type:"tag",data:e.slice(4)})}}}else n.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))},i.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,s=e.segment;"function"!==typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:s}),!0}))},i.addTagMapper=function(e){var t=e.expression,i=e.map;this.tagMappers.push((function(e){return t.test(e)?i(e):e}))},t}(w),O=function(e){var t={};return Object.keys(e).forEach((function(i){var n;t[(n=i,n.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()})))]=e[i]})),t},P=function(e){var t=e.serverControl,i=e.targetDuration,n=e.partTargetDuration;if(t){var r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=i&&3*i,u=n&&2*n;i&&!t.hasOwnProperty(s)&&(t[s]=o,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[s]<o&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+t[s]+") to targetDuration * 3 ("+o+")"}),t[s]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[a]+")."})),n&&t[a]<u&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+t[a]+") to partTargetDuration * 2 ("+u+")."}),t[a]=u)}},M=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new I,t.parseStream=new D,t.lineStream.pipe(t.parseStream);var i,n,r=(0,u.Z)(t),s=[],a={},l=!1,h=function(){},d={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var f=0,p=0;return t.on("end",(function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&i&&(a.map=i),!a.key&&n&&(a.key=n),a.timeline||"number"!==typeof c||(a.timeline=c),t.manifest.preloadSegment=a)})),t.parseStream.on("data",(function(e){var t,u;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(a.byterange=t,t.length=e.length,"offset"in e||(e.offset=f)),"offset"in e&&(a.byterange=t,t.offset=e.offset),f=t.offset+t.length},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"})),e.duration>0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:C(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},"undefined"!==typeof e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),n&&(i.key=n)},"stream-inf":function(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||d,e.attributes?(a.attributes||(a.attributes={}),(0,o.Z)(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(u={default:/yes/i.test(e.attributes.DEFAULT)}).default?u.autoselect=!0:u.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(u.language=e.attributes.LANGUAGE),e.attributes.URI&&(u.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(u.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(u.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(u.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=u}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time":function(){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,P.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data},skip:function(){this.manifest.skip=O(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;l=!0;var i=this.manifest.segments.length,n=O(e.attributes);a.parts=a.parts||[],a.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=p),p=n.byterange.offset+n.byterange.length);var r=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+i,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=O(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),P.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,i=O(e.attributes),n=i.type&&"PART"===i.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?p:0,n&&(p=i.byterange.offset+i.byterange.length)));var r=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),i.type)for(var s=0;s<a.preloadHints.length-1;s++){var o=a.preloadHints[s];o.type&&(o.type===i.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+i.type+" as preload hint #"+s}))}},"rendition-report":function(){var t=O(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var i=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];l&&n.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+i,e.attributes,n)},"part-inf":function(){this.manifest.partInf=O(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),P.call(this,this.manifest)}}[e.tagType]||h).call(r)},uri:function(){a.uri=e.uri,s.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=c,i&&(a.map=i),p=0,a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})),t}(0,l.Z)(t,e);var i=t.prototype;return i.warnOnMissingAttributes_=function(e,t,i){var n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})},i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n"),this.trigger("end")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(w),N={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},U=["video","audio","text"],B=["Video","Audio","Text"],F=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},j=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),U.forEach((function(n){var r=N[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var s=e.substring(0,r[1].length),a=e.replace(s,"");i.push({type:s,details:a,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},V=function(e){return void 0===e&&(e=""),N.audio.test(e.trim().toLowerCase())},H=function(e){if(e&&"string"===typeof e){var t,i=e.toLowerCase().split(",").map((function(e){return F(e.trim())})),n="video";1===i.length&&V(i[0])?n="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),N.text.test(t.trim().toLowerCase()))&&(n="application");var r="mp4";return i.every((function(e){return N.mp4.test(e)}))?r="mp4":i.every((function(e){return N.webm.test(e)}))?r="webm":i.every((function(e){return N.ogg.test(e)}))&&(r="ogg"),n+"/"+r+';codecs="'+e+'"'}},q=function(e){return void 0===e&&(e=""),r().MediaSource&&r().MediaSource.isTypeSupported&&r().MediaSource.isTypeSupported(H(e))||!1},G=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<B.length;t++){if(N["muxer"+B[t]].test(e))return!0}return!1}))},W="mp4a.40.2",z=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,K=/^application\/dash\+xml/i,X=function(e){return z.test(e)?"hls":K.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Z=i(33081),Y=function(e){return!!e&&"object"===typeof e},$=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return"object"!==typeof i||Object.keys(i).forEac
1h((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):Y(t[n])&&Y(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},Q=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},J=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},ee="INVALID_NUMBER_OF_PERIOD",te="DASH_EMPTY_MANIFEST",ie="DASH_INVALID_XML",ne="NO_BASE_URL",re="SEGMENT_TIME_UNSPECIFIED",se="UNSUPPORTED_UTC_TIMING_SCHEME",ae=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,s=e.range,a=void 0===s?"":s,o=e.indexRange,u=void 0===o?"":o,l={uri:r,resolvedUri:E(i||"",r)};if(a||u){var h=(a||u).split("-"),d=parseInt(h[0],10),c=parseInt(h[1],10);l.byterange={length:c-d+1,offset:d}}return l},oe=function(e){return e&&"number"!==typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},ue={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration,s=oe(e.endNumber);return{start:0,end:"number"===typeof s?s:Math.ceil(r/(t/n))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,s=void 0===r?1:r,a=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,h=void 0===l?0:l,d=e.timeShiftBufferDepth,c=void 0===d?1/0:d,f=oe(e.endNumber),p=(t+i)/1e3,m=n+u,g=p+h-m,_=Math.ceil(g*s/a),v=Math.floor((p-m-c)*s/a),y=Math.floor((p-m)*s/a);return{start:Math.max(0,v),end:"number"===typeof f?f:Math.min(_,y)}}},le=function(e){var t=e.type,i=void 0===t?"static":t,n=e.duration,r=e.timescale,s=void 0===r?1:r,a=e.sourceDuration,o=ue[i](e),u=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}(o.start,o.end).map(function(e){return function(t,i){var n=e.duration,r=e.timescale,s=void 0===r?1:r,a=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:n/s,timeline:a,time:i*n}}}(e));if("static"===i){var l=u.length-1;u[l].duration=a-n/s*l}return u},he=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,s=e.indexRange,a=void 0===s?"":s,o=e.duration;if(!t)throw new Error(ne);var u=ae({baseUrl:t,source:n.sourceURL,range:n.range}),l=ae({baseUrl:t,source:t,indexRange:a});if(l.map=u,o){var h=le(e);h.length&&(l.duration=h[0].duration,l.timeline=h[0].timeline)}else r&&(l.duration=r,l.timeline=0);return l.number=0,[l]},de=function(e,t,i){for(var n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,s=e.timeline||0,a=e.sidx.byterange,o=a.offset+a.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),h=[],d=o+t.firstOffset,c=0;c<l.length;c++){var f=t.references[c],p=f.referencedSize,m=f.subsegmentDuration,g=he({baseUrl:i,timescale:u,timeline:s,periodIndex:s,duration:m,sourceDuration:r,indexRange:d+"-"+(d+p-1)})[0];n&&(g.map=n),h.push(g),d+=p}return e.segments=h,e},ce=function(e){return e&&e.uri+"-"+function(e){var t=e.offset+e.length-1;return e.offset+"-"+t}(e.byterange)},fe=function(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},pe=function(e,t){var i=ce(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&de(e,n,e.sidx.resolvedUri),e},me=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=pe(e[i],t);return e},ge=function(e){var t,i=e.attributes,n=e.segments,r=e.sidx,s={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(s.contentProtection=i.contentProtection),r&&(s.sidx=r),s},_e=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},ve=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},ye=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},be=function(e,t,i){var n;if(void 0===i&&(i={}),!e.length)return{};var r=e[0].attributes,s=r.sourceDuration,a=r.type,o=void 0===a?"static":a,u=r.suggestedPresentationDelay,l=r.minimumUpdatePeriod,h=fe(e.filter(_e)).map(ge),d=fe(e.filter(ve)),c=e.f
vendor: 62,236 bytes, line 1
1ilter(ye),f=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:s,playlists:me(h,i)};l>=0&&(p.minimumUpdatePeriod=1e3*l),t&&(p.locations=t),"dynamic"===o&&(p.suggestedPresentationDelay=u);var m=0===p.playlists.length;return d.length&&(p.mediaGroups.AUDIO.audio=function(e,t,i){var n;void 0===t&&(t={}),void 0===i&&(i=!1);var r=e.reduce((function(e,r){var s=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"",o=r.attributes.label||"main";if(a&&!r.attributes.label){var u=s?" ("+s+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});var l=pe(function(e,t){var i,n=e.attributes,r=e.segments,s=e.sidx,a={attributes:(i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:r,mediaSequence:r.length?r[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),s&&(a.sidx=s),t&&(a.attributes.AUDIO="audio",a.attributes.SUBTITLES="subs"),a}(r,i),t);return e[o].playlists.push(l),"undefined"===typeof n&&"main"===s&&((n=r).default=!0),e}),{});return n||(r[Object.keys(r)[0]].default=!0),r}(d,i,m)),c.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(pe(function(e){var t,i=e.attributes,n=e.segments;"undefined"===typeof n&&(n=[{uri:i.baseUrl,timeline:i.periodIndex,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var r=((t={NAME:i.id,BANDWIDTH:i.bandwidth})["PROGRAM-ID"]=1,t);return i.codecs&&(r.CODECS=i.codecs),{attributes:r,uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:i.baseUrl||"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(i),t)),e}),{})}(c,i)),f.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=f.reduce((function(e,t){return t?(t.forEach((function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})),p},Te=function(e,t,i){var n=e.NOW,r=e.clientOffset,s=e.availabilityStartTime,a=e.timescale,o=void 0===a?1:a,u=e.start,l=void 0===u?0:u,h=e.minimumUpdatePeriod,d=(n+r)/1e3+(void 0===h?0:h)-(s+l);return Math.ceil((d*o-t)/i)},Se=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,s=void 0===r?0:r,a=e.media,o=void 0===a?"":a,u=e.sourceDuration,l=e.timescale,h=void 0===l?1:l,d=e.startNumber,c=void 0===d?1:d,f=e.periodIndex,p=[],m=-1,g=0;g<t.length;g++){var _=t[g],v=_.d,y=_.r||0,b=_.t||0;m<0&&(m=b),b&&b>m&&(m=b);var T=void 0;if(y<0){var S=g+1;T=S===t.length?"dynamic"===n&&s>0&&o.indexOf("$Number$")>0?Te(e,m,v):(u*h-m)/v:(t[S].t-m)/v}else T=y+1;for(var E=c+p.length+T,w=c+p.length;w<E;)p.push({number:w,duration:v/h,time:m,timeline:f}),m+=v,w++}return p},Ee=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,we=function(e,t){return e.replace(Ee,function(e){return function(t,i,n,r){if("$$"===t)return"$";if("undefined"===typeof e[i])return t;var s=""+e[i];return"RepresentationID"===i?s:(r=n?parseInt(r,10):1,s.length>=r?s:""+new Array(r-s.length+1).join("0")+s)}}(t))},ke=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,s=ae({baseUrl:e.baseUrl,source:we(r.sourceURL,i),range:r.range}),a=function(e,t){return e.duration||t?e.duration?le(e):Se(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return a.map((function(t){i.Number=t.number,i.Time=t.time;var n=we(e.media||"",i),r={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:E(e.baseUrl||"",n),map:s,number:t.number};return e.presentationTimeOffset&&(r.presentationTimeOffset=e.presentationTimeOffset),r}))},Ce=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error(re);var s,a=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,s=ae({baseUrl:i,source:r.sourceURL,range:r.range}),a=ae({baseUrl:i,source:t.media,range:t.mediaRange});return a.map=s,a}(e,t)}));return i&&(s=le(e)),t&&(s=Se(e,t)),s.map((function(e,t){if(a[t]){var i=a[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},Ae=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=ke,t=$(n,r.template),r.template.presentationTimeOffset&&(t.presentationTimeOffset=r.template.presentationTimeOffset/r.template.timescale)):r.base?(i=he,t=$(n,r.base)):r.list&&(i=Ce,t=$(n,r.list));var s={attributes:n};if(!i)return s;var a=i(t,r.timeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,h=void 0===l?1:l;t.duration=u/h}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return s.attributes=t,s.segments=a,r.base&&t.indexRange&&(s.sidx=a[0],s.segments=[]),s},Ie=function(e,t){return J(e.childNodes).filter((function(e){return e.tagName===t}))},Le=function(e){return e.textContent.trim()},xe=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],s=i[2],a=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(s||0)+3600*parseFloat(a||0)+60*parseFloat(o||0)+parseFloat(u||0)},Re={mediaPresentationDuration:function(e){return xe(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return xe(e)},suggestedPresentationDelay:function(e){return xe(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return xe(e)},start:function(e){return xe(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?xe(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},De=function(e){return e&&e.attributes?J(e.attributes).reduce((function(e,t){var i=Re[t.name]||Re.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},Oe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Pe=function(e,t){return t.length?Q(e.map((function(e){return t.map((function(t){return E(e,Le(t))}))}))):e},Me=function(e){var t=Ie(e,"SegmentTemplate")[0],i=Ie(e,"SegmentList")[0],n=i&&Ie(i,"SegmentURL").map((function(e){return $({tag:"SegmentURL"},De(e))})),r=Ie(e,"SegmentBase")[0],s=i||t,a=s&&Ie(s,"SegmentTimeline")[0],o=i||r||t,u=o&&Ie(o,"Initialization")[0],l=t&&De(t);l&&u?l.initialization=u&&De(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var h={template:l,timeline:a&&Ie(a,"S").map((function(e){return De(e)})),list:i&&$(De(i),{segmentUrls:n,initialization:De(u)}),base:r&&$(De(r),{initialization:De(u)})};return Object.keys(h).forEach((function(e){h[e]||delete h[e]})),h},Ne=function(e,t,i){return function(n){var r,s=De(n),a=Pe(t,Ie(n,"BaseURL")),o=Ie(n,"Role")[0],u={role:De(o)},l=$(e,s,u),h=Ie(n,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(r=De(h)).schemeIdUri?r.value.split(";").map((function(e){var t,i;if(i=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],i=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:i}})):"urn:scte:dash:cc:cea-708:2015"===r.schemeIdUri?r.value.split(";").map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var i=e.split("="),n=i[0],r=i[1],s=void 0===r?"":r;t.channel=n,t.language=e,s.split(",").forEach((function(e){var i=e.split(":"),n=i[0],r=i[1];"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;d&&(l=$(l,{captionServices:d}));var c=Ie(n,"Label")[0];if(c&&c.childNodes.length){var f=c.childNodes[0].nodeValue.trim();l=$(l,{label:f})}var p=Ie(n,"ContentProtection").reduce((function(e,t){var i=De(t),n=Oe[i.schemeIdUri];if(n){e[n]={attributes:i};var r=Ie(t,"cenc:pssh")[0];if(r){var s=Le(r),a=s&&C(s);e[n].pssh=a}}return e}),{});Object.keys(p).length&&(l=$(l,{contentProtection:p}));var m=Me(n),g=Ie(n,"Representation"),_=$(i,m);return Q(g.map(function(e,t,i){return function(n){var r=Ie(n,"BaseURL"),s=Pe(t,r),a=$(e,De(n)),o=Me(n);return s.map((function(e){return{segmentInfo:$(i,o),attributes:$(a,{baseUrl:e})}}))}}(l,a,_)))}},Ue=function(e,t){return function(i,n){var s=Pe(t,Ie(i,"BaseURL")),a=De(i),o=parseInt(a.id,10),u=r().isNaN(o)?n:o,l=$(e,{periodIndex:u}),h=Ie(i,"AdaptationSet"),d=Me(i);return Q(h.map(Ne(l,s,d)))}},Be=function(e){if(""===e)throw new Error(te);var t,i,n=new Z.a;try{i=(t=n.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(r){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(ie);return i},Fe=function(e,t){void 0===t&&(t={});var i=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,s=i.NOW,a=void 0===s?Date.now():s,o=i.clientOffset,u=void 0===o?0:o,l=Ie(e,"Period");if(!l.length)throw new Error(ee);var h=Ie(e,"Location"),d=De(e),c=Pe([r],Ie(e,"BaseURL"));return d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=a,d.clientOffset=u,h.length&&(d.locations=h.map(Le)),{locations:d.locations,representationInfo:Q(l.map(Ue(d,c)))}}(Be(e),t),n=i.representationInfo.map(Ae);return be(n,i.locations,t.sidxMapping)},je=function(e){return function(e){var t=Ie(e,"UTCTiming")[0];if(!t)return null;var i=De(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(se)}return i}(Be(e))},Ve=i(84221),He=i.n(Ve),qe=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||(t=e,ArrayBuffer.isView(t))||e instanceof ArrayBuffer||(e="number"!==typeof e||"number"===typeof e&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0));var t},Ge=r().BigInt||Number,We=[Ge("0x1"),Ge("0x100"),Ge("0x10000"),Ge("0x1000000"),Ge("0x100000000"),Ge("0x10000000000"),Ge("0x1000000000000"),Ge("0x100000000000000"),Ge("0x10000000000000000")],ze=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,s=i.le,a=void 0!==s&&s;e=qe(e);var o=a?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,n){var r=a?n:Math.abs(n+1-e.length);return t+Ge(i)*We[r]}),Ge(0));if(r){var l=We[e.length]/Ge(2)-Ge(1);(u=Ge(u))>l&&(u-=l,u-=l,u-=Ge(2))}return Number(u)}),Ke=function(e,t){var i=(void 0===t?{}:t).le,n=void 0!==i&&i;("bigint"!==typeof e&&"number"!==typeof e||"number"===typeof e&&e!==e)&&(e=0),e=Ge(e);for(var r,s=(r=e,Math.ceil(function(e){return e.toString(2).length}(r)/8)),a=new Uint8Array(new ArrayBuffer(s)),o=0;o<s;o++){var u=n?o:Math.abs(o+1-a.length);a[u]=Number(e/We[o]&Ge(255)),e<0&&(a[u]=Math.abs(~a[u]),a[u]-=0===o?1:2)}return a},Xe=function(e,t){if("string"!==typeof e&&e&&"function"===typeof e.toString&&(e=e.toString()),"string"!==typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},Ze=function(e,t,i){var n=void 0===i?{}:i,r=n.offset,s=void 0===r?0:r,a=n.mask,o=void 0===a?[]:a;e=qe(e);var u=(t=qe(t)).every?t.every:Array.prototype.every;return t.length&&e.length-s>=t.length&&u.call(t,(function(t,i){return t===(o[i]?o[i]&e[s+i]:e[s+i])}))},Ye=qe([73,68,51]),$e=function e(t,i){return void 0===i&&(i=0),(t=qe(t)).length-i<10||!Ze(t,Ye,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=qe(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},Qe=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Xe(e):e}),Je=function(e){e=qe(e);for(var t=[],i=0;e.length>i;){var n=e[i],r=0,s=0,a=e[++s];for(s++;128&a;)r=(127&a)<<7,a=e[s],s++;r+=127&a;for(var o=0;o<A.length;o++){var u=A[o],l=u.id,h=u.parser;if(n===l){t.push(h(e.subarray(s,s+r)));break}}i+=r+s}return t};A=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,qe(e));try{return decodeURIComponent(escape(t))}catch(i){}return t}(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Je(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Je(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var et=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return Qe(e)})):[Qe(e)]}(i),t=qe(t);var r=[];if(!i.length)return r;for(var s=0;s<t.length;){var a=(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3])>>>0,o=t.subarray(s+4,s+8);if(0===a)break;var u=s+a;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(s+8,u);Ze(o,i[0])&&(1===i.length?r.push(l):r.push.apply(r,e(l,i.slice(1),n))),s=u}return r},tt={EBML:qe([26,69,223,163]),DocType:qe([66,130]),Segment:qe([24,83,128,103]),SegmentInfo:qe([21,73,169,102]),Tracks:qe([22,84,174,107]),Track:qe([174]),TrackNumber:qe([215]),DefaultDuration:qe([35,227,131]),TrackEntry:qe([174]),TrackType:qe([131]),FlagDefault:qe([136]),CodecID:qe([134]),CodecPrivate:qe([99,162]),VideoTrack:qe([224]),AudioTrack:qe([225]),Cluster:qe([31,67,182,117]),Timestamp:qe([231]),TimestampScale:qe([42,215,177]),BlockGroup:qe([160]),BlockDuration:qe([155]),Block:qe([161]),SimpleBlock:qe([163])},it=[128,64,32,16,8,4,2,1],nt=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<it.length&&!(e&it[i]);i++)t++;return t}(e[t]),s=e.subarray(t,t+r);return i&&((s=Array.prototype.slice.call(e,t,t+r))[0]^=it[r-1]),{length:r,value:ze(s,{signed:n}),bytes:s}},rt=function e(t){return"string"===typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"===typeof t?Ke(t):t},st=function e(t,i,n){if(n>=i.length)return i.length;var r=nt(i,n,!1);if(Ze(t.bytes,r.bytes))return n;var s=nt(i,n+r.length);return e(t,i,n+s.length+s.value+r.length)},at=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return rt(e)})):[rt(e)]}(i),t=qe(t);var n=[];if(!i.length)return n;for(var r=0;r<t.length;){var s=nt(t,r,!1),a=nt(t,r+s.length),o=r+s.length+a.length;127===a.value&&(a.value=st(s,t,o),a.value!==t.length&&(a.value-=o));var u=o+a.value>t.length?t.length:o+a.value,l=t.subarray(o,u);Ze(i[0],s.bytes)&&(1===i.length?n.push(l):n=n.concat(e(l,i.slice(1)))),r+=s.length+a.length+l.length}return n},ot=qe([0,0,0,1]),ut=qe([0,0,1]),lt=qe([0,0,3]),ht=function(e){for(var t=[],i=1;i<e.length-2;)Ze(e.subarray(i,i+3),lt)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),s=0;for(i=0;i<n;s++,i++)s===t[0]&&(s++,t.shift()),r[i]=e[s];return r},dt=function(e,t,i,n){void 0===n&&(n=1/0),e=qe(e),i=[].concat(i);for(var r,s=0,a=0;s<e.length&&(a<n||r);){var o=void 0;if(Ze(e.subarray(s),ot)?o=4:Ze(e.subarray(s),ut)&&(o=3),o){if(a++,r)return ht(e.subarray(r,s));var u=void 0;"h264"===t?u=31&e[s+o]:"h265"===t&&(u=e[s+o]>>1&63),-1!==i.indexOf(u)&&(r=s+o),s+=o+("h264"===t?1:2)}else s++}return e.subarray(0,0)},ct={webm:qe([119,101,98,109]),matroska:qe([109,97,116,114,111,115,107,97]),flac:qe([102,76,97,67]),ogg:qe([79,103,103,83]),ac3:qe([11,119]),riff:qe([82,73,70,70]),avi:qe([65,86,73]),wav:qe([87,65,86,69]),"3gp":qe([102,116,121,112,51,103]),mp4:qe([102,116,121,112]),fmp4:qe([115,116,121,112]),mov:qe([102,116,121,112,113,116])},ft={aac:function(e){var t=$e(e);return Ze(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=$e(e);return Ze(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=at(e,[tt.EBML,tt.DocType])[0];return Ze(t,ct.webm)},mkv:function(e){var t=at(e,[tt.EBML,tt.DocType])[0];return Ze(t,ct.matroska)},mp4:function(e){return!ft["3gp"](e)&&!ft.mov(e)&&(Ze(e,ct.mp4,{offset:4})||Ze(e,ct.fmp4,{offset:4}))},mov:function(e){return Ze(e,ct.mov,{offset:4})},"3gp":function(e){return Ze(e,ct["3gp"],{offset:4})},ac3:function(e){var t=$e(e);return Ze(e,ct.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=$e(e);return Ze(e,ct.flac,{offset:t})},ogg:function(e){return Ze(e,ct.ogg)},avi:function(e){return Ze(e,ct.riff)&&Ze(e,ct.avi,{offset:8})},wav:function(e){return Ze(e,ct.riff)&&Ze(e,ct.wav,{offset:8})},h264:function(e){return function(e,t,i){return dt(e,"h264",t,i)}(e,7,3).length},h265:function(e){return function(e,t,i){return dt(e,"h265",t,i)}(e,[32,33],3).length}},pt=Object.keys(ft).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);pt.forEach((function(e){var t=ft[e];ft[e]=function(e){return t(qe(e))}}));for(var mt,gt=ft,_t=function(e){e=qe(e);for(var t=0;t<pt.length;t++){var i=pt[t];if(gt[i](e))return i}return""},vt=i(51489),yt="7.13.3",bt={prefixed:!0},Tt=[["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"]],St=Tt[0],Et=0;Et<Tt.length;Et++)if(Tt[Et][1]in a()){mt=Tt[Et];break}if(mt){for(var wt=0;wt<mt.length;wt++)bt[St[wt]]=mt[wt];bt.prefixed=mt[0]!==St[0]}var kt=[];var Ct=function e(t){var i,n="info",s=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)};return i=function(e,t){return function(i,n,s){var a=t.levels[n],o=new RegExp("^("+a+")$");if("log"!==i&&s.unshift(i.toUpperCase()+":"),s.unshift(e+":"),kt){kt.push([].concat(s));var u=kt.length-1e3;kt.splice(0,u>0?u:0)}if(r().console){var l=r().console[i];l||"debug"!==i||(l=r().console.info||r().console.log),l&&a&&o.test(i)&&l[Array.isArray(s)?"apply":"call"](r().console,s)}}}(t,s),s.createLogger=function(i){return e(t+": "+i)},s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},s.level=function(e){if("string"===typeof e){if(!s.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(s.history=function(){return kt?[].concat(kt):[]}).filter=function(e){return(kt||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},s.history.clear=function(){kt&&(kt.length=0)},s.history.disable=function(){null!==kt&&(kt.length=0,kt=null)},s.history.enable=function(){null===kt&&(kt=[])},s.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},s.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},s.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},s}("VIDEOJS"),At=Ct.createLogger,It=Object.prototype.toString,Lt=function(e){return Dt(e)?Object.keys(e):[]};function xt(e,t){Lt(e).forEach((function(i){return t(e[i],i)}))}function Rt(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?o.Z.apply(void 0,[e].concat(i)):(i.forEach((function(t){t&&xt(t,(function(t,i){e[i]=t}))})),e)}function Dt(e){return!!e&&"object"===typeof e}function Ot(e){return Dt(e)&&"[object Object]"===It.call(e)&&e.constructor===Object}function Pt(e,t){if(!e||!t)return"";if("function"===typeof r().getComputedStyle){var i;try{i=r().getComputedStyle(e)}catch(n){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}var Mt=r().navigator&&r().navigator.userAgent||"",Nt=/AppleWebKit\/([\d.]+)/i.exec(Mt),Ut=Nt?parseFloat(Nt.pop()):null,Bt=/iPod/i.test(Mt),Ft=function(){var e=Mt.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),jt=/Android/i.test(Mt),Vt=function(){var e=Mt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Ht=jt&&Vt<5&&Ut<537,qt=/Firefox/i.test(Mt),Gt=/Edg/i.test(Mt),Wt=!Gt&&(/Chrome/i.test(Mt)||/CriOS/i.test(Mt)),zt=function(){var e=Mt.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Kt=function(){var e=/MSIE\s(\d+)\.\d/.exec(Mt),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Mt)&&/rv:11.0/.test(Mt)&&(t=11),t}(),Xt=/Safari/i.test(Mt)&&!Wt&&!jt&&!Gt,Zt=/Windows/i.test(Mt),Yt=Boolean(ri()&&("ontouchstart"in r()||r().navigator.maxTouchPoints||r().DocumentTouch&&r().document instanceof r().DocumentTouch)),$t=/iPad/i.test(Mt)||Xt&&Yt&&!/iPhone/i.test(Mt),Qt=/iPhone/i.test(Mt)&&!$t,Jt=Qt||$t||Bt,ei=(Xt||Jt)&&!Wt,ti=Object.freeze({__proto__:null,IS_IPOD:Bt,IOS_VERSION:Ft,IS_ANDROID:jt,ANDROID_VERSION:Vt,IS_NATIVE_ANDROID:Ht,IS_FIREFOX:qt,IS_EDGE:Gt,IS_CHROME:Wt,CHROME_VERSION:zt,IE_VERSION:Kt,IS_SAFARI:Xt,IS_WINDOWS:Zt,TOUCH_ENABLED:Yt,IS_IPAD:$t,IS_IPHONE:Qt,IS_IOS:Jt,IS_ANY_SAFARI:ei});function ii(e){return"string"===typeof e&&Boolean(e.trim())}function ni(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ri(){return a()===r().document}function si(e){return Dt(e)&&1===e.nodeType}function ai(){try{return r().parent!==r().self}catch(e){return!0}}function oi(e){return function(t,i){if(!ii(t))return a()[e](null);ii(i)&&(i=a().querySelector(i));var n=si(i)?i:a();return n[e]&&n[e](t)}}function ui(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=a().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Ct.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?li(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Ii(r,n),r}function li(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function hi(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function di(e,t){return ni(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function ci(e,t){return e.classList?e.classList.add(t):di(e,t)||(e.className=(e.className+" "+t).trim()),e}function fi(e,t){return e.classList?e.classList.remove(t):(ni(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function pi(e,t,i){var n=di(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?ci(e,t):fi(e,t),e}function mi(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function gi(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var s=n[r].name,a=n[r].value;"boolean"!==typeof e[s]&&-1===i.indexOf(","+s+",")||(a=null!==a),t[s]=a}return t}function _i(e,t){return e.getAttribute(t)}function vi(e,t,i){e.setAttribute(t,i)}function yi(e,t){e.removeAttribute(t)}function bi(){a().body.focus(),a().onselectstart=function(){return!1}}function Ti(){a().onselectstart=function(){return!0}}function Si(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Pt(e,"height"))),i.width||(i.width=parseFloat(Pt(e,"width"))),i}}function Ei(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==a()[bt.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function wi(e,t){var i={x:0,y:0};if(Jt)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=Pt(n,"transform");if(/^matrix/.test(r)){var s=r.slice(7,-1).split(/,\s/).map(Number);i.x+=s[4],i.y+=s[5]}else if(/^matrix3d/.test(r)){var a=r.slice(9,-1).split(/,\s/).map(Number);i.x+=a[12],i.y+=a[13]}n=n.parentNode}var o={},u=Ei(t.target),l=Ei(e),h=l.width,d=l.height,c=t.offsetY-(l.top-u.top),f=t.offsetX-(l.left-u.left);return t.changedTouches&&(f=t.changedTouches[0].pageX-l.left,c=t.changedTouches[0].pageY+l.top,Jt&&(f-=i.x,c-=i.y)),o.y=1-Math.max(0,Math.min(1,c/d)),o.x=Math.max(0,Math.min(1,f/h)),o}function ki(e){return Dt(e)&&3===e.nodeType}function Ci(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ai(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),si(e)||ki(e)?e:"string"===typeof e&&/\S/.test(e)?a().createTextNode(e):void 0})).filter((function(e){return e}))}function Ii(e,t){return Ai(t).forEach((function(t){return e.appendChild(t)})),e}function Li(e,t){return Ii(Ci(e),t)}function xi(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var Ri,Di=oi("querySelector"),Oi=oi("querySelectorAll"),Pi=Object.freeze({__proto__:null,isReal:ri,isEl:si,isInFrame:ai,createEl:ui,textContent:li,prependTo:hi,hasClass:di,addClass:ci,removeClass:fi,toggleClass:pi,setAttributes:mi,getAttributes:gi,getAttribute:_i,setAttribute:vi,removeAttribute:yi,blockTextSelection:bi,unblockTextSelection:Ti,getBoundingClientRect:Si,findPosition:Ei,getPointerPosition:wi,isTextNode:ki,emptyEl:Ci,normalizeContent:Ai,appendContent:Ii,insertContent:Li,isSingleLeftClick:xi,$:Di,$$:Oi}),Mi=!1,Ni=function(){if(!1!==Ri.options.autoSetup){var e=Array.prototype.slice.call(a().getElementsByTagName("video")),t=Array.prototype.slice.call(a().getElementsByTagName("audio")),i=Array.prototype.slice.call(a().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,s=n.length;r<s;r++){var o=n[r];if(!o||!o.getAttribute){Ui(1);break}void 0===o.player&&null!==o.getAttribute("data-setup")&&Ri(o)}else Mi||Ui(1)}};function Ui(e,t){ri()&&(t&&(Ri=t),r().setTimeout(Ni,e))}function Bi(){Mi=!0,r().removeEventListener("load",Bi)}ri()&&("complete"===a().readyState?Bi():r().addEventListener("load",Bi));var Fi,ji=function(e){var t=a().createElement("style");return t.className=e,t},Vi=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Hi=3;function qi(){return Hi++}r().WeakMap||(Fi=function(){function e(){this.vdata="vdata"+Math.floor(r().performance&&r().performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var i=e[this.vdata]||qi();return e[this.vdata]||(e[this.vdata]=i),this.data[i]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];Ct("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var Gi,Wi=r().WeakMap?new WeakMap:new Fi;function zi(e,t){if(Wi.has(e)){var i=Wi.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Wi.delete(e)}}function Ki(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Xi(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||r().event;for(var s in e={},n)"layerX"!==s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s&&("returnValue"===s&&n.preventDefault||(e[s]=n[s]));if(e.target||(e.target=e.srcElement||a()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=a().documentElement,u=a().body;e.pageX=e.clientX+(o&&o.scrollLeft||u&&u.scrollLeft||0)-(o&&o.clientLeft||u&&u.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||u&&u.scrollTop||0)-(o&&o.clientTop||u&&u.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var Zi=["touchstart","touchmove"];function Yi(e,t,i){if(Array.isArray(t))return Ki(Yi,e,t,i);Wi.has(e)||Wi.set(e,{});var n=Wi.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=qi()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Xi(t);var r=n.handlers[t.type];if(r)for(var s=r.slice(0),a=0,o=s.length;a<o&&!t.isImmediatePropagationStopped();a++)try{s[a].call(e,t,i)}catch(u){Ct.error(u)}}}),1===n.handlers[t].length)if(e.addEventListener){var s=!1;(function(){if("boolean"!==typeof Gi){Gi=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Gi=!0}});r().addEventListener("test",null,e),r().removeEventListener("test",null,e)}catch(t){}}return Gi})()&&Zi.indexOf(t)>-1&&(s={passive:!0}),e.addEventListener(t,n.dispatcher,s)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function $i(e,t,i){if(Wi.has(e)){var n=Wi.get(e);if(n.handlers){if(Array.isArray(t))return Ki($i,e,t,i);var r=function(e,t){n.handlers[t]=[],zi(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;a<s.length;a++)s[a].guid===i.guid&&s.splice(a--,1);zi(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function Qi(e,t,i){var n=Wi.has(e)?Wi.get(e):{},r=e.parentNode||e.ownerDocument;if("string"===typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Xi(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)Qi.call(null,r,t,i);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){Wi.has(t.target)||Wi.set(t.target,{});var s=Wi.get(t.target);t.target[t.type]&&(s.disabled=!0,"function"===typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1)}return!t.defaultPrevented}function Ji(e,t,i){if(Array.isArray(t))return Ki(Ji,e,t,i);var n=function n(){$i(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||qi(),Yi(e,t,n)}function en(e,t,i){var n=function n(){$i(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||qi(),Yi(e,t,n)}var tn,nn=Object.freeze({__proto__:null,fixEvent:Xi,on:Yi,off:$i,trigger:Qi,one:Ji,any:en}),rn=30,sn=function(e,t,i){t.guid||(t.guid=qi());var n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},an=function(e,t){var i=r().performance.now();return function(){var n=r().performance.now();n-i>=t&&(e.apply(void 0,arguments),i=n)}},on=function(){};on.prototype.allowedEvents_={},on.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Yi(this,e,t),this.addEventListener=i},on.prototype.addEventListener=on.prototype.on,on.prototype.off=function(e,t){$i(this,e,t)},on.prototype.removeEventListener=on.prototype.off,on.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ji(this,e,t),this.addEventListener=i},on.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},en(this,e,t),this.addEventListener=i},on.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=Xi(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Qi(this,e)},on.prototype.dispatchEvent=on.prototype.trigger,on.prototype.queueTrigger=function(e){var t=this;tn||(tn=new Map);var i=e.type||e,n=tn.get(this);n||(n=new Map,tn.set(this,n));var s=n.get(i);n.delete(i),r().clearTimeout(s);var a=r().setTimeout((function(){0===n.size&&(n=null,tn.delete(t)),t.trigger(e)}),0);n.set(i,a)};var un=function(e){return"function"===typeof e.name?e.name():"string"===typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},ln=function(e){return e instanceof on||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},hn=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},dn=function(e,t,i){if(!e||!e.nodeName&&!ln(e))throw new Error("Invalid target for "+un(t)+"#"+i+"; must be a DOM node or evented object.")},cn=function(e,t,i){if(!hn(e))throw new Error("Invalid event type for "+un(t)+"#"+i+"; must be a non-empty string or array.")},fn=function(e,t,i){if("function"!==typeof e)throw new Error("Invalid listener for "+un(t)+"#"+i+"; must be a function.")},pn=function(e,t,i){var n,r,s,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],s=t[1]):(n=t[0],r=t[1],s=t[2]),dn(n,e,i),cn(r,e,i),fn(s,e,i),{isTargetingSelf:a,target:n,type:r,listener:s=sn(e,s)}},mn=function(e,t,i,n){dn(e,e,t),e.nodeName?nn[t](e,i,n):e[t](i,n)},gn={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=pn(this,i,"on"),s=r.isTargetingSelf,a=r.target,o=r.type,u=r.listener;if(mn(a,"on",o,u),!s){var l=function(){return e.off(a,o,u)};l.guid=u.guid;var h=function(){return e.off("dispose",l)};h.guid=u.guid,mn(this,"on","dispose",l),mn(a,"on","dispose",h)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=pn(this,i,"one"),s=r.isTargetingSelf,a=r.target,o=r.type,u=r.listener;if(s)mn(a,"one",o,u);else{var l=function t(){e.off(a,o,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];u.apply(null,n)};l.guid=u.guid,mn(a,"one",o,l)}},any:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=pn(this,i,"any"),s=r.isTargetingSelf,a=r.target,o=r.type,u=r.listener;if(s)mn(a,"any",o,u);else{var l=function t(){e.off(a,o,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];u.apply(null,n)};l.guid=u.guid,mn(a,"any",o,l)}},off:function(e,t,i){if(!e||hn(e))$i(this.eventBusEl_,e,t);else{var n=e,r=t;dn(n,this,"off"),cn(r,this,"off"),fn(i,this,"off"),i=sn(this,i),this.off("dispose",i),n.nodeName?($i(n,r,i),$i(n,"dispose",i)):ln(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){dn(this.eventBusEl_,this,"trigger");var i=e&&"string"!==typeof e?e.type:e;if(!hn(i)){var n="Invalid event type for "+un(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(n);(this.log||Ct).error(n)}return Qi(this.eventBusEl_,e,t)}};function _n(e,t){void 0===t&&(t={});var i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=ui("span",{className:"vjs-event-bus"});return Rt(e,gn),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),r().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var vn={state:{},setState:function(e){var t,i=this;return"function"===typeof e&&(e=e()),xt(e,(function(e,n){i.state[n]!==e&&((t=t||{})[n]={from:i.state[n],to:e}),i.state[n]=e})),t&&ln(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function yn(e,t){return Rt(e,vn),e.state=Rt({},e.state,t),"function"===typeof e.handleStateChanged&&ln(e)&&e.on("statechanged",e.handleStateChanged),e}var bn=function(e){return"string"!==typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},Tn=function(e){return"string"!==typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))};function Sn(){for(var e={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&xt(t,(function(t,i){Ot(t)?(Ot(e[i])||(e[i]={}),e[i]=Sn(e[i],t)):e[i]=t}))})),e}var En=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var i in this.map_)e.call(t,this.map_[i],i,this)},e}(),wn=r().Map?r().Map:En,kn=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var i in this.set_)e.call(t,i,i,this)},e}(),Cn=r().Set?r().Set:kn,An=function(){function e(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Sn({},this.options_),t=this.options_=Sn(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var n=e&&e.id&&e.id()||"no_player";this.id_=n+"_component_"+qi()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(_n(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),yn(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Cn,this.setIntervalIds_=new Cn,this.rafIds_=new Cn,this.namedRafs_=new wn,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Wi.has(this.el_)&&Wi.delete(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=Sn(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return ui(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a],u=i;return s&&s[e]?u=s[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return"undefined"===typeof n&&(r=e),r}))),u},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var n=this,r=0;r<t.length;r++)if(!(n=n.getChild(t[r]))||!n.getChild)return;return n},t.addChild=function(t,i,n){var r,s;if(void 0===i&&(i={}),void 0===n&&(n=this.children_.length),"string"===typeof t){s=Tn(t);var a=i.componentClass||s;i.name=s;var o=e.getComponent(a);if(!o)throw new Error("Component "+a+" does not exist");if("function"!==typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,"function"===typeof r.id&&(this.childIndex_[r.id()]=r),(s=s||r.name&&Tn(r.name()))&&(this.childNameIndex_[s]=r,this.childNameIndex_[bn(s)]=r),"function"===typeof r.el&&r.el()){var u=null;this.children_[n+1]&&(this.children_[n+1].el_?u=this.children_[n+1].el_:si(this.children_[n+1])&&(u=this.children_[n+1])),this.contentEl().insertBefore(r.el(),u)}return r},t.removeChild=function(e){if("string"===typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Tn(e.name())]=null,this.childNameIndex_[bn(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,s=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"===typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||Tn(t.name));return i&&!s.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var s=t.addChild(i,n);s&&(t[i]=s)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return Di(e,t||this.contentEl())},t.$$=function(e,t){return Oi(e,t||this.contentEl())},t.hasClass=function(e){return di(this.el_,e)},t.addClass=function(e){ci(this.el_,e)},t.removeClass=function(e){fi(this.el_,e)},t.toggleClass=function(e,t){pi(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return _i(this.el_,e)},t.setAttribute=function(e,t){vi(this.el_,e,t)},t.removeAttribute=function(e){yi(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+Tn(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Pt(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+Tn(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=r().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&(r().performance.now()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=sn(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=sn(this,e),this.clearTimersOnDispose_(),i=r().setTimeout((function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),r().clearTimeout(e)),e},t.setInterval=function(e,t){e=sn(this,e),this.clearTimersOnDispose_();var i=r().setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),r().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=sn(this,e),t=r().requestAnimationFrame((function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=sn(this,t);var n=this.requestAnimationFrame((function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),r().cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var i=t[0],n=t[1];e[i].forEach((function(t,i){return e[n](i)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,i){if("string"!==typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),s=r&&r.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(s||!a)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=Tn(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[bn(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function In(e,t,i,n){return function(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Ln(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:In.bind(null,"start",0,e),end:In.bind(null,"end",1,e)}}function xn(e,t){return Array.isArray(e)?Ln(e):void 0===e||void 0===t?Ln():Ln([[e,t]])}function Rn(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=xn(0,0));for(var s=0;s<e.length;s++)i=e.start(s),(n=e.end(s))>t&&(n=t),r+=n-i;return r/t}function Dn(e){if(e instanceof Dn)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:Dt(e)&&("number"===typeof e.code&&(this.code=e.code),Rt(this,e)),this.message||(this.message=Dn.defaultMessages[this.code]||"")}An.prototype.supportsRaf_="function"===typeof r().requestAnimationFrame&&"function"===typeof r().cancelAnimationFrame,An.registerComponent("Component",An),Dn.prototype.code=0,Dn.prototype.message="",Dn.prototype.status=null,Dn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Dn.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 On=0;On<Dn.errorTypes.length;On++)Dn[Dn.errorTypes[On]]=On,Dn.prototype[Dn.errorTypes[On]]=On;function Pn(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function Mn(e){Pn(e)&&e.then(null,(function(e){}))}var Nn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},Un=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=Nn(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Nn))},Bn=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Fn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleKeyDown_=function(e){return n.handleKeyDown(e)},n.close_=function(e){return n.close(e)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=ui("div",{className:"vjs-modal-dialog-content"},{role:"document"}),n.descEl_=ui("p",{className:"vjs-modal-dialog-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),li(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-modal-dialog vjs-hidden "+e.prototype.buildCSSClass.call(this)},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.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},i.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}},i.opened=function(e){return"boolean"===typeof e&&this[e?"open":"close"](),this.opened_},i.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()}},i.closeable=function(e){if("boolean"===typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Li(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},i.empty=function(){this.trigger("beforemodalempty"),Ci(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return"undefined"!==typeof e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=a().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},i.handleKeyDown=function(e){if(e.stopPropagation(),f().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(f().isEventKey(e,"Tab")){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}a().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof r().HTMLAnchorElement||e instanceof r().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof r().HTMLInputElement||e instanceof r().HTMLSelectElement||e instanceof r().HTMLTextAreaElement||e instanceof r().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof r().HTMLIFrameElement||e instanceof r().HTMLObjectElement||e instanceof r().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(An);Fn.prototype.options_={pauseOnOpen:!0,temporary:!0},An.registerComponent("ModalDialog",Fn);var jn=function(e){function t(t){var i;void 0===t&&(t=[]),(i=e.call(this)||this).tracks_=[],Object.defineProperty((0,u.Z)(i),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)i.addTrack(t[n]);return i}(0,l.Z)(t,e);var i=t.prototype;return i.addTrack=function(e){var t=this,i=this.tracks_.length;""+i in this||Object.defineProperty(this,i,{get:function(){return this.tracks_[i]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},ln(e)&&e.addEventListener("labelchange",e.labelchange_)},i.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},i.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(on);for(var Vn in jn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},jn.prototype.allowedEvents_)jn.prototype["on"+Vn]=null;var Hn=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},qn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].enabled){Hn(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}(0,l.Z)(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&Hn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,Hn(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(jn),Gn=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},Wn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].selected){Gn(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty((0,u.Z)(i),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i}(0,l.Z)(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.selected&&Gn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){i.changing_||(i.changing_=!0,Gn(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(jn),zn=function(e){function t(){return e.apply(this,arguments)||this}(0,l.Z)(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return i.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return i.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(jn),Kn=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"===typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"===typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),Xn=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),Zn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Yn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},$n={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Qn={disabled:"disabled",hidden:"hidden",showing:"showing"},Jn=function(e){function t(t){var i;void 0===t&&(t={}),i=e.call(this)||this;
1var n={id:t.id||"vjs_track_"+qi(),kind:t.kind||"",language:t.language||""},r=t.label||"",s=function(e){Object.defineProperty((0,u.Z)(i),e,{get:function(){return n[e]},set:function(){}})};for(var a in n)s(a);return Object.defineProperty((0,u.Z)(i),"label",{get:function(){return r},set:function(e){e!==r&&(r=e,this.trigger("labelchange"))}}),i}return(0,l.Z)(t,e),t}(on),er=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=a().createElement("a");i.href=e;var n,s=""===i.host&&"file:"!==i.protocol;s&&((n=a().createElement("div")).innerHTML='<a href="'+e+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),a().body.appendChild(n));for(var o={},u=0;u<t.length;u++)o[t[u]]=i[t[u]];return"http:"===o.protocol&&(o.host=o.host.replace(/:80$/,"")),"https:"===o.protocol&&(o.host=o.host.replace(/:443$/,"")),o.protocol||(o.protocol=r().location.protocol),s&&a().body.removeChild(n),o},tr=function(e){if(!e.match(/^https?:\/\//)){var t=a().createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},ir=function(e){if("string"===typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},nr=function(e,t){void 0===t&&(t=r().location);var i=er(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},rr=Object.freeze({__proto__:null,parseUrl:er,getAbsoluteURL:tr,getFileExtension:ir,isCrossOrigin:nr}),sr=function(e,t){var i=new(r().WebVTT.Parser)(r(),r().vttjs,r().WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(r().console&&r().console.groupCollapsed&&r().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Ct.error(e)})),r().console&&r().console.groupEnd&&r().console.groupEnd()),i.flush()},ar=function(e,t){var i={uri:e},n=nr(e);n&&(i.cors=n);var s="use-credentials"===t.tech_.crossOrigin();s&&(i.withCredentials=s),m()(i,sn(this,(function(e,i,n){if(e)return Ct.error(e,i);t.loaded_=!0,"function"!==typeof r().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return sr(n,t);Ct.error("vttjs failed to load, stopping trying to process "+t.src)})):sr(n,t)})))},or=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=Sn(t,{kind:$n[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Qn[n.mode]||"disabled",s=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var a=new Xn(i.cues_),o=new Xn(i.activeCues_),l=!1,h=sn((0,u.Z)(i),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1))}));return i.tech_.one("dispose",(function(){i.tech_.off("timeupdate",h)})),"disabled"!==r&&i.tech_.on("timeupdate",h),Object.defineProperties((0,u.Z)(i),{default:{get:function(){return s},set:function(){}},mode:{get:function(){return r},set:function(e){Qn[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||ar(this.src,this),this.tech_.off("timeupdate",h),"disabled"!==r&&this.tech_.on("timeupdate",h),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var s=0;s<t.length;s++)-1===this.activeCues_.indexOf(t[s])&&(l=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),n.src?(i.src=n.src,i.preload_||(i.loaded_=!0),(i.preload_||"subtitles"!==n.kind&&"captions"!==n.kind)&&ar(i.src,(0,u.Z)(i))):i.loaded_=!0,i}(0,l.Z)(t,e);var i=t.prototype;return i.addCue=function(e){var t=e;if(r().vttjs&&!(e instanceof r().vttjs.VTTCue)){for(var i in t=new(r().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),s=0;s<n.length;s++)n[s]!==this&&n[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Jn);or.prototype.allowedEvents_={cuechange:"cuechange"};var ur=function(e){function t(t){var i;void 0===t&&(t={});var n=Sn(t,{kind:Yn[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty((0,u.Z)(i),"enabled",{get:function(){return r},set:function(e){"boolean"===typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),n.enabled&&(i.enabled=n.enabled),i.loaded_=!0,i}return(0,l.Z)(t,e),t}(Jn),lr=function(e){function t(t){var i;void 0===t&&(t={});var n=Sn(t,{kind:Zn[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty((0,u.Z)(i),"selected",{get:function(){return r},set:function(e){"boolean"===typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),n.selected&&(i.selected=n.selected),i}return(0,l.Z)(t,e),t}(Jn),hr=function(e){function t(t){var i,n;void 0===t&&(t={}),i=e.call(this)||this;var r=new or(t);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties((0,u.Z)(i),{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=0,r.addEventListener("loadeddata",(function(){n=2,i.trigger({type:"load",target:(0,u.Z)(i)})})),i}return(0,l.Z)(t,e),t}(on);hr.prototype.allowedEvents_={load:"load"}
vendor: 8,598 bytes, line 1
1,hr.NONE=0,hr.LOADING=1,hr.LOADED=2,hr.ERROR=3;var dr={audio:{ListClass:qn,TrackClass:ur,capitalName:"Audio"},video:{ListClass:Wn,TrackClass:lr,capitalName:"Video"},text:{ListClass:zn,TrackClass:or,capitalName:"Text"}};Object.keys(dr).forEach((function(e){dr[e].getterName=e+"Tracks",dr[e].privateName=e+"Tracks_"}));var cr={remoteText:{ListClass:zn,TrackClass:or,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Kn,TrackClass:hr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},fr=(0,o.Z)({},dr,cr);cr.names=Object.keys(cr),dr.names=Object.keys(dr),fr.names=[].concat(cr.names).concat(dr.names);var pr=function(e){function t(t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).onDurationChange_=function(e){return n.onDurationChange(e)},n.trackProgress_=function(e){return n.trackProgress(e)},n.trackCurrentTime_=function(e){return n.trackCurrentTime(e)},n.stopTrackingCurrentTime_=function(e){return n.stopTrackingCurrentTime(e)},n.disposeSourceHandler_=function(e){return n.disposeSourceHandler(e)},n.hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),fr.names.forEach((function(e){var i=fr[e];t&&t[i.getterName]&&(n[i.privateName]=t[i.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=!1!==t.preloadTextTracks,n.autoRemoteTextTracks_=new fr.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}(0,l.Z)(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(sn(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return xn(0,0)},i.bufferedPercent=function(){return Rn(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(dr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.crossOrigin=function(){},i.setCrossOrigin=function(){},i.error=function(e){return void 0!==e&&(this.error_=new Dn(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?xn(0,0):xn()},i.play=function(){},i.setScrubbing=function(){},i.scrubbing=function(){},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;dr.names.forEach((function(t){var i=dr[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},i.addWebVttScript_=function(){var e=this;if(!r().WebVTT)if(a().body.contains(this.el())){if(!this.options_["vtt.js"]&&Ot(_())&&Object.keys(_()).length>0)return void this.trigger("vttjsloaded");var t=a().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),r().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},a=function(){s();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};a(),t.addEventListener("change",a),t.addEventListener("addtrack",a),t.addEventListener("removetrack",a),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",a),t.removeEventListener("addtrack",a),t.removeEventListener("removetrack",a);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",s)}}))},i.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var a=new fr.text.TrackClass(r);return s.addTrack(a),a}(this,e,t,i)},i.createRemoteTextTrack=function(e){var t=Sn(e,{tech:this});return new cr.remoteTextEl.TrackClass(t)},i.addRemoteTextTrack=function(e,t){var i=this;void 0===e&&(e={});var n=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Ct.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return i.autoRemoteTextTracks_.addTrack(n.track)})),n},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.requestPictureInPicture=function(){var e=this.options_.Promise||r().Promise;if(e)return e.reject()},i.disablePictureInPicture=function(){return!0},i.setDisablePictureInPicture=function(){},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Tn(e),t.techs_[e]=i,t.techs_[bn(e)]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=Tn(e),r()&&r().videojs&&r().videojs[e]?(Ct.warn("The "+e+" tech w
1as added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),r().videojs[e]):void 0)},t}(An);fr.names.forEach((function(e){var t=fr[e];pr.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),pr.prototype.featuresVolumeControl=!0,pr.prototype.featuresMuteControl=!0,pr.prototype.featuresFullscreenResize=!1,pr.prototype.featuresPlaybackRate=!1,pr.prototype.featuresProgressEvents=!1,pr.prototype.featuresSourceset=!1,pr.prototype.featuresTimeupdateEvents=!1,pr.prototype.featuresNativeTextTracks=!1,pr.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i,n=e.sourceHandlers||[],r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(t,i))return n[r];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"===typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Ct.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},An.registerComponent("Tech",pr),pr.registerTech("Tech",pr),pr.defaultTechOrder_=[];var mr={},gr={},_r={};function vr(e,t,i){e.setTimeout((function(){return wr(t,mr[t.type],i,e)}),1)}function yr(e,t,i,n){void 0===n&&(n=null);var r="call"+Tn(i),s=e.reduce(Er(r),n),a=s===_r,o=a?null:t[i](s);return function(e,t,i,n){for(var r=e.length-1;r>=0;r--){var s=e[r];s[t]&&s[t](n,i)}}(e,i,o,a),o}var br={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},Tr={setCurrentTime:1,setMuted:1,setVolume:1},Sr={play:1,pause:1};function Er(e){return function(t,i){return t===_r?_r:i[e]?i[e](t):t}}function wr(e,t,i,n,r,s){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===s&&(s=!1);var a=t,o=a[0],u=a.slice(1);if("string"===typeof o)wr(e,mr[o],i,n,r,s);else if(o){var l=function(e,t){var i=gr[e.id()],n=null;if(void 0===i||null===i)return n=t(e),gr[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var s=i[r],a=s[0],o=s[1];a===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}(n,o);if(!l.setSource)return r.push(l),wr(e,u,i,n,r,s);l.setSource(Rt({},e),(function(t,a){if(t)return wr(e,u,i,n,r,s);r.push(l),wr(a,e.type===a.type?u:mr[a.type],i,n,r,s)}))}else u.length?wr(e,u,i,n,r,s):s?i(e,r):wr(e,mr["*"],i,n,r,!0)}var kr={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Cr=function(e){void 0===e&&(e="");var t=ir(e);return kr[t.toLowerCase()]||""},Ar=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):Dt(t)&&i.push(t)})),t=i}else t="string"===typeof t&&t.trim()?[Ir({src:t})]:Dt(t)&&"string"===typeof t.src&&t.src&&t.src.trim()?[Ir(t)]:[];return t};function Ir(e){if(!e.type){var t=Cr(e.src);t&&(e.type=t)}return e}var Lr=function(e){function t(t,i,n){var r,s=Sn({createEl:!1},i);if(r=e.call(this,t,s,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var a=0,o=i.playerOptions.techOrder;a<o.length;a++){var u=Tn(o[a]),l=pr.getTech(u);if(u||(l=An.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return r}return(0,l.Z)(t,e),t}(An);An.registerComponent("MediaLoader",Lr);var xr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseOver_=function(e){return n.handleMouseOver(e)},n.handleMouseOut_=function(e){return n.handleMouseOut(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.emitTapEvents(),n.enable(),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(t,i,n){void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i=Rt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Ct.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=Rt({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},i.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=ui("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,li(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)},i.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},i.handleLanguagechange=function(){this.controlText(this.controlText_)},i.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},i.handleKeyDown=function(t){f().isEventKey(t,"Space")||f().isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(An);An.registerComponent("ClickableComponent",xr);var Rr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update(),n.update_=function(e){return n.update(e)},t.on("posterchange",n.update_),n}(0,l.Z)(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},i.createEl=function(){return ui("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},i.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(Kt||Gt)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Mn(this.player_.play()):this.player_.pause()}},t}(xr);An.registerComponent("PosterImage",Rr);var Dr={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',
vendor: 4,648 bytes, line 1
1script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Or(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Pr(e,t,i){try{e.style[t]=i}catch(n){return}}var Mr=function(e){function t(t,i,n){var s;s=e.call(this,t,i,n)||this;var a=function(e){return s.updateDisplay(e)};return t.on("loadstart",(function(e){return s.toggleDisplay(e)})),t.on("texttrackchange",a),t.on("loadedmetadata",(function(e){return s.preselectTrack(e)})),t.ready(sn((0,u.Z)(s),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),r().addEventListener("orientationchange",a),t.on("dispose",(function(){return r().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i<e.length;i++)this.player_.addRemoteTextTrack(e[i],!0);this.preselectTrack()}}))),s}(0,l.Z)(t,e);var i=t.prototype;return i.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,a=0;a<r.length;a++){var o=r[a];s&&s.enabled&&s.language&&s.language===o.language&&o.kind in n?o.kind===s.kind?i=o:i||(i=o):s&&!s.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){"function"===typeof r().WebVTT&&r().WebVTT.processCues(r(),[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var i=[],n=0;n<e.length;++n){var r=e[n];"showing"===r.mode&&i.push(r)}this.updateForTrack(i)}else{for(var s=null,a=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?s=u:a=u)}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):s&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s))}},i.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),i=e.activeCues,n=i.length;n--;){var s=i[n];if(s){var a=s.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Pr(a.firstChild,"color",Or(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Pr(a.firstChild,"backgroundColor",Or(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Pr(a,"backgroundColor",Or(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),t.fontPercent&&1!==t.fontPercent){var o=r().parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Dr[t.fontFamily])}}},i.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"===typeof r().WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var t=[],i=0;i<e.length;++i)for(var n=e[i],s=0;s<n.activeCues.length;++s)t.push(n.activeCues[s]);r().WebVTT.processCues(r(),t,this.el_);for(var a=0;a<e.length;++a){for(var o=e[a],u=0;u<o.activeCues.length;++u){var l=o.activeCues[u].displayState;ci(l,"vjs-text-track-cue"),ci(l,"vjs-text-track-cue-"+(o.language?o.language:a))}this.player_.textTrackSettings&&this.updateDisplayState(o)}}},t}(An);An.registerComponent("TextTrackDisplay",Mr);var Nr=function(e){function t(){return e.apply(this,arguments)||this}return(0,l.Z)(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"
1Video Player"),n=ui("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(An);An.registerComponent("LoadingSpinner",Nr);var Ur=function(e){function t(){return e.apply(this,arguments)||this}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(e,t,i){void 0===t&&(t={}),void 0===i&&(i={}),t=Rt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=Rt({type:"button"},i);var n=An.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return Ct.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),An.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(t){f().isEventKey(t,"Space")||f().isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(xr);An.registerComponent("Button",Ur);var Br=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).mouseused_=!1,n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Mn(t),void(!this.player_.tech(!0)||(Kt||Gt)&&i||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var s=function(){return r.focus()};Pn(t)?t.then(s,(function(){})):this.setTimeout(s,1)}else this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(Ur);Br.prototype.controlText_="Play Video",An.registerComponent("BigPlayButton",Br);var Fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){f().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Ur);An.registerComponent("CloseButton",Fr);var jr=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",(function(e){return n.handlePlay(e)})),n.on(t,"pause",(function(e){return n.handlePause(e)})),i.replay&&n.on(t,"ended",(function(e){return n.handleEnded(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?Mn(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(Ur);jr.prototype.controlText_="Play",An.registerComponent("PlayToggle",jr);var Vr=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||a>0?r+":":"")+(n=((r||s>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},Hr=Vr;function qr(e,t){return void 0===t&&(t=e),Hr(e,t)}var Gr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],(function(e){return n.updateContent(e)})),n.updateTextNode_(),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+"\xa0</span>"});return this.contentEl_=ui("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=qr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,Ct.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=a().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},i.updateContent=function(e){},t}(An);Gr.prototype.labelText_="Time",Gr.prototype.controlText_="Time",An.registerComponent("TimeDisplay",Gr);var Wr=function(e){function t(){return e.apply(this,arguments)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(Gr);Wr.prototype.labelText_="Current Time",Wr.prototype.controlText_="Current Time",An.registerComponent("CurrentTimeDisplay",Wr);var zr=function(e){function t(t,i){var n,r=function(e){return n.updateContent(e)};return(n=e.call(this,t,i)||this).on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(Gr);zr.prototype.labelText_="Duration",zr.prototype.controlText_="Duration",An.registerComponent("DurationDisplay",zr);var Kr=function(e){function t(){return e.apply(this,arguments)||this}return(0,l.Z)(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(An);An.registerComponent("TimeDivider",Kr);var Xr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",(function(e){return n.updateContent(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(ui("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"===typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(Gr);Xr.prototype.labelText_="Remaining Time",Xr.prototype.controlText_="Remaining Time",An.registerComponent("RemainingTimeDisplay",Xr);var Zr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",(function(e){return n.updateShowing(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ui("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"\xa0</span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(An);An.registerComponent("LiveDisplay",Zr);var Yr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ui("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!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"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Ur);Yr.prototype.controlText_="Seek to live, currently playing live",An.registerComponent("SeekToLive",Yr);var $r=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Qr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}(0,l.Z)(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.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)},i.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}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=Rt({tabIndex:0},i),n=Rt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Wt||e.preventDefault(),bi(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ti(),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()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"}))),t}}
vendor: 14,991 bytes, line 1
1,i.getProgress=function(){return Number($r(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=wi(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){f().isEventKey(t,"Left")||f().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):f().isEventKey(t,"Right")||f().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(An);An.registerComponent("Slider",Qr);var Jr=function(e,t){return $r(e/t*100,0,100).toFixed(2)+"%"},es=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",(function(e){return n.update(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=ui("span",{className:"vjs-control-text"}),n=ui("span",{textContent:this.localize("Loaded")}),r=a().createTextNode(": ");return this.percentageEl_=ui("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),s=t.partEls_,a=Jr(r,n);t.percent_!==a&&(t.el_.style.width=a,li(t.percentageEl_,a),t.percent_=a);for(var o=0;o<i.length;o++){var u=i.start(o),l=i.end(o),h=s[o];h||(h=t.el_.appendChild(ui()),s[o]=h),h.dataset.start===u&&h.dataset.end===l||(h.dataset.start=u,h.dataset.end=l,h.style.left=Jr(u,r),h.style.width=Jr(l-u,r))}for(var d=s.length;d>i.length;d--)t.el_.removeChild(s[d-1]);s.length=i.length}))},t}(An);An.registerComponent("LoadProgressBar",es);var ts=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=an(sn((0,u.Z)(n),n.update),rn),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=Ei(this.el_),r=Si(this.player_.el()),s=e.width*t;if(r&&n){var a=e.left-r.left+s,o=e.width-s+(r.right-e.right),u=n.width/2;a<u?u+=u-a:o<u&&(u=o),u<0?u=0:u>n.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(i)}},i.write=function(e){li(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var s,a=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;s=(u<1?"":"-")+qr(u,o)}else s=qr(i,a);r.update(e,t,s),n&&n()}))},t}(An);An.registerComponent("TimeTooltip",ts);var is=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=an(sn((0,u.Z)(n),n.update),rn),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(An);is.prototype.options_={children:[]},Jt||jt||is.prototype.options_.children.push("timeTooltip"),An.registerComponent("PlayProgressBar",is);var ns=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=an(sn((0,u.Z)(n),n.update),rn),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(An);ns.prototype.options_={children:["timeTooltip"]},An.registerComponent("MouseTimeDisplay",ns);var rs=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}(0,l.Z)(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=sn(this,this.update),this.update=an(this.update_,rn),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.on(a(),"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===a().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,rn))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==a().visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[qr(e,r),qr(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(Si(i.el()),i.getProgress())})),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){xi(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(xi(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(i>=.99)return void n.seekToLiveEdge();var r=n.seekableStart(),s=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=s&&(t=s),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Mn(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(f().isEventKey(t,"Space")||f().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(f().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(f().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(f()(t))){t.preventDefault(),t.stopPropagation();var n=10*(f().codes[f()(t)]-f().codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else f().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):f().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.off(a(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Qr);rs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Jt||jt||rs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),An.registerComponent("SeekBar",rs);var ss=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=an(sn((0,u.Z)(n),n.handleMouseMove),rn),n.throttledHandleMouseSeek=an(sn((0,u.Z)(n),n.handleMouseSeek),rn),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),s=Ei(r),a=wi(r,e).x;a=$r(a,0,1),n&&n.update(s,a),i&&i.update(s,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Mn(this.player_.play())}},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(An);ss.prototype.options_={children:["seekBar"]},An.registerComponent("ProgressControl",ss);var as=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return n.handlePictureInPictureChange(e)})),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return n.handlePictureInPictureEnabledChange(e)})),n.disable(),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){a().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Ur);as.prototype.controlText_="Picture-in-Picture",An.registerComponent("PictureInPictureToggle",as);var os=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",(function(e){return n.handleFullscreenChange(e)})),!1===a()[t.fsApi_.fullscreenEnabled]&&n.disable(),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Ur);os.prototype.controlText_="Fullscreen",An.registerComponent("FullscreenToggle",os);var us=function(e){function t(){return e.apply(this,arguments)||this}return(0,l.Z)(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(An);An.registerComponent("VolumeLevel",us);var ls=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=an(sn((0,u.Z)(n),n.update),rn),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=Si(this.el_),s=Si(this.player_.el()),a=e.width*t;if(!s||!r)return;var o=e.left-s.left+a,u=e.width-a+(s.right-e.right),l=r.width/2;o<l?l+=l-o:u<l&&(l=u),l<0?l=0:l>r.width&&(l=r.width),this.el_.style.right="-"+l+"px"}this.write(n+"%")},i.write=function(e){li(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var s=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){s.update(e,t,i,n.toFixed(0)),r&&r()}))},t}(An);
vendor: 4,344 bytes, line 1
1An.registerComponent("VolumeLevelTooltip",ls);var hs=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=an(sn((0,u.Z)(n),n.update),rn),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,(function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"}))},t}(An);hs.prototype.options_={children:["volumeLevelTooltip"]},An.registerComponent("MouseVolumeLevelDisplay",hs);var ds=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",(function(e){return n.updateLastVolume_(e)})),n.on(t,"volumechange",(function(e){return n.updateARIAAttributes(e)})),t.ready((function(){return n.updateARIAAttributes()})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){xi(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=Si(i),r=this.vertical(),s=wi(i,e);s=r?s.y:s.x,s=$r(s,0,1),t.update(n,s,r)}xi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Qr);ds.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Jt||jt||ds.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),ds.prototype.playerEvent="volumechange",An.registerComponent("VolumeBar",ds);var cs=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,("undefined"===typeof i.volumeBar||Ot(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}((0,u.Z)(n),t),n.throttledHandleMouseMove=an(sn((0,u.Z)(n),n.handleMouseMove),rn),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n.on("touchstart",(function(e){return n.handleMouseDown(e)})),n.on("mousemove",(function(e){return n.handleMouseMove(e)})),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(An);cs.prototype.options_={children:["volumeBar"]}
vendor: 10,718 bytes, line 1
1,An.registerComponent("VolumeControl",cs);var fs=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}((0,u.Z)(n),t),n.on(t,["loadstart","volumechange"],(function(e){return n.update(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;Jt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)fi(this.el_,"vjs-vol-"+i);ci(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Ur);fs.prototype.controlText_="Mute",An.registerComponent("MuteToggle",fs);var ps=function(e){function t(t,i){var n;return void 0===i&&(i={}),"undefined"!==typeof i.inline?i.inline=i.inline:i.inline=!0,("undefined"===typeof i.volumeControl||Ot(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],(function(e){return n.volumePanelState_(e)})),n.on(n.muteToggle,"keyup",(function(e){return n.handleKeyPress(e)})),n.on(n.volumeControl,"keyup",(function(e){return n.handleVolumeControlKeyUp(e)})),n.on("keydown",(function(e){return n.handleKeyPress(e)})),n.on("mouseover",(function(e){return n.handleMouseOver(e)})),n.on("mouseout",(function(e){return n.handleMouseOut(e)})),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}(0,l.Z)(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.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")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){f().isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),Yi(a(),"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),$i(a(),"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){f().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(An);ps.prototype.options_={children:["muteToggle","volumeControl"]},An.registerComponent("VolumePanel",ps);var ms=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",(function(e){return n.handleKeyDown(e)})),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}(0,l.Z)(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof An&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof An&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"===typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=ui(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Yi(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||a().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter((function(t){return t.el()===e.target}))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},i.handleKeyDown=function(e){f().isEventKey(e,"Left")||f().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(f().isEventKey(e,"Right")||f().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(An);An.registerComponent("Menu",ms);var gs=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new Ur(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=Ur.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var s=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",s),n.on(n.menuButton_,"click",s),n.on(n.menuButton_,"keydown",(function(e){return n.handleKeyDown(e)})),n.on(n.menuButton_,"mouseenter",(function(){n.addClass("vjs-hover"),n.menu.show(),Yi(a(),"keyup",n.handleMenuKeyUp_)})),n.on("mouseleave",(function(e){return n.handleMouseLeave(e)})),n.on("keydown",(function(e){return n.handleSubmenuKeyDown(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.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()},i.createMenu=function(){var e=new ms(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=ui("li",{className:"vjs-menu-title",innerHTML:Tn(this.options_.title),tabIndex:-1}),i=new An(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)e.addItem(this.items[n]);return e},i.createItems=function(){},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Ur.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},i.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},i.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.handleMouseLeave=function(e){this.removeClass("vjs-hover"),$i(a(),"keyup",this.handleMenuKeyUp_)},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleKeyDown=function(e){f().isEventKey(e,"Esc")||f().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),f().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(f().isEventKey(e,"Up")||f().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},i.handleMenuKeyUp=function(e){(f().isEventKey(e,"Esc")||f().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},i.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},i.handleSubmenuKeyDown=function(e){(f().isEventKey(e,"Esc")||f().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),f().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},i.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Jt&&ai())return;this.menu.focus()}},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(An);An.registerComponent("MenuButton",gs);var _s=function(e){function t(t,i){var n,r=i.tracks;if((n=e.call(this,t,i)||this).items.length<=1&&n.hide(),!r)return(0,u.Z)(n);var s=sn((0,u.Z)(n),n.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),r.addEventListener("labelchange",s),n.player_.on("ready",s),n.player_.on("dispose",(function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s),r.removeEventListener("labelchange",s)})),n}return(0,l.Z)(t,e),t}(gs);An.registerComponent("TrackButton",_s);var vs=["Tab","Esc","Up","Down","Right","Left"],ys=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}(0,l.Z)(t,e);var i=t.prototype;
1return i.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",Rt({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},i.handleKeyDown=function(t){vs.some((function(e){return f().isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){this.selected(!0)},i.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))},t}(xr);An.registerComponent("MenuItem",ys);var bs=function(e){function t(t,i){var n,s=i.track,o=t.textTracks();i.label=s.label||s.language||"Unknown",i.selected="showing"===s.mode,(n=e.call(this,t,i)||this).track=s,n.kinds=(i.kinds||[i.kind||n.track.kind]).filter(Boolean);var l,h=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply((0,u.Z)(n),t)},d=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply((0,u.Z)(n),t)};(t.on(["loadstart","texttrackchange"],h),o.addEventListener("change",h),o.addEventListener("selectedlanguagechange",d),n.on("dispose",(function(){t.off(["loadstart","texttrackchange"],h),o.removeEventListener("change",h),o.removeEventListener("selectedlanguagechange",d)})),void 0===o.onchange)&&n.on(["tap","click"],(function(){if("object"!==typeof r().Event)try{l=new(r().Event)("change")}catch(e){}l||(l=a().createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(l)}));return n.handleTracksChange(),n}(0,l.Z)(t,e);var i=t.prototype;return i.handleClick=function(t){var i=this.track,n=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),n)for(var r=0;r<n.length;r++){var s=n[r];-1!==this.kinds.indexOf(s.kind)&&(s===i?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"))}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(ys);An.registerComponent("TextTrackMenuItem",bs);var Ts=function(e){function t(t,i){return i.track={player:t,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,e.call(this,t,i)||this}(0,l.Z)(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(bs);An.registerComponent("OffTextTrackMenuItem",Ts);var Ss=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return(0,l.Z)(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=bs),this.label_&&(i=this.label_+" off"),e.push(new Ts(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var s=n[r];if(this.kinds_.indexOf(s.kind)>-1){var a=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+s.kind+"-menu-item"),e.push(a)}}return e},t}(_s);An.registerComponent("TextTrackButton",Ss);var Es=function(e){function t(t,i){var n,r=i.track,s=i.cue,a=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=s.text,i.selected=s.startTime<=a&&a<s.endTime,(n=e.call(this,t,i)||this).track=r,n.cue=s,r.addEventListener("cuechange",sn((0,u.Z)(n),n.update)),n}(0,l.Z)(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},i.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(ys);An.registerComponent("ChaptersTrackMenuItem",Es);var ws=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},i.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChapter
1sTrack()),e.prototype.update.call(this)},i.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Tn(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],s=new Es(this.player_,{track:this.track_,cue:r});e.push(s)}return e},t}(Ss);ws.prototype.kind_="chapters",ws.prototype.controlText_="Chapters",An.registerComponent("ChaptersButton",ws);var ks=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var s=t.textTracks(),a=sn((0,u.Z)(r),r.handleTracksChange);return s.addEventListener("change",a),r.on("dispose",(function(){s.removeEventListener("change",a)})),r}(0,l.Z)(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var s=t[n];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ss);ks.prototype.kind_="descriptions",ks.prototype.controlText_="Descriptions",An.registerComponent("DescriptionsButton",ks);var Cs=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ss);Cs.prototype.kind_="subtitles",Cs.prototype.controlText_="Subtitles",An.registerComponent("SubtitlesButton",Cs);var As=function(e){function t(t,i){var n;return i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",(n=e.call(this,t,i)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}return(0,l.Z)(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(bs);An.registerComponent("CaptionSettingsMenuItem",As);var Is=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new As(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Ss);Is.prototype.kind_="captions",Is.prototype.controlText_="Captions",An.registerComponent("CaptionsButton",Is);var Ls=function(e){function t(){return e.apply(this,arguments)||this}return(0,l.Z)(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n      "),r+="</span>",e.prototype.createEl.call(this,t,Rt({innerHTML:r},i),n)},t}(bs);An.registerComponent("SubsCapsMenuItem",Ls);var xs=function(e){function t(t,i){var n;return void 0===i&&(i={}),(n=e.call(this,t,i)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(Tn(n.label_)),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new As(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Ls)},t}(Ss);xs.prototype.kinds_=["captions","subtitles"],xs.prototype.controlText_="Subtitles",An.registerComponent("SubsCapsButton",xs);var Rs=function(e){function t(t,i){var n,r=i.track,s=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var a=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply((0,u.Z)(n),t)};return s.addEventListener("change",a),n.on("dispose",(function(){s.removeEventListener("change",a)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n        <sp
1an aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n      "),r+="</span>",e.prototype.createEl.call(this,t,Rt({innerHTML:r},i),n)},i.handleClick=function(t){e.prototype.handleClick.call(this,t),this.track.enabled=!0},i.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(ys);An.registerComponent("AudioTrackMenuItem",Rs);var Ds=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.audioTracks(),e.call(this,t,i)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Rs(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(_s);Ds.prototype.controlText_="Audio Track",An.registerComponent("AudioTrackButton",Ds);var Os=function(e){function t(t,i){var n,r=i.rate,s=parseFloat(r,10);return i.label=r,i.selected=s===t.playbackRate(),i.selectable=!0,i.multiSelectable=!1,(n=e.call(this,t,i)||this).label=r,n.rate=s,n.on(t,"ratechange",(function(e){return n.update(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(ys);Os.prototype.contentElType="button",An.registerComponent("PlaybackRateMenuItem",Os);var Ps=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(t,"loadstart",(function(e){return n.updateVisibility(e)})),n.on(t,"ratechange",(function(e){return n.updateLabel(e)})),n.on(t,"playbackrateschange",(function(e){return n.handlePlaybackRateschange(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ui("div",{className:"vjs-playback-rate-value",id:this.labelElId_,innerHTML:"1x"}),t.appendChild(this.labelEl_),t},i.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){for(var e=this.playbackRates(),t=[],i=e.length-1;i>=0;i--)t.push(new Os(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(gs);Ps.prototype.controlText_="Playback Rate",An.registerComponent("PlaybackRateMenuButton",Ps);var Ms=function(e){function t(){return e.apply(this,arguments)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(An);An.registerComponent("Spacer",Ms);var Ns=function(e){function t(){return e.apply(this,arguments)||this}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML="\xa0",t},t}(Ms);An.registerComponent("CustomControlSpacer",Ns);var Us=function(e){function t(){return e.apply(this,arguments)||this}return(0,l.Z)(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(An);Us.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in a()&&Us.prototype.options_.children.splice(Us.prototype.options_.children.length-1,0,"pictureInPictureToggle"),An.registerComponent("ControlBar",Us);var Bs=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",(function(e){return n.open(e)})),n}(0,l.Z)(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Fn);Bs.prototype.options_=(0,o.Z)({}
vendor: 42,325 bytes, line 1
1,Fn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),An.registerComponent("ErrorDisplay",Bs);var Fs="vjs-text-track-settings",js=["#000","Black"],Vs=["#00F","Blue"],Hs=["#0FF","Cyan"],qs=["#0F0","Green"],Gs=["#F0F","Magenta"],Ws=["#F00","Red"],zs=["#FFF","White"],Ks=["#FF0","Yellow"],Xs=["1","Opaque"],Zs=["0.5","Semi-Transparent"],Ys=["0","Transparent"],$s={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[js,zs,Ws,qs,Vs,Ks,Gs,Hs]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Xs,Zs,Ys]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[zs,js,Ws,qs,Vs,Ks,Gs,Hs]},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(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Xs,Zs]},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:[Ys,Zs,Xs]}};function Qs(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}$s.windowColor.options=$s.backgroundColor.options;var Js=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind((0,u.Z)(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=ui("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),xt($s,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}(0,l.Z)(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=$s[e],s=r.id.replace("%s",this.id_),a=[t,s].join(" ").trim();return["<"+i+' id="'+s+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+a+'">'].concat(r.options.map((function(e){var t=s+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+t+'">',n.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},i.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("")},i.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("")},i.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("")},i.createElColors_=function(){return ui("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return ui("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("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ui("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("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e,t,i,n=this;return t=function(e,t,i){var r,s,a=(r=n.$(t.selector),s=t.parser,Qs(r.options[r.options.selectedIndex].value,s));return void 0!==a&&(e[i]=a),e},void 0===(i={})&&(i=0),Lt(e=$s).reduce((function(i,n){return t(i,e[n],n)}),i)},i.setValues=function(e){var t=this;xt($s,(function(i,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(Qs(e.options[n].value,i)===t){e.selectedIndex=n;break}}(t.$(i.selector),e[n],i.parser)}))},i.setDefaults=function(){var e=this;xt($s,(function(t){var i=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=i}))},i.restoreSettings=function(){var e;try{e=JSON.parse(r().localStorage.getItem(Fs))}catch(t){Ct.warn(t)}e&&this.setValues(e)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?r().localStorage.setItem(Fs,JSON.stringify(e)):r().localStorage.removeItem(Fs)}catch(t){Ct.warn(t)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(Fn);An.registerComponent("TextTrackSettings",Js);var ea=function(e){function t(t,i){var n,s=i.ResizeObserver||r().ResizeObserver;null===i.ResizeObserver&&(s=!1);var a=Sn({createEl:!s,reportTouchActivity:!1},i);return(n=e.call(this,t,a)||this).ResizeObserver=i.ResizeObserver||r().ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=function(e,t,i,n){var s;void 0===n&&(n=r());var a=function(){var r=this,a=arguments,o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(s),s=null},a}((function(){n.resizeHandler()}),100,!1,(0,u.Z)(n)),s?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){if(n.el_&&n.el_.contentWindow){var e=n.debouncedHandler_,t=n.unloadListener_=function(){$i(this,"resize",e),$i(this,"unload",t),t=null};Yi(n.el_.contentWindow,"unload",t),Yi(n.el_.contentWindow,"resize",e)}},n.one("load",n.loadListener_)),n}(0,l.Z)(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.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,e.prototype.dispose.call(this)},t}(An);An.registerComponent("ResizeManager",ea);var ta={trackingThreshold:30,liveTolerance:15},ia=function(e){function t(t,i){var n,r=Sn(ta,i,{createEl:!1});return(n=e.call(this,t,r)||this).handleVisibilityChange_=function(e){return n.handleVisibilityChange(e)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(e){return n.handlePlay(e)},n.handleFirstTimeupdate_=function(e){return n.handleFirstTimeupdate(e)},n.handleSeeked_=function(e){return n.handleSeeked(e)},n.seekToLiveEdge_=function(e){return n.seekToLiveEdge(e)},n.reset_(),n.on(n.player_,"durationchange",(function(e){return n.handleDurationchange(e)})),n.one(n.player_,"canplay",(function(){return n.toggleTracking()})),Kt&&"hidden"in a()&&"visibilityState"in a()&&n.on(a(),"visibilitychange",n.handleVisibilityChange_),n}(0,l.Z)(t,e);var i=t.prototype;return i.handleVisibilityChange=function(){this.player_.duration()===1/0&&(a().hidden?this.stopTracking():this.startTracking())},i.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(r().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;var n=this.liveCurrentTime(),s=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-s)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,rn),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"===typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(a(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(An);An.registerComponent("LiveTracker",ia);var na,ra=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var s=0;s<i.length;s++){var a=i[s].src;a&&-1===n.indexOf(a)&&n.push(a)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},sa=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=a().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=a().createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",r().Element.prototype.appendChild.call(this,i),this.innerHTML}}),aa=function(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},oa=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=function(e){return aa([e.el(),r().HTMLMediaElement.prototype,r().Element.prototype,sa],"innerHTML")}(e),s=function(i){return function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=i.apply(t,r);return ra(e),a}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=s(i[e]))})),Object.defineProperty(t,"innerHTML",Sn(n,{set:s(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},ua=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?tr(r().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return r().Element.prototype.setAttribute.call(this,"src",e),e}}),la=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=function(e){return aa([e.el(),r().HTMLMediaElement.prototype,ua],"src")}(e),n=t.setAttribute,s=t.load;Object.defineProperty(t,"src",Sn(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=function(){var i=s.call(t);return ra(e)||(e.triggerSourceset(""),oa(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):ra(e)||oa(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=s,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},ha=function(e,t,i,n){void 0===n&&(n=!0);var r=function(i){return Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0})},s={configurable:!0,enumerable:!0,get:function(){var e=i();return r(e),e}};return n&&(s.set=r),Object.defineProperty(e,t,s)},da=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r=t.source,s=!1;if(r&&(n.el_.currentSrc!==r.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(r):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var a=n.el_.childNodes,o=a.length,u=[];o--;){var l=a[o];"track"===l.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(l),n.remoteTextTracks().addTrack(l.track),n.textTracks().addTrack(l.track),s||n.el_.hasAttribute("crossorigin")||!nr(l.src)||(s=!0)):u.push(l))}for(var h=0;h<u.length;h++)n.el_.removeChild(u[h])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&s&&Ct.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),n.restoreMetadataTracksInIOSNativePlayer_(),(Yt||Qt||Ht)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}(0,l.Z)(t,e);var i=t.prototype;return i.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},i.setupSourcesetHandling_=function(){la(this)},i.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),i=function(){e=[];for(var i=0;i<t.length;i++){var n=t[i];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};i(),t.addEventListener("change",i),this.on("dispose",(function(){return t.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)}))},i.overrideNative_=function(e,t){var i=this;if(t===this["featuresNative"+e+"Tracks"]){var n=e.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(e){i.el()[n+"Tracks"].removeEventListener(e,i[n+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},i.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},i.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},i.proxyNativeTracksForType_=function(e){var t=this,i=dr[e],n=this.el()[i.getterName],r=this[i.getterName]();if(this["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var s={change:function(i){var n={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(n),"text"===e&&t[cr.remoteText.getterName]().trigger(n)},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},a=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,s=0;s<n.length;s++)if(n[s]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[i.getterName+"Listeners_"]=s,Object.keys(s).forEach((function(e){var i=s[e];n.addEventListener(e,i),t.on("dispose",(function(t){return n.removeEventListener(e,i)}))})),this.on("loadstart",a),this.on("dispose",(function(e){return t.off("loadstart",a)}))}},i.proxyNativeTracks_=function(){var e=this;dr.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},i.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=a().createElement("video");var n=Sn({},this.options_.tag&&gi(this.options_.tag));Yt&&!0===this.options_.nativeControlsForTouch||delete n.controls,mi(e,Rt(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&vi(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var r=["loop","muted","playsinline","autoplay"],s=0;s<r.length;s++){var o=r[s],u=this.options_[o];"undefined"!==typeof u&&(u?vi(e,o,o):yi(e,o),e[o]=u)}return e},i.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ei?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Ct(t,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&jt&&Wt&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"===typeof this.el_.webkitEnterFullScreen){var e=r().navigator&&r().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Mn(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}),0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=a().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),r().performance&&"function"===typeof r().performance.now?e.creationTime=r().performance.now():r().performance&&r().performance.timing&&"number"===typeof r().performance.timing.navigationStart&&(e.creationTime=r().Date.now()-r().performance.timing.navigationStart),e},t}(pr);ha(da,"TEST_VID",(function(){if(ri()){var e=a().createElement("video"),t=a().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),da.isSupported=function(){try{da.TEST_VID.volume=.5}catch(e){return!1}return!(!da.TEST_VID||!da.TEST_VID.canPlayType)},da.canPlayType=function(e){return da.TEST_VID.canPlayType(e)},da.canPlaySource=function(e,t){return da.canPlayType(e.type)},da.canControlVolume=function(){try{var e=da.TEST_VID.volume;return da.TEST_VID.volume=e/2+.1,e!==da.TEST_VID.volume}catch(t){return!1}},da.canMuteVolume=function(){try{var e=da.TEST_VID.muted;return da.TEST_VID.muted=!e,da.TEST_VID.muted?vi(da.TEST_VID,"muted","muted"):yi(da.TEST_VID,"muted"),e!==da.TEST_VID.muted}catch(t){return!1}},da.canControlPlaybackRate=function(){if(jt&&Wt&&zt<58)return!1;try{var e=da.TEST_VID.playbackRate;return da.TEST_VID.playbackRate=e/2+.1,e!==da.TEST_VID.playbackRate}catch(t){return!1}},da.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(a().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},da.supportsNativeTextTracks=function(){return ei||Jt&&Wt},da.supportsNativeVideoTracks=function(){return!(!da.TEST_VID||!da.TEST_VID.videoTracks)},da.supportsNativeAudioTracks=function(){return!(!da.TEST_VID||!da.TEST_VID.audioTracks)},da.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],i=e[1];ha(da.prototype,t,(function(){return da[i]()}),!0)})),da.prototype.movingMediaElementInDOM=!Jt,da.prototype.featuresFullscreenResize=!0,da.prototype.featuresProgressEvents=!0,da.prototype.featuresTimeupdateEvents=!0,da.patchCanPlayType=function(){Vt>=4&&!qt&&!Wt&&(na=da.TEST_VID&&da.TEST_VID.constructor.prototype.canPlayType,da.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":na.call(this,e)})},da.unpatchCanPlayType=function(){var e=da.TEST_VID.constructor.prototype.canPlayType;return na&&(da.TEST_VID.constructor.prototype.canPlayType=na),e},da.patchCanPlayType(),da.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},da.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){da.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){da.prototype["set"+Tn(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){da.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){da.prototype["set"+Tn(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){da.prototype[e]=function(){return this.el_[e]()}})),pr.withSourceHandlers(da),da.nativeSourceHandler={},da.nativeSourceHandler.canPlayType=function(e){try{return da.TEST_VID.canPlayType(e)}catch(t){return""}},da.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return da.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ir(e.src);return da.nativeSourceHandler.canPlayType("video/"+i)}return""},da.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},da.nativeSourceHandler.dispose=function(){},da.registerSourceHandler(da.nativeSourceHandler),pr.registerTech("Html5",da);var ca=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],fa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},pa=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};pa.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;ma[e]="vjs-layout-"+t}));var ga={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},_a=function(e){function t(i,n,r){var s;if(i.id=i.id||n.id||"vjs_video_"+qi(),(n=Rt(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"===typeof i.closest){var o=i.closest("[lang]");o&&o.getAttribute&&(n.language=o.getAttribute("lang"))}else for(var l=i;l&&1===l.nodeType;){if(gi(l).hasOwnProperty("lang")){n.language=l.getAttribute("lang");break}l=l.parentNode}if((s=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return s.documentFullscreenChange_(e)},s.boundFullWindowOnEscKey_=function(e){return s.fullWindowOnEscKey(e)},s.boundUpdateStyleEl_=function(e){return s.updateStyleEl_(e)},s.boundApplyInitTime_=function(e){return s.applyInitTime_(e)},s.boundUpdateCurrentBreakpoint_=function(e){return s.updateCurrentBreakpoint_(e)},s.boundHandleTechClick_=function(e){return s.handleTechClick_(e)},s.boundHandleTechDoubleClick_=function(e){return s.handleTechDoubleClick_(e)},s.boundHandleTechTouchStart_=function(e){return s.handleTechTouchStart_(e)},s.boundHandleTechTouchMove_=function(e){return s.handleTechTouchMove_(e)},s.boundHandleTechTouchEnd_=function(e){return s.handleTechTouchEnd_(e)},s.boundHandleTechTap_=function(e){return s.handleTechTap_(e)},s.isFullscreen_=!1,s.log=At(s.id_),s.fsApi_=bt,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!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=i,s.tagAttributes=i&&gi(i),s.language(s.options_.language),n.languages){var h={};Object.getOwnPropertyNames(n.languages).forEach((function(e){h[e.toLowerCase()]=n.languages[e]})),s.languages_=h}else s.languages_=t.prototype.options_.languages;s.resetCache_(),s.poster_=n.poster||"",s.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],i.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach((function(e){if("function"!==typeof s[e])throw new Error('plugin "'+e+'" does not exist')})),s.scrubbing_=!1,s.el_=s.createEl(),_n((0,u.Z)(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(Yi(a(),s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var d=Sn(s.options_);n.plugins&&Object.keys(n.plugins).forEach((function(e){s[e](n.plugins[e])})),n.debug&&s.debug(!0),s.options_.playerOptions=d,s.middleware_=[],s.playbackRates(n.playbackRates),s.initChildren(),s.isAudio("audio"===i.nodeName.toLowerCase()),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"),Yt&&s.addClass("vjs-touch-enabled"),Jt||s.addClass("vjs-workinghover"),t.players[s.id_]=(0,u.Z)(s);var c=yt.split(".")[0];return s.addClass("vjs-v"+c),s.userActive(!0),s.reportUserActivity(),s.one("play",(function(e){return s.listenForUserActivity_(e)})),s.on("stageclick",(function(e){return s.handleStageClick_(e)})),s.on("keydown",(function(e){return s.handleKeyDown(e)})),s.on("languagechange",(function(e){return s.handleLanguagechange(e)})),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s}(0,l.Z)(t,e);var i=t.prototype;return i.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),$i(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),$i(a(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),gr[this.id()]=null,fr.names.forEach((function(e){var t=fr[e],n=i[t.getterName]();n&&n.off&&n.off()})),e.prototype.dispose.call(this)},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:s||(t=this.el_=e.prototype.createEl.call(this,"div"));var o=gi(i);if(s){for(t=this.el_=i,i=this.tag=a().createElement("video");t.children.length;)i.appendChild(t.firstChild);di(t,"video-js")||ci(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{i[e]=t[e]}catch(n){}}))}if(i.setAttribute("tabindex","-1"),o.tabindex="-1",(Kt||Wt&&Zt)&&(i.setAttribute("role","application"),o.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){s&&"class"===e||t.setAttribute(e,o[e]),s&&i.setAttribute(e,o[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==r().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ji("vjs-styles-dimensions");var u=Di(".vjs-styles-defaults"),l=Di("head");l.insertBefore(this.styleEl_,u?u.nextSibling:l.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var h=i.getElementsByTagName("a"),d=0;d<h.length;d++){var c=h.item(d);ci(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),hi(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t,t},i.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):Ct.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},i.width=function(e){return this.dimension("width",e)},i.height=function(e){return this.dimension("height",e)},i.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?Ct.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},i.fluid=function(e){var t,i,n=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,ln(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)},ln(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},i.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},i.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},i.updateStyleEl_=function(){if(!0!==r().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,i,n=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),s=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Vi(this.styleEl_,"\n      ."+i+" {\n        width: "+e+"px;\n        height: "+t+"px;\n      }\n\n      ."+i+".vjs-fluid {\n        padding-top: "+100*s+"%;\n      }\n    ")}else{var a="number"===typeof this.width_?this.width_:this.options_.width,o="number"===typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(a>=0&&(u.width=a),o>=0&&(u.height=o))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=Tn(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(pr.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var s=this.autoplay();("string"===typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(s=!1);var a={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};fr.names.forEach((function(e){var t=fr[e];a[t.getterName]=i[t.privateName]})),Rt(a,this.options_[n]),Rt(a,this.options_[r]),Rt(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);var o=pr.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(a),this.tech_.ready(sn(this,this.handleTechReady_),!0),Bn(this.textTracksJson_||[],this.tech_),ca.forEach((function(e){i.on(i.tech_,e,(function(t){return i["handleTech"+Tn(e)+"_"](t)}))})),Object.keys(fa).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+fa[e]+"_"].bind(i),event:t}):i["handleTech"+fa[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return i.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return i.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return i.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return i.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return i.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return i.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return i.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return i.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return i.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return i.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return i.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return i.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return i.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return i.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return i.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return i.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return i.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||hi(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;fr.names.forEach((function(t){var i=fr[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=Un(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&Ct.warn("Using the tech directly can be dangerous. I hope you know 
1what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"mouseup",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.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_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"===typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=function(){t.muted(e)};t.playTerminatedQueue_.push(i);var n=t.play();if(Pn(n))return n.catch(i)};if("any"===e&&!0!==this.muted()?Pn(i=this.play())&&(i=i.catch(n)):i="muted"===e&&!0!==this.muted()?n():this.play(),Pn(i))return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var s=n[r];if(s.type&&s.src&&s.src===t)return s.type}return Cr(t)}(this,t)),this.cache_.source=Sn({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],s=this.$$("source"),a=[],o=0;o<s.length;o++){var u=gi(s[o]);r.push(u),u.src&&u.src===t&&a.push(u.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},i.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var i=t.techGet("currentSrc");t.lastSource_.tech=i,t.updateSourceCaches_(i)}}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},i.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},i.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},i.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))}))},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(Ct.warn("Passing the `starttime` option to the player will be deprecated 
1in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){xi(e)&&this.controls_&&(this.paused()?Mn(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=a()[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},i.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen))},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},i.techCall_=function(e,t){this.ready((function(){if(e in Tr)return function(e,t,i,n){return t[i](e.reduce(Er(i),n))}(this.middleware_,this.tech_,e,t);if(e in Sr)return yr(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Ct(i),i}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in br)return function(e,t,i){return e.reduceRight(Er(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Sr)return yr(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Ct("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Ct("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Ct(t),t}}},i.play=function(){var e=this,t=this.options_.Promise||r().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;void 0===e&&(e=Mn),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!ei&&!Jt||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}
vendor: 11,716 bytes, line 1
1))},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||xn(0,0)},i.scrubbing=function(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return"undefined"!==typeof e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=xn(0,0)),e},i.bufferedPercent=function(){return Rn(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},i.requestFullscreen=function(e){var t=this.options_.Promise||r().Promise;if(t){var i=this;return new t((function(t,n){function r(){i.off("fullscreenerror",a),i.off("fullscreenchange",s)}function s(){r(),t()}function a(e,t){r(),n(t)}i.one("fullscreenchange",s),i.one("fullscreenerror",a);var o=i.requestFullscreenHelper_(e);if(o)return o.then(r,r),o}))}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then((function(){return i.isFullscreen(!0)}),(function(){return i.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||r().Promise;if(e){var t=this;return new e((function(e,i){function n(){t.off("fullscreenerror",s),t.off("fullscreenchange",r)}function r(){n(),e()}function s(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",s);var a=t.exitFullscreenHelper_();if(a)return a.then(n,n),a}))}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=a()[this.fsApi_.exitFullscreen]();return t&&t.then((function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a().documentElement.style.overflow,Yi(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow="hidden",ci(a().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){f().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,$i(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow=this.docOrigOverflow,fi(a().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in a()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in a())return a().exitPictureInPicture()},i.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"===typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return f().isEventKey(e,"f")}:i,r=t.muteKey,s=void 0===r?function(e){return f().isEventKey(e,"m")}:r,o=t.playPauseKey,u=void 0===o?function(e){return f().isEventKey(e,"k")||f().isEventKey(e,"Space")}:o;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var l=An.getComponent("FullscreenToggle");!1!==a()[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else if(s.call(this,e)){e.preventDefault(),e.stopPropagation(),An.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(u.call(this,e)){e.preventDefault(),e.stopPropagation(),An.getComponent("PlayToggle").prototype.handleClick.call(this,e)}},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],s=pr.getTech(r);if(s||(s=An.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e)))return t}else Ct.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},i.selectSource=function(e){var t,i=this,n=this.options_.techOrder.map((function(e){return[e,pr.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(Ct.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),r=function(e,t,i){var n;return e.some((function(e){return t.some((function(t){if(n=i(e,t))return!0}))})),n},s=function(e,t){var n=e[0];if(e[1].canPlaySource(t,i.options_[n.toLowerCase()]))return{source:t,tech:n}};return(this.options_.sourceOrder?r(e,n,(t=s,function(e,i){return t(i,e)})):r(n,e,s))||!1},i.handleSrc_=function(e,t){var i=this;if("undefined"===typeof e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var n=Ar(e);if(n.length){if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),vr(this,n[0],(function(e,r){var s,a;if(i.middleware_=r,t||(i.cache_.sources=n),i.updateSourceCaches_(e),i.src_(e))return n.length>1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void i.triggerReady());s=r,a=i.tech_,s.forEach((function(e){return e.setTech&&e.setTech(a)}))})),this.options_.retryOnError&&n.length>1){var r=function(){i.error(null),i.handleSrc_(n.slice(1),!0)},s=function(){i.off("error",r)};this.one("error",r),this.one("playing",s),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",s)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,Tn(t)!==Tn(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,t=this.options_.Promise||r().Promise;this.paused()||!t?this.doReset_():Mn(this.play().then((function(){return e.doReset_()})))},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),ln(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"===typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"===typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t="undefined"===typeof t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.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"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControl
vendor: 4,409 bytes, line 1
1sListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){if(void 0===e)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&4===e.code){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Dn(e),this.addClass("vjs-error"),Ct.error("(CODE:"+this.error_.code+" "+Dn.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n=sn(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r);var s,a=this.getChild("controlBar");!a||Jt||jt||(a.on("mouseenter",(function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s);var e=this.options_.inactivityTimeout;e<=0||(s=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ln(this)&&this.trigger("languagechange"))},i.languages=function(){return Sn(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=Sn(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=Sn(n)).player=void 0,e.tracks[i]=n}return e},i.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new Fn(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},i.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<pa.length;i++){var n=pa[i];
vendor: 6,945 bytes, line 1
1if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(ma[e]),this.addClass(ma[n]),this.breakpoint_=n;break}}},i.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},i.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Rt({},ga,e),this.updateCurrentBreakpoint_()),Rt(this.breakpoints_)},i.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},i.currentBreakpoint=function(){return this.breakpoint_},i.currentBreakpointClass=function(){return ma[this.breakpoint_]||""},i.loadMedia=function(e,t){var i=this;if(e&&"object"===typeof e){this.reset(),this.cache_.media=Sn(e);var n=this.cache_.media,r=n.artwork,s=n.poster,a=n.src,o=n.textTracks;!r&&s&&(this.cache_.media.artwork=[{src:s,type:Cr(s)}]),a&&this.src(a),s&&this.poster(s),Array.isArray(o)&&o.forEach((function(e){return i.addRemoteTextTrack(e,!1)})),this.ready(t)}},i.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Cr(t.poster)}]),t}return Sn(this.cache_.media)},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=gi(e),n=i["data-setup"];if(di(e,"vjs-fill")&&(i.fill=!0),di(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var r=d()(n||"{}"),s=r[0],a=r[1];s&&Ct.error(s),Rt(i,a)}if(Rt(t,i),e.hasChildNodes())for(var o=e.childNodes,u=0,l=o.length;u<l;u++){var h=o[u],c=h.nodeName.toLowerCase();"source"===c?t.sources.push(gi(h)):"track"===c&&t.tracks.push(gi(h))}return t},i.flexNotSupported_=function(){var e=a().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},i.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},i.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((function(e){return"number"===typeof e}))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(An);fr.names.forEach((function(e){var t=fr[e];_a.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),_a.prototype.crossorigin=_a.prototype.crossOrigin,_a.players={};var va=r().navigator;_a.prototype.options_={techOrder:pr.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:va&&(va.languages&&va.languages[0]||va.userLanguage||va.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){_a.prototype[e]=function(){return this.techGet_(e)}})),ca.forEach((function(e){_a.prototype["handleTech"+Tn(e)+"_"]=function(){return this.trigger(e)}})),An.registerComponent("Player",_a);var ya="plugin",ba={},Ta=function(e){return ba.hasOwnProperty(e)},Sa=function(e){return Ta(e)?ba[e]:void 0},Ea=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},wa=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},ka=function(e,t){return t.prototype.name=e,function(){wa(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var s=(0,v.Z)(t,[this].concat(n));return this[e]=function(){return s},wa(this,s.getEventHash()),s}},Ca=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),_n(this),delete this.trigger,yn(this,this.constructor.defaultState),Ea(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),Qi(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=ka(e,ba[e])},e.isBasic=function(t){var i="string"===typeof t?Sa(t):t;return"function"===typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!==typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(Ta(t))Ct.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(_a.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!==typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof i+".");return ba[t]=i,t!==ya&&(e.isBasic(i)?_a.prototype[t]=function(e,t){var i=function(){wa(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Ea(this,e),wa(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(t,i):_a.prototype[t]=ka(t,i)),i},e.deregisterPlugin=function(e){if(e===ya)throw new Error("Cannot de-register base plugin.");Ta(e)&&(delete ba[e],delete _a.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(ba)),e.forEach((function(e){var i=Sa(e);i&&((t=t||{})[e]=i)})),t},e.getPluginVersion=function(e){var t=Sa(e);return t&&t.VERSION||""},e}();Ca.getPlugin=Sa,Ca.BASE_PLUGIN_NAME=ya,Ca.registerPlugin(ya,Ca),_a.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},_a.prototype.hasPlugin=function(e){return!!Ta(e)};var Aa=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Ia(e,t,i){var n=Ia.getPlayer(e);if(n)return t&&Ct.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"===typeof e?Di("#"+Aa(e)):e;if(!si(r))throw new TypeError("The element or ID supplied is not val
1id. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||Ct.warn("The element supplied is not included in the DOM"),t=t||{},Ia.hooks("beforesetup").forEach((function(e){var i=e(r,Sn(t));Dt(i)&&!Array.isArray(i)?t=Sn(t,i):Ct.error("please return an object in beforesetup hooks")}));var s=An.getComponent("Player");return n=new s(r,t,i),Ia.hooks("setup").forEach((function(e){return e(n)})),n}if(Ia.hooks_={},Ia.hooks=function(e,t){return Ia.hooks_[e]=Ia.hooks_[e]||[],t&&(Ia.hooks_[e]=Ia.hooks_[e].concat(t)),Ia.hooks_[e]},Ia.hook=function(e,t){Ia.hooks(e,t)},Ia.hookOnce=function(e,t){Ia.hooks(e,[].concat(t).map((function(t){return function i(){return Ia.removeHook(e,i),t.apply(void 0,arguments)}})))},Ia.removeHook=function(e,t){var i=Ia.hooks(e).indexOf(t);return!(i<=-1)&&(Ia.hooks_[e]=Ia.hooks_[e].slice(),Ia.hooks_[e].splice(i,1),!0)},!0!==r().VIDEOJS_NO_DYNAMIC_STYLE&&ri()){var La=Di(".vjs-styles-defaults");if(!La){La=ji("vjs-styles-defaults");var xa=Di("head");xa&&xa.insertBefore(La,xa.firstChild),Vi(La,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}Ui(1,Ia),Ia.VERSION=yt,Ia.options=_a.prototype.options_,Ia.getPlayers=function(){return _a.players},Ia.getPlayer=function(e){var t,i=_a.players;if("string"===typeof e){var n=Aa(e),r=i[n];if(r)return r;t=Di("#"+n)}else t=e;if(si(t)){var s=t,a=s.player,o=s.playerId;if(a||i[o])return a||i[o]}},Ia.getAllPlayers=function(){return Object.keys(_a.players).map((function(e){return _a.players[e]})).filter(Boolean)},Ia.players=_a.players,Ia.getComponent=An.getComponent,Ia.registerComponent=function(e,t){pr.isTech(t)&&Ct.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),An.registerComponent.call(An,e,t)},Ia.getTech=pr.getTech,Ia.registerTech=pr.registerTech,Ia.use=function(e,t){mr[e]=mr[e]||[],mr[e].push(t)},Object.defineProperty(Ia,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ia.middleware,"TERMINATOR",{value:_r,writeable:!1,enumerable:!0}),Ia.browser=ti,Ia.TOUCH_ENABLED=Yt,Ia.extend=function(e,t){void 0===t&&(t={});var i=function(){e.apply(this,arguments)},n={};for(var r in"object"===typeof t?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"===typeof t&&(i=t),(0,y.Z)(i,e),e&&(i.super_=e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i},Ia.mergeOptions=Sn,Ia.bind=sn,Ia.registerPlugin=Ca.registerPlugin,Ia.deregisterPlugin=Ca.deregisterPlugin,Ia.plugin=function(e,t){return Ct.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ca.registerPlugin(e,t)},Ia.getPlugins=Ca.getPlugins,Ia.getPlugin=Ca.getPlugin,Ia.getPluginVersion=Ca.getPluginVersion,Ia.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),Ia.options.languages=Sn(Ia.options.languages,((i={})[e]=t,i)),Ia.options.languages[e]},Ia.log=Ct,Ia.createLogger=At,Ia.createTimeRange=Ia.createTimeRanges=xn,Ia.formatTime=qr,Ia.setFormatTime=function(e){Hr=e},Ia.resetFormatTime=function(){Hr=Vr},Ia.parseUrl=er,Ia.isCrossOrigin=nr,Ia.EventTarget=on,Ia.on=Yi,Ia.one=Ji,Ia.off=$i,Ia.trigger=Qi,Ia.xhr=m(),Ia.TextTrack=or,Ia.AudioTrack=ur,Ia.VideoTrack=lr,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Ia[e]=function(){return Ct.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Pi[e].apply(null,arguments)}})),Ia.computedStyle=Pt,Ia.dom=Pi,Ia.url=rr,Ia.defineLazyProperty=ha,Ia.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Ra=E,Da=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Oa=function(e){return Ia.log.debug?Ia.log.debug.bind(Ia,"VHS:",e+" >"):function(){}},Pa=1/30,Ma=.1,Na=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return Ia.createTimeRanges(n)},Ua=function(e,t){return Na(e,(function(e,i){return e-Ma<=t&&i+Ma>=t}))},Ba=function(e,t){return Na(e,(function(e){return e-Pa>=t}))},Fa=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},ja=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Va=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Ha=Ia.createTimeRange,qa=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEac
vendor: 9,696 bytes, line 1
1h((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},Ga=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Wa=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return n+=i&&i.length?i.length:0}},za=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=Ga(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Ka=function(e,t,i){if("undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if("undefined"!==typeof(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;var r=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if("undefined"!==typeof(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=i.duration,"undefined"!==typeof i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:n.result+i},Xa=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return r()[1/0]}return Ka(e,t,i)},Za=function(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,s=0;if(n>r){var a=[r,n];n=a[0],r=a[1]}if(n<0){for(var o=n;o<Math.min(0,r);o++)s+=t;n=0}for(var u=n;u<r;u++)s+=i[u].duration;return s},Ya=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return Xa(e);if(null===t)return null;t=t||0;var r=Ka(e,e.mediaSequence+e.segments.length,t);return i&&(r-=n="number"===typeof n?n:za(null,e)),Math.max(0,r)},$a=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Qa=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Ja=function(e){var t=$a(e);return!e.disabled&&!t},eo=function(e,t){return t.attributes&&t.attributes[e]},to=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!Ja(e)&&(e.attributes.BANDWIDTH||0)<i})).length},io=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri))))},no=function(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},n=!1;for(var r in i){for(var s in i[r])if(n=t(i[r][s]))break;if(n)break}return!!n},ro=function(e){if(!e||!e.playlists||!e.playlists.length)return no(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;return n&&n.split(",").every((function(e){return V(e)}))||no(e,(function(e){return io(i,e)}))?"continue":{v:!1}},i=0;i<e.playlists.length;i++){var n=t(i);if("continue"!==n&&"object"===typeof n)return n.v}return!0},so={liveEdgeDelay:za,duration:Xa,seekable:function(e,t,i){var n=t||0,r=Ya(e,t,!0,i);return null===r?Ha():Ha(n,r)},getMediaInfoForTime:function(e){for(var t=e.playlist,i=e.currentTime,n=e.startingSegmentIndex,r=e.startingPartIndex,s=e.startTime,a=i-s,o=qa(t),u=0,l=0;l<o.length;l++){var h=o[l];if(n===h.segmentIndex&&("number"!==typeof r||"number"!==typeof h.partIndex||r===h.partIndex)){u=l;break}}if(a<0){if(u>0)for(var d=u-1;d>=0;d--){var c=o[d];if((a+=c.duration)+Pa>0)return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:s-Za({defaultDuration:t.targetDuration,durationList:o,startIndex:u,endIndex:d})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:i}}if(u<0){for(var f=u;f<0;f++)if((a-=t.targetDuration)<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:i};u=0}for(var p=u;p<o.length;p++){var m=o[p];if((a-=m.duration)-Pa<0)return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:s+Za({defaultDuration:t.targetDuration,durationList:o,startIndex:u,endIndex:p})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:i}},isEnabled:Ja,isDisabled:function(e){return e.disabled},isBlacklisted:$a,isIncompatible:Qa,playlistEnd:Ya,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:eo,estimateSegmentRequestTime:function(e,t,i,n){return void 0===n&&(n=0),eo("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*n)/t:NaN},isLowestEnabledRendition:to,isAudioOnly:ro,playlistMatch:io},ao=Ia.log,oo=function(e,t){return e+"-"+t},uo=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(i){if(e.mediaGroups[i])for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var s=e.mediaGroups[i][n][r];t(s,i,n,r)}}))},lo=function(e){var t=e.playlist,i=e.uri,n=e.id;t.id=n,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}},ho=function(e,t){e.uri=t;for(var i=0;i<e.playlists.length;i++)if(!e.playlists[i].uri){var n="placeholder-uri-"+i;e.playlists[i].uri=n}uo(e,(function(t,i,n,r){var s="placeholder-uri-"+i+"-"+n+"-"+r;t.playlists&&t.playlists.length||(t.playlists=[(0,o.Z)({},t)]),t.playlists.forEach((function(t,i){var n=oo(i,s);t.uri?t.resolvedUri=t.resolvedUri||Ra(e.uri,t.uri):(t.uri=0===i?s:n,t.resolvedUri=t.uri),t.id=t.id||n,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];lo({playlist:i,id:oo(t,i.uri)}),i.resolvedUri=Ra(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||ao.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){uo(e,(function(t){t.uri&&(t.resolvedUri=Ra(e.uri,t.uri))}))}(e)},co=Ia.mergeOptions,fo=Ia.EventTarget,po=function(e,t){if(!e)return t;var i=co(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=co(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},mo=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Ra(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Ra(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Ra(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Ra(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=Ra(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=Ra(t,e.uri))}))},go=function(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(var n=0;n<i.preloadHints.length;n++)if("MAP"===i.preloadHints[n].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},_o=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence},vo=function(e,t,i){void 0===i&&(i=_o);var n=co(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=go(t);var s=co(r,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var a=0;a<t.skip.skippedSegments;a++)t.segments.unshift({skipped:!0})}s.segments=function(e,t,i){var n=e.slice(),r=t.slice();i=i||0;for(var s,a=[],o=0;o<r.length;o++){var u=n[o+i],l=r[o];u?(s=u.map||s,a.push(po(u,l))):(s&&!l.map&&(l.map=s),a.push(l))}return a}(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}s.segments.forEach((function(e){mo(e,s.resolvedUri)}));for(var o=0;o<n.playlists.length;o++)n.playlists[o].id===t.id&&(n.playlists[o]=s);return n.playlists[t.id]=s,n.playlists[t.uri]=s,uo(e,(function(e,i,n,r){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=t)})),n},yo=function(e,t){var i=e.segments[e.segments.length-1],n=i&&i.parts&&i.parts[i.parts.length-1],r=n&&n.duration||i&&i.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)},bo=function(e){function t(t,i,n){var r;if(void 0===n&&(n={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=Oa("PlaylistLoader");var s=n,a=s.withCredentials,o=void 0!==a&&a,l=s.handleManifestRedirects,h=void 0!==l&&l;r.src=t,r.vhs_=i,r.withCredentials=o,r.handleManifestRedirects=h;var d=i.options_;return r.customTagParsers=d&&d.customTagParsers||[],r.customTagMappers=d&&d.customTagMappers||[],r.experimentalLLHLS=d&&d.experimentalLLHLS||!1,r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind((0,u.Z)(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}(0,l.Z)(t,e);var i=t.prototype;return i.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),i=Ra(this.master.uri,t.uri);this.experimentalLLHLS&&(i=function(e,t){if(t.endList)return e;var i=[];if(t.serverControl&&t.serverControl.canBlockReload){var n=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(n){var s=n.parts||[],a=Wa(t)-1;a>
1-1&&a!==s.length-1&&i.push("_HLS_part="+a),(a>-1||s.length)&&r--}i.unshift("_HLS_msn="+r)}return t.serverControl&&t.serverControl.canSkipUntil&&i.unshift("_HLS_skip="+(t.serverControl.canSkipDateranges?"v2":"YES")),i.forEach((function(t,i){e+=(0===i?"?":"&")+t})),e}(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},(function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,s=void 0===r?[]:r,a=e.customTagMappers,o=void 0===a?[]:a,u=e.experimentalLLHLS,l=new M;t&&l.on("warn",t),i&&l.on("info",i),s.forEach((function(e){return l.addParser(e)})),o.forEach((function(e){return l.addTagMapper(e)})),l.push(n),l.end();var h=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){h.hasOwnProperty(e)&&delete h[e]})),h.segments&&h.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!h.targetDuration){var d=10;h.segments&&h.segments.length&&(d=h.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+d),h.targetDuration=d}var c=Ga(h);if(c.length&&!h.partTargetDuration){var f=c.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+f),ao.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),h.partTargetDuration=f}return h}({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=this,i=e.playlistString,n=e.playlistObject,s=e.url,a=e.id;this.request=null,this.state="HAVE_METADATA";var o=n||this.parseManifest_({url:s,manifestString:i});o.lastRequest=Date.now(),lo({playlist:o,uri:s,id:a});var u=vo(this.master,o);this.targetDuration=o.partTargetDuration||o.targetDuration,u?(this.master=u,this.media_=this.master.playlists[a]):this.trigger("playlistunchanged"),this.media().endList||(r().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=r().setTimeout((function(){t.trigger("mediaupdatetimeout")}),yo(this.media(),!!u))),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),r().clearTimeout(this.mediaUpdateTimeout),r().clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(r().clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=r().setTimeout(this.media.bind(this,e,!1),n)}else{var s=this.state,a=!this.media_||e.id!==this.media_.id,o=this.master.playlists[e.id];if(o&&o.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===s?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Da(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,s);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===s?i.trigger("loadedmetadata"):i.trigger("mediachange")}}))}}},i.pause=function(){this.stopRequest(),r().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;r().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=r().setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;
vendor: 80,274 bytes, line 1
1if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=r().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Da(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}}))},i.srcUri=function(){return"string"===typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,ho(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=go(e),e.segments.forEach((function(t){mo(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||r().location.href;this.master=function(e,t){var i=oo(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:r().location.href,resolvedUri:r().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(fo),To=Ia.xhr,So=Ia.mergeOptions,Eo=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},wo=function(){var e=function e(t,i){t=So({timeout:45e3},t);var n=e.beforeRequest||Ia.Vhs.xhr.beforeRequest;if(n&&"function"===typeof n){var r=n(t);r&&(t=r)}var s=(!0===Ia.Vhs.xhr.original?To:Ia.Vhs.xhr)(t,(function(e,t){return Eo(s,e,t,i)})),a=s.abort;return s.abort=function(){return s.aborted=!0,a.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s};return e.original=!0,e},ko=function(e){var t={};return e.byterange&&(t.Range=function(e){var t=e.offset+e.length-1;return"bytes="+e.offset+"-"+t}(e.byterange)),t},Co=function(e,t){return e.start(t)+"-"+e.end(t)},Ao=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Io=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Lo=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},xo=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ro=function(e){return e.resolvedUri},Do=function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",r=0;r<t.length/i;r++)n+=t.slice(r*i,r*i+i).map(Ao).join("")+" "+t.slice(r*i,r*i+i).map(Io).join("")+"\n";return n},Oo=Object.freeze({__proto__:null,createTransferableMessage:Lo,initSegmentId:xo,segmentKeyId:Ro,hexDump:Do,tagDump:function(e){var t=e.bytes;return Do(t)},textRanges:function(e){var t,i="";for(t=0;t<e.length;t++)i+=Co(e,t)+" ";return i}}),Po=function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===n)return r({message:"getProgramTime: playlist and time must be provided"});var s=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;r<t.segments.length&&!(e<=(n=(i=t.segments[r]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration));r++);var s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*s.duration)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}}(n,t);if(!s)return r({message:"valid programTime was not found"});if("estimate"===s.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});var a={mediaSeconds:n},o=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)}(n,s.segment);return o&&(a.programDateTime=o.toISOString()),r(null,a)},Mo=function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,s=void 0===r?2:r,a=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,h=t.callback;if(!h)throw new Error("seekToProgramTime: callback must be provided");if("undefined"===typeof i||!n||!a)return h({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return h({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(n))return h({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var d=function(e,t){var i;try{i=new Date(e)}catch(l){return null}if(!t||!t.segments||0===t.segments.length)return null;var n=t.segments[0];if(i<n.dateTimeObject)return null;for(var r=0;r<t.segments.length-1&&(n=t.segments[r],!(i<t.segments[r+1].dateTimeObject));r++);var s,a=t.segments[t.segments.length-1],o=a.dateTimeObject,u=a.videoTimingInfo?(s=a.videoTimingInfo).transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds:a.duration+.25*a.duration;return i>new Date(o.getTime()+1e3*u)?null:(i>o&&(n=a),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:so.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})}(i,n);if(!d)return h({message:i+" was not found in the stream"});var c=d.segment,f=function(e,t){var i,n;try{i=new Date(e),n=new Date(t)}catch(s){}var r=i.getTime();return(n.getTime()-r)/1e3}(c.dateTimeObject,i);if("estimate"===d.type)return 0===s?h({message:i+" is not buffered yet. Try again"}):(a(d.estimatedStart+f),void l.one("seeked",(function(){e({programTime:i,playlist:n,retryCount:s-1,seekTo:a,pauseAfterSeek:u,tech:l,callback:h})})));var p=c.start+f;l.one("seeked",(function(){return h(null,l.currentTime())})),u&&l.pause(),a(p)},No=function(e,t){if(4===e.readyState)return t()},Uo=function(e,t,i){var n,r=[],s=!1,a=function(e,t,n,r){return t.abort(),s=!0,i(e,t,n,r)},o=function(e,t){if(!s){if(e)return a(e,t,"",r);var i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!==typeof e}))).length<=1)return qe(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(n),s=0;return t.forEach((function(e){e=qe(e),r.set(e,s),s+=e.byteLength})),r}(r,Xe(i,!0)),n=n||$e(r),r.length<10||n&&r.length<n+2)return No(t,(function(){return a(e,t,"",r)}));var o=_t(r);return"ts"===o&&r.length<188||!o&&r.length<376?No(t,(function(){return a(e,t,"",r)})):a(null,t,o,r)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,Eo(e,null,{statusCode:e.status},o)}))}},l=t(u,(function(e,t){return Eo(l,e,t,o)}));return l},Bo=Ia.EventTarget,Fo=Ia.mergeOptions,jo=function(e,t){if(!_o(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(n.byterange||r.byterange){var s=n.byterange,a=r.byterange;if(s&&!a||!s&&a)return!1;if(s.offset!==a.offset||s.length!==a.length)return!1}}return!0},Vo=function(e,t){var i,n,r={};for(var s in e){var a=e[s].sidx;if(a){var o=ce(a);if(!t[o])break;var u=t[o].sidxInfo;i=u,n=a,(Boolean(!i.map&&!n.map)||Boolean(i.map&&n.map&&i.map.byterange.offset===n.map.byterange.offset&&i.map.byterange.length===n.map.byterange.length))&&i.uri===n.uri&&i.byterange.offset===n.byterange.offset&&i.byterange.length===n.byterange.length&&(r[o]=t[o])}}return r},Ho=function(e){function t(t,i,n,r){var s;void 0===n&&(n={}),(s=e.call(this)||this).masterPlaylistLoader_=r||(0,u.Z)(s),r||(s.isMaster_=!0);var a=n,o=a.withCredentials,l=void 0!==o&&o,h=a.handleManifestRedirects,d=void 0!==h&&h;if(s.vhs_=i,s.withCredentials=l,s.handleManifestRedirects=d,!t)throw new Error("A non-empty playlist URL or object is required");return s.on("minimumUpdatePeriod",(function(){s.refreshXml_()})),s.on("mediaupdatetimeout",(function(){s.refreshMedia_(s.media().id)})),s.state="HAVE_NOTHING",s.loadedPlaylists_={},s.logger_=Oa("DashPlaylistLoader"),s.isMaster_?(s.masterPlaylistLoader_.srcUrl=t,s.masterPlaylistLoader_.sidxMapping_={}):s.childPlaylist_=t,s}(0,l.Z)(t,e);var i=t.prototype;return i.requestErrored_=function(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!==typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)},i.addSidxSegments_=function(e,t,i){var n=this,s=e.sidx&&ce(e.sidx);if(e.sidx&&s&&!this.masterPlaylistLoader_.sidxMapping_[s]){var a=Da(this.handleManifestRedirects,e.sidx.resolvedUri),o=function(r,a){if(!n.requestErrored_(r,a,t)){var o,u=n.masterPlaylistLoader_.sidxMapping_;try{o=He()(qe(a.response).subarray(8))}catch(l){return void n.requestErrored_(l,a,t)}return u[s]={sidxInfo:e.sidx,sidx:o},de(e,o,e.sidx.resolvedUri),i(!0)}};this.request=Uo(a,this.vhs_.xhr,(function(t,i,r,s){if(t)return o(t,i);if(!r||"mp4"!==r)return o({status:i.status,message:"Unsupported "+(r||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},i);var u=e.sidx.byterange,l=u.offset,h=u.length;if(s.length>=h+l)return o(t,{response:s.subarray(l,l+h),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:ko({byterange:e.sidx.byterange})},o)}))}else this.mediaRequest_=r().setTimeout((function(){return i(!1)}),0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},r().clearTimeout(this.minimumUpdatePeriodTimeout_),r().clearTimeout(this.mediaRequest_),r().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"===typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,(function(n){t.haveMetadata({startingState:i,playlist:e})})))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),r().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(r().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;r().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=r().setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=r().setTimeout((function(){return e.haveMaster_()}),0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Da(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(n,r)}))):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},i.syncClientServerClock_=function(e){var t=this,i=je(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Ra(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var s;s="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=s-Date.now(),e()}})))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=function(e){var t=e.masterXml,i=e.srcUrl,n=e.clientOffset,r=e.sidxMapping,s=Fe(t,{manifestUri:i,clientOffset:n,sidxMapping:r});return ho(s,i),s}({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_}),t=this.masterPlaylistLoader_.master;t&&(e=function(e,t,i){for(var n=!0,r=Fo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),s=0;s<t.playlists.length;s++){var a=t.playlists[s];if(a.sidx){var o=ce(a.sidx);i&&i[o]&&i[o].sidx&&de(a,i[o].sidx,a.sidx.resolvedUri)}var u=vo(r,a,jo);u&&(r=u,n=!1)}return uo(t,(function(e,t,i,s){if(e.playlists&&e.playlists.length){var a=e.playlists[0].id,o=vo(r,e.playlists[0],jo);o&&((r=o).mediaGroups[t][i][s].playlists[0]=r.playlists[a],n=!1)}})),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:r}(t,e,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=e||t;var i=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return i&&i!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=i),(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(e)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(r().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=r().setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},i.refreshXml_=function(){var e=this;this.requestMaster_((function(t,i){i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=function(e,t){var i=Vo(e.playlists,t);return uo(e,(function(e,n,r,s){if(e.playlists&&e.playlists.length){var a=e.playlists;i=Fo(i,Vo(a,t))}})),i}(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},i.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];if(n?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){!function e(){t.media().endList||(t.mediaUpdateTimeout=r().setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),yo(t.media(),Boolean(n))))}()}this.trigger("loadedplaylist")},t}(Bo),qo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},Go=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Wo=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),i=Go(new Worker(t));i.objURL=t;var n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},zo=function(e){return"var browserWorkerPolyFill = "+Go.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Ko=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Xo=zo(Ko((function(){var e=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var t,i,n,r,s,a,o,u,l,h,d,c,f,p,m,g,_,v,y,b,T,S,E,w,k,C,A,I,L,x,R,D,O,P,M,N,U=e,B=Math.pow(2,32)-1;!function(){var e;if(E={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!==typeof Uint8Array){for(e in E)E.hasOwnProperty(e)&&(E[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),A=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]),I=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]),L={video:A,audio:I},D=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),R=new Uint8Array([0,0,0,0,0,0,0,0]),O=new Uint8Array([0,0,0,0,0,0,0,0]),P=O,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N=O,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},i=function(){return t(E.dinf,t(E.dref,D))},n=function(e){return t(E.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},r=function(){return t(E.ftyp,w,k,w,C)},g=function(e){return t(E.hdlr,L[e])},s=function(e){return t(E.mdat,e)},m=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(E.mdhd,i)},p=function(e){return t(E.mdia,m(e),g(e.type),o(e))},a=function(e){return t(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(E.minf,"video"===e.type?t(E.vmhd,x):t(E.smhd,R),i(),v(e))},u=function(e,i){for(var n=[],r=i.length;r--;)n[r]=b(i[r]);return t.apply(null,[E.moof,a(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=c(e[i]);return t.apply(null,[E.moov,d(4294967295)].concat(n).concat(h(e)))},h=function(e){for(var i=e.length,n=[];i--;)n[i]=T(e[i]);return t.apply(null,[E.mvex].concat(n))},d=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(E.mvhd,i)},_=function(e){var i,n,r=e.samples||[],s=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,s[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(E.sdtp,s)},v=function(e){return t(E.stbl,y(e),t(E.stts,N),t(E.stsc,P),t(E.stsz,M),t(E.stco,O))},function(){var e,i;y=function(n){return t(E.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===n.type?e(n):i(n))},e=function(e){var i,n,r=e.sps||[],s=e.pps||[],a=[],o=[];for(i=0;i<r.length;i++)a.push((65280&r[i].byteLength)>>>8),a.push(255&r[i].byteLength),a=a.concat(Array.prototype.slice.call(r[i]));for(i=0;i<s.length;i++)o.push((65280&s[i].byteLength)>>>8),o.push(255&s[i].byteLength),o=o.concat(Array.prototype.slice.call(s[i]));if(n=[E.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&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.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]),t(E.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[s.length],o))),t(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(t(E.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return t.apply(null,n)},i=function(e){return t(E.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))}}(),f=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.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&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(E.tkhd,i)},b=function(e){var i,n,r,s,a,o;return i=t(E.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/(B+1)),o=Math.floor(e.baseMediaDecodeTime%(B+1)),n=t(E.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=S(e,92),t(E.traf,i,n,r)):(s=_(e),r=S(e,s.length+92),t(E.traf,i,n,r,s))},c=function(e){return e.duration=e.duration||4294967295,t(E.trak,f(e),p(e))},T=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(E.trex,i)},function(){var e,i,n;n=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},i=function(e,i){var r,s,a,o,u,l;for(i+=20+16*(o=e.samples||[]).length,a=n(o,i),(s=new Uint8Array(a.length+16*o.length)).set(a),r=a.length,l=0;l<o.length;l++)u=o[l],s[r++]=(4278190080&u.duration)>>>24,s[r++]=(16711680&u.duration)>>>16,s[r++]=(65280&u.duration)>>>8,s[r++]=255&u.duration,s[r++]=(4278190080&u.size)>>>24,s[r++]=(16711680&u.size)>>>16,s[r++]=(65280&u.size)>>>8,s[r++]=255&u.size,s[r++]=u.flags.isLeading<<2|u.flags.dependsOn,s[r++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,s[r++]=61440&u.flags.degradationPriority,s[r++]=15&u.flags.degradationPriority,s[r++]=(4278190080&u.compositionTimeOffset)>>>24,s[r++]=(16711680&u.compositionTimeOffset)>>>16,s[r++]=(65280&u.compositionTimeOffset)>>>8,s[r++]=255&u.compositionTimeOffset;return t(E.trun,s)},e=function(e,i){var r,s,a,o,u,l;for(i+=20+8*(o=e.samples||[]).length,a=n(o,i),(r=new Uint8Array(a.length+8*o.length)).set(a),s=a.length,l=0;l<o.length;l++)u=o[l],r[s++]=(4278190080&u.duration)>>>24,r[s++]=(16711680&u.duration)>>>16,r[s++]=(65280&u.duration)>>>8,r[s++]=255&u.duration,r[s++]=(4278190080&u.size)>>>24,r[s++]=(16711680&u.size)>>>16,r[s++]=(65280&u.size)>>>8,r[s++]=255&u.size;return t(E.trun,r)},S=function(t,n){return"audio"===t.type?e(t,n):i(t,n)}}();var F,j,V,H,q,G,W,z,K=s,X=u,Z=function(e){var t,i=r(),n=l(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t},Y=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},$=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},Q=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},J=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},ee=function(e,t){var i,n,r,s,a,o=t||0,u=[];for(i=0;i<e.length;i++)for(s=e[i],n=0;n<s.length;n++)a=s[n],o+=(r=Y(a,o)).size,u.push(r);return u},te=function(e){var t,i,n,r,s,a,o=0,u=e.byteLength,l=e.nalCount,h=new Uint8Array(u+4*l),d=new DataView(h.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(s=r[i],n=0;n<s.length;n++)a=s[n],d.setUint32(o,a.data.byteLength),o+=4,h.set(a.data,o),o+=a.data.byteLength;return h},ie=[33,16,5,32,164,27],ne=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],re=function(e){for(var t=[];e--;)t.push(0);return t},se=function(){if(!F){var e={96e3:[ie,[227,64],re(154),[56]],88200:[ie,[231],re(170),[56]],64e3:[ie,[248,192],re(240),[56]],48e3:[ie,[255,192],re(268),[55,148,128],re(54),[112]],44100:[ie,[255,192],re(268),[55,163,128],re(84),[112]],32e3:[ie,[255,192],re(268),[55,234],re(226),[112]],24e3:[ie,[255,192],re(268),[55,255,128],re(268),[111,112],re(126),[224]],16e3:[ie,[255,192],re(268),[55,255,128],re(268),[111,255],re(269),[223,108],re(195),[1,192]],12e3:[ne,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,253,128],re(259),[56]],11025:[ne,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,255,192],re(268),[55,175,128],re(108),[112]],8e3:[ne,re(268),[3,121,16],re(47),[7]]};t=e,F=Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return F},ae=9e4;G=function(e,t){return j(q(e,t))},W=function(e,t){return V(H(e),t)},z=function(e,t,i){return H(i?e:e-t)};var oe=ae,ue=j=function(e){return e*ae},le=(V=function(e,t){return e*t},H=function(e){return e/ae}),he=(q=function(e,t){return e/t},G),de=W,ce=z,fe=function(e,t,i,n){var r,s,a,o,u,l=0,h=0,d=0;if(t.length&&(r=he(e.baseMediaDecodeTime,e.samplerate),s=Math.ceil(oe/(e.samplerate/1024)),i&&n&&(l=r-Math.max(i,n),d=(h=Math.floor(l/s))*s),!(h<1||d>oe/2))){for((a=se()[e.samplerate])||(a=t[0].data),o=0;o<h;o++)u=t[0],t.splice(0,0,{data:a,dts:u.dts-s,pts:u.pts-s});return e.baseMediaDecodeTime-=Math.floor(de(d,e.samplerate)),d}},pe=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},me=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},ge=function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},_e=oe,ve=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ye=function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/_e,i=Math.floor(i)),i},be=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Te=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,n=0,r=0}return i},Se=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ee=function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)s={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(s.ccData=t[r+3]<<8|t[r+4],a.push(s));return a},we=function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},ke=4,Ce=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!==typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ne(0,0),new Ne(0,1),new Ne(1,0),new Ne(1,1)],this.parse708captions_&&(this.cc708Stream_=new Re),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};(Ce.prototype=new U).push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=Te(e.escapedRBSP)).payload&&t.payloadType===ke&&(i=Se(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=Ee(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Ce.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},Ce.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},Ce.prototype.flush=function(){return this.flushStream("flush")},Ce.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ce.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},Ce.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Ce.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},Ce.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)},Ce.prototype.setsTextOrXDSActive=function(e){return 256===(28928&e.ccData)||4138===(30974&e.ccData)||6186===(30974&e.ccData)},Ce.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Ae={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Ie=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Le=function(e){this.windowNum=e,this.reset()};Le.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Le.prototype.getText=function(){return this.rows.join("\n")},Le.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Le.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Le.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Le.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Le.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var xe=function(e){this.serviceNum=e,this.text="",this.currentWindow=new Le(-1),this.windows=[]};xe.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new Le(i),"function"===typeof t&&(this.windows[i].beforeRowOverflow=t)},xe.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};var Re=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(t.new708Packet(),t.add708Bytes(e)):(null===t.current708Packet&&t.new708Packet(),t.add708Bytes(e))}};Re.prototype=new U,Re.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Re.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Re.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,s=t[r++];for(e.seq=s>>6,e.sizeCode=63&s;r<t.length;r++)n=31&(s=t[r++]),7===(i=s>>5)&&n>0&&(i=s=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},Re.prototype.pushServiceBlock=function(e,t,i){var n,r=t,s=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,r));r<t+i&&r<s.length;r++)n=s[r],Ie(n)?r=this.handleText(r,a):16===n?r=this.extendedCommands(r,a):128<=n&&n<=135?r=this.setCurrentWindow(r,a):152<=n&&n<=159?r=this.defineWindow(r,a):136===n?r=this.clearWindows(r,a):140===n?r=this.deleteWindows(r,a):137===n?r=this.displayWindows(r,a):138===n?r=this.hideWindows(r,a):139===n?r=this.toggleWindows(r,a):151===n?r=this.setWindowAttributes(r,a):144===n?r=this.setPenAttributes(r,a):145===n?r=this.setPenColor(r,a):146===n?r=this.setPenLocation(r,a):143===n?a=this.reset(r,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&r++},Re.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return Ie(i)&&(e=this.handleText(e,t,!0)),e},Re.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Re.prototype.initService=function(e,t){var i=this;return this.services[e]=new xe(e),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},Re.prototype.handleText=function(e,t,i){var n=function(e){var t=Ae[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)}((i?4096:0)|this.current708Packet.data[e]),r=t.currentWindow;return r.pendingNewLine&&!r.isEmpty()&&r.newLine(this.getPts(e)),r.pendingNewLine=!1,r.addText(n),e},Re.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},Re.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;t.setCurrentWindow(r);var s=t.currentWindow;return n=i[++e],s.visible=(32&n)>>5,s.rowLock=(16&n)>>4,s.columnLock=(8&n)>>3,s.priority=7&n,n=i[++e],s.relativePositioning=(128&n)>>7,s.anchorVertical=127&n,n=i[++e],s.anchorHorizontal=n,n=i[++e],s.anchorPoint=(240&n)>>4,s.rowCount=15&n,n=i[++e],s.columnCount=63&n,n=i[++e],s.windowStyle=(56&n)>>3,s.penStyle=7&n,s.virtualRowCount=s.rowCount+1,e},Re.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},Re.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Re.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Re.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},Re.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},Re.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},Re.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},Re.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},Re.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penAttr;return n=i[++e],r.textTag=(240&n)>>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},Re.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},Re.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},Re.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var De={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},Oe=function(e){return null===e?"":(e=De[e]||e,String.fromCharCode(e))},Pe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Me=function(){for(var e=[],t=15;t--;)e.push("");return e},Ne=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Me();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Me();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Me()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))s=Oe((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),s=Oe((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var a=Pe.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),s=Oe(n),s+=Oe(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};Ne.prototype=new U,Ne.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(t){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ne.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Me(),this.nonDisplayed_=Me(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ne.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ne.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ne.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ne.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ne.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ne.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ne.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ne.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ne.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Me(),this.displayed_=Me()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ne.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Ne.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ne.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Ne.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Ne.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Ne.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var Ue={CaptionStream:Ce,Cea608Stream:Ne,Cea708Stream:Re},Be={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Fe="shared",je=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Ve=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||Fe,this.push=function(e){this.type_!==Fe&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=je(e.dts,n),e.pts=je(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ve.prototype=new U;var He,qe=Ve,Ge=je,We=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},ze=function(e,t,i){return decodeURIComponent(We(e,t,i))},Ke=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Xe={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.value=ze(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.url=ze(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(We(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};He=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},n=0,r=[],s=0;if(He.prototype.init.call(this),this.dispatchType=Be.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,a,o,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(s=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(r.push(e),s+=e.data.byteLength,1===r.length&&(n=Ke(e.data.subarray(6,10)),n+=10),!(s<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,s-=r[0].data.byteLength,r.shift();a=10,64&t.data[5]&&(a+=4,a+=Ke(t.data.subarray(10,14)),n-=Ke(t.data.subarray(16,20)));do{if((o=Ke(t.data.subarray(a+4,a+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[a],t.data[a+1],t.data[a+2],t.data[a+3]),data:t.data.subarray(a+10,a+o+10)}).key=u.id,Xe[u.id]&&(Xe[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var h=u.data,d=(1&h[3])<<30|h[4]<<22|h[5]<<14|h[6]<<6|h[7]>>>2;d*=4,d+=3&h[7],u.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),a+=10,a+=o}while(a<n);this.trigger("data",t)}}},He.prototype=new U;var Ze,Ye,$e,Qe=He,Je=qe,et=188;(Ze=function(){var e=new Uint8Array(et),t=0;Ze.prototype.init.call(this),this.push=function(i){var n,r=0,s=et;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;s<n.byteLength;)71!==n[r]||71!==n[s]?(r++,s++):(this.trigger("data",n.subarray(r,s)),r+=et,s+=et);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===et&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new U,Ye=function(){var e,t,i,n;Ye.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var s=e[r],a=(31&e[r+1])<<8|e[r+2];s===Be.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:s===Be.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:s===Be.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=s),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Be.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Be.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Ye.prototype=new U,Ye.STREAM_TYPES={h264:27,adts:15},$e=function(){var e,t=this,i={data:[],size:0},n={data:[],size:0},r={data:[],size:0},s=function(e,i,n){var r,s,a=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)s=e.data[u],a.set(s.data,l),l+=s.data.byteLength;!function(e,t){var i,n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};$e.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case Be.H264_STREAM_TYPE:e=i,t="video";break;case Be.ADTS_STREAM_TYPE:e=n,t="audio";break;case Be.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};null!==(e=a.programMapTable).video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}})[a.type]()},this.reset=function(){i.size=0,i.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(i,"video"),s(n,"audio"),s(r,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}},$e.prototype=new U;var tt={PAT_PID:0,MP2T_PACKET_LENGTH:et,TransportPacketStream:Ze,TransportParseStream:Ye,ElementaryStream:$e,TimestampRolloverStream:Je,CaptionStream:Ue.CaptionStream,Cea608Stream:Ue.Cea608Stream,Cea708Stream:Ue.Cea708Stream,MetadataStream:Qe};for(var it in Be)Be.hasOwnProperty(it)&&(tt[it]=Be[it]);var nt,rt=tt,st=oe,at=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];nt=function(e){var t,i=0;nt.prototype.init.call(this),this.push=function(n){var r,s,a,o,u,l,h=0;if(e||(i=0),"audio"===n.type)for(t?(o=t,(t=new Uint8Array(o.byteLength+n.data.byteLength)).set(o),t.set(n.data,o.byteLength)):t=n.data;h+5<t.length;)if(255===t[h]&&240===(246&t[h+1])){if(s=2*(1&~t[h+1]),r=(3&t[h+3])<<11|t[h+4]<<3|(224&t[h+5])>>5,l=(u=1024*(1+(3&t[h+6])))*st/at[(60&t[h+2])>>>2],a=h+r,t.byteLength<a)return;if(this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:u,audioobjecttype:1+(t[h+2]>>>6&3),channelcount:(1&t[h+2])<<2|(192&t[h+3])>>>6,samplerate:at[(60&t[h+2])>>>2],samplingfrequencyindex:(60&t[h+2])>>>2,samplesize:16,data:t.subarray(h+7+s,a)}),i++,t.byteLength===a)return void(t=void 0);t=t.subarray(a)}else h++},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},nt.prototype=new U;var ot,ut,lt,ht=nt,dt=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!==(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};ut=function(){var e,t,i=0;ut.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var s=t.byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<s;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<s);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},ut.prototype=new U,lt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ot=function(){var e,t,i,n,r,s,a,o=new ut;ot.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,data:a};switch(31&a[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],s=1;s<n-2;)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},s=function(e){var t,i,n,r,s,o,u,l,h,d,c,f,p,m=0,g=0,_=0,v=0,y=1;if(i=(t=new dt(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),lt[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(c=3!==s?8:12,p=0;p<c;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),h=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:f=[1,1];break;case 2:f=[12,11];break;case 3:f=[10,11];break;case 4:f=[16,11];break;case 5:f=[40,33];break;case 6:f=[24,11];break;case 7:f=[20,11];break;case 8:f=[32,11];break;case 9:f=[80,33];break;case 10:f=[18,11];break;case 11:f=[15,11];break;case 12:f=[64,33];break;case 13:f=[160,99];break;case 14:f=[4,3];break;case 15:f=[3,2];break;case 16:f=[2,1];break;case 255:f=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}f&&(y=f[0]/f[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(l+1)-2*m-2*g)*y),height:(2-d)*(h+1)*16-2*_-2*v,sarRatio:f}}},ot.prototype=new U;var ct,ft={H264Stream:ot,NalByteStream:ut},pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],mt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},gt=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:e(t,i+=mt(t,i))},_t=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},vt={isLikelyAacData:function(e){var t=gt(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},parseId3TagSize:mt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240===(246&e[t+1]))return pt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=_t(e.subarray(10,14)));do{if((i=_t(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r<n.byteLength;r++)if(0===n[r]){var s=unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(n,0,r));if("com.apple.streaming.transportStreamTimestamp"===s){var a=n.subarray(r+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return o*=4,o+=3&a[7]}break}}t+=10,t+=i}while(t<e.byteLength);return null}};(ct=function(){var e=new Uint8Array,t=0;ct.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,a,o=0,u=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!==(255&e[u])||240!==(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=vt.parseAdtsSize(e,u))>e.length)break;s={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",s),u+=o}else{if(e.length-u<10)break;if(u+(o=vt.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new U;var yt,bt,Tt,St,Et=ct,wt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],kt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ct=ft.H264Stream,At=vt.isLikelyAacData,It=oe,Lt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},xt=function(e,t,i,n,r,s){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:s,baseMediaDecodeTime:e}};bt=function(e,t){var i=[],n=0,r=0,s=0,a=1/0;t=t||{},bt.prototype.init.call(this),this.push=function(t){be(e,t),e&&wt.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,u,l,h,d,c,f;0!==i.length?(o=pe(i,e,r),e.baseMediaDecodeTime=ye(e,t.keepOriginalTimestamps),f=fe(e,o,s,a),e.samples=me(o),l=K(ge(o)),i=[],u=X(n,[e]),h=new Uint8Array(u.byteLength+l.byteLength),n++,h.set(u),h.set(l,u.byteLength),ve(e),d=Math.ceil(1024*It/e.samplerate),o.length&&(c=o.length*d,this.trigger("segmentTimingInfo",xt(he(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+c,o[0].pts+c,f||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+c})),this.trigger("data",{track:e,boxes:h}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){ve(e),i=[],this.trigger("reset")}},bt.prototype=new U,yt=function(e,t){var i,n,r=0,s=[],a=[];t=t||{},yt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){be(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],kt.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var i,n,o,u,l,h,d,c,f=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=$(s),(o=Q(i))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],e))?(f=n.duration,o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=J(o)),a.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");ve(e),o=p}be(e,o),e.samples=ee(o),l=K(te(o)),e.baseMediaDecodeTime=ye(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],c=o[o.length-1],this.trigger("segmentTimingInfo",xt(e.baseMediaDecodeTime,d.dts,d.pts,c.dts+c.duration,c.pts+c.duration,f)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=X(r,[e]),h=new Uint8Array(u.byteLength+l.byteLength),r++,h.set(u),h.set(l,u.byteLength),this.trigger("data",{track:e,boxes:h}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){ve(e),i=void 0,n=void 0},this.getGopForFusion_=function(t){var i,n,r,s,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)r=(s=this.gopCache_[a]).gop,e.pps&&Lt(e.pps[0],s.pps[0])&&e.sps&&Lt(e.sps[0],s.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=s,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,s,o,u,l;for(s=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;t<a.length&&i<e.length&&(n=a[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,s-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=s,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,s,o,u;for(t=a.length-1,i=e.length-1,s=null,o=!1;t>=0&&i>=0;){if(n=a[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===a.length-1&&(s=i),i--)}if(!o&&null===s)return null;if(0===(u=o?i:s))return e;var l=e.slice(u),h=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=h.byteLength,l.duration=h.duration,l.nalCount=h.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){a=e}},yt.prototype=new U,St=function(e,t){this.numberOfTracks=0,this.metadataStream=t,"undefined"!==typeof(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,St.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},St.prototype=new U,St.prototype.flush=function(e){var t,i,n,r,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,kt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,wt.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Z(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)a.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=ce(t.startPts,o,this.keepOriginalTimestamps),t.endTime=ce(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=ce(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);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),r=0;r<a.captions.length;r++)t=a.captions[r],this.trigger("caption",t);for(r=0;r<a.metadata.length;r++)i=a.metadata[r],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},St.prototype.setRemux=function(e){this.remuxTracks=e},Tt=function(e){var t,i,n=this,r=!0;Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new rt.MetadataStream,r.aacStream=new Et,r.audioTimestampRolloverStream=new rt.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new rt.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ht,r.coalesceStream=new St(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(s){"timed-metadata"!==s.type&&"audio"!==s.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new bt(i,e),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new rt.MetadataStream,r.packetStream=new rt.TransportPacketStream,r.parseStream=new rt.TransportParseStream,r.elementaryStream=new rt.ElementaryStream,r.timestampRolloverStream=new rt.TimestampRolloverStream,r.adtsStream=new ht,r.h264Stream=new Ct,r.captionStream=new rt.CaptionStream(e),r.coalesceStream=new St(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(s){var a;if("metadata"===s.type){for(a=s.tracks.length;a--;)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||((i=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=s.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new yt(t,e),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new bt(i,e),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,ve(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,ve(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(r){var t=At(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},Tt.prototype=new U;var Rt,Dt,Ot,Pt={Transmuxer:Tt,VideoSegmentStream:yt,AudioSegmentStream:bt,AUDIO_PROPERTIES:wt,VIDEO_PROPERTIES:kt,generateSegmentTimingInfo:xt},Mt=function(e){return e>>>0},Nt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Ut=Mt,Bt=function e(t,i){var n,r,s,a,o,u=[];
1if(!i.length)return null;for(n=0;n<t.byteLength;)r=Ut(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),s=Nt(t.subarray(n+4,n+8)),a=r>1?n+r:t.byteLength,s===i[0]&&(1===i.length?u.push(t.subarray(n+8,a)):(o=e(t.subarray(n+8,a),i.slice(1))).length&&(u=u.concat(o))),n=a;return u},Ft=Mt,jt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Ft(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Ft(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},Vt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Ht=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],h=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),s&&h&&(t={flags:Vt(e.subarray(d,d+4))},d+=4,a&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),h--);h--;)t={},a&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(t.flags=Vt(e.subarray(d,d+4)),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},qt=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],s=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],h=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),s&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&h&&(n.baseDataOffsetIsMoof=!0),n},Gt=we,Wt=Ue.CaptionStream,zt=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},Kt=function(e,t){var i=Bt(e,["moof","traf"]),n=Bt(e,["mdat"]),r={},s=[];return n.forEach((function(e,t){var n=i[t];s.push({mdat:e,traf:n})})),s.forEach((function(e){var i,n,s=e.mdat,a=e.traf,o=Bt(a,["tfhd"]),u=qt(o[0]),l=u.trackId,h=Bt(a,["tfdt"]),d=h.length>0?jt(h[0]).baseMediaDecodeTime:0,c=Bt(a,["trun"]);t===l&&c.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,s=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=Ht(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),o=o.concat(t)})),o}(c,d,u),n=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+4<e.length;r+=s)if(s=o.getUint32(r),r+=4,!(s<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+s),h=zt(r,t);if(n={nalUnitType:"sei_rbsp",size:s,data:l,escapedRBSP:Gt(l),trackId:i},h)n.pts=h.pts,n.dts=h.dts,a=h;else{if(!a){console.log("We've encountered a nal unit without data. See mux.js#233.");break}n.pts=a.pts,n.dts=a.dts}u.push(n)}return u}(s,i,l),r[l]||(r[l]=[]),r[l]=r[l].concat(n))})),r},Xt=function(){var e,t,i,n,r,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Wt,a=!0,s=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,s,a){var o;if(!this.isInitialized())return null;if(!s||!a)return null;if(this.isNewInit(s,a))i=s[0],n=a[i];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,s,a)}return o=function(e,t,i){return null===t?null:{seiNals:Kt(e,t)[t],timescale:i}}(e,i,n),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStream
1s={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Zt=Mt,Yt=function(e){return("00"+e.toString(16)).slice(-2)};Rt=function(e,t){var i,n,r;return i=Bt(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return Bt(t,["tfhd"]).map((function(i){var n,r,s;return n=Zt(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,s=Bt(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Zt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Zt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(s="number"!==typeof s||isNaN(s)?1/0:s)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},Ot=function(e){var t=0===e[0]?12:20;return Zt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Dt=function(e){var t=Bt(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},s=Bt(e,["tkhd"])[0];s&&(n=(t=new DataView(s.buffer,s.byteOffset,s.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var a=Bt(e,["mdia","hdlr"])[0];if(a){var o=Nt(a.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=Bt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Nt(l.subarray(4,8));var h,d=Bt(l,[r.codec])[0];d&&(/^[a-z]vc[1-9]$/i.test(r.codec)?(h=d.subarray(78),"avcC"===Nt(h.subarray(4,8))&&h.length>11?(r.codec+=".",r.codec+=Yt(h[9]),r.codec+=Yt(h[10]),r.codec+=Yt(h[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(h=d.subarray(28),"esds"===Nt(h.subarray(4,8))&&h.length>20&&0!==h[19]?(r.codec+="."+Yt(h[19]),r.codec+="."+Yt(h[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var c=Bt(e,["mdia","mdhd"])[0];c&&(r.timescale=Ot(c)),i.push(r)})),i};var $t=Rt,Qt=Dt,Jt=function(e){var t=31&e[1];return t<<=8,t|=e[2]},ei=function(e){return!!(64&e[1])},ti=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},ii=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ni={parseType:function(e,t){var i=Jt(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=ei(e),i=4+ti(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=ei(e),n=4+ti(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s<r;){var a=n+s;t[(31&e[a+1])<<8|e[a+2]]=e[a],s+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:ei,parsePesType:function(e,t){switch(t[Jt(e)]){case Be.H264_STREAM_TYPE:return"video";case Be.ADTS_STREAM_TYPE:return"audio";case Be.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!ei(e))return null;var t=4+ti(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+ti(e),i=e.subarray(t),n=0,r=0,s=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===ii(31&i[r+3])&&(s=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===ii(31&i[r+3])&&(s=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===ii(31&i[r+3])&&(s=!0),s}},ri=Ge,si={};si.ts=ni,si.aac=vt;var ai=oe,oi=188,ui=71,li=function(e,t,i){for(var n,r,s,a,o=0,u=oi,l=!1;u<=e.byteLength;
vendor: 64,130 bytes, line 1
1)if(e[o]!==ui||e[u]!==ui&&u!==e.byteLength)o++,u++;else{if(n=e.subarray(o,u),"pes"===si.ts.parseType(n,t.pid))r=si.ts.parsePesType(n,t.table),s=si.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=si.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0);if(l)break;o+=oi,u+=oi}for(o=(u=e.byteLength)-oi,l=!1;o>=0;)if(e[o]!==ui||e[u]!==ui&&u!==e.byteLength)o--,u--;else{if(n=e.subarray(o,u),"pes"===si.ts.parseType(n,t.pid))r=si.ts.parsePesType(n,t.table),s=si.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=si.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0);if(l)break;o-=oi,u-=oi}},hi=function(e,t,i){for(var n,r,s,a,o,u,l,h=0,d=oi,c=!1,f={data:[],size:0};d<e.byteLength;)if(e[h]!==ui||e[d]!==ui)h++,d++;else{if(n=e.subarray(h,d),"pes"===si.ts.parseType(n,t.pid))if(r=si.ts.parsePesType(n,t.table),s=si.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!c&&(a=si.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),c=!0),!i.firstKeyFrame)){if(s&&0!==f.size){for(o=new Uint8Array(f.size),u=0;f.data.length;)l=f.data.shift(),o.set(l,u),u+=l.byteLength;if(si.ts.videoPacketContainsKeyFrame(o)){var p=si.ts.parsePesTime(o);p?(i.firstKeyFrame=p,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}f.size=0}f.data.push(n),f.size+=n.byteLength}if(c&&i.firstKeyFrame)break;h+=oi,d+=oi}for(h=(d=e.byteLength)-oi,c=!1;h>=0;)if(e[h]!==ui||e[d]!==ui)h--,d--;else{if(n=e.subarray(h,d),"pes"===si.ts.parseType(n,t.pid))r=si.ts.parsePesType(n,t.table),s=si.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=si.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),c=!0);if(c)break;h-=oi,d-=oi}},di=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=oi;r<e.byteLength;)if(e[n]!==ui||e[r]!==ui)n++,r++;else{switch(i=e.subarray(n,r),si.ts.parseType(i,t.pid)){case"pat":t.pid=si.ts.parsePat(i);break;case"pmt":var s=si.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach((function(e){t.table[e]=s[e]}))}n+=oi,r+=oi}}(e,t),t.table){if(t.table.hasOwnProperty(n))switch(t.table[n]){case Be.H264_STREAM_TYPE:i.video=[],hi(e,t,i),0===i.video.length&&delete i.video;break;case Be.ADTS_STREAM_TYPE:i.audio=[],li(e,t,i),0===i.audio.length&&delete i.audio}}return i},ci=function(e,t){var i;return i=si.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,s=null,a=0,o=0;e.length-o>=3;){switch(si.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=si.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=si.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=si.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=si.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var u=ai/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*u,pts:s+1024*n*u}]}}(e):di(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;("undefined"===typeof i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=ri(e.dts,i),e.pts=ri(e.pts,i),e.dtsTime=e.dts/ai,e.ptsTime=e.pts/ai}))}if(e.video&&e.video.length){var n=t;if(("undefined"===typeof n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=ri(e.dts,n),e.pts=ri(e.pts,n),e.dtsTime=e.dts/ai,e.ptsTime=e.pts/ai})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=ri(r.dts,n),r.pts=ri(r.pts,n),r.dtsTime=r.dts/ai,r.ptsTime=r.pts/ai}}}(i,t),i):null},fi=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Pt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var i={start:{decode:le(t.start.dts),presentation:le(t.start.pts)},end:{decode:le(t.end.dts),presentation:le(t.end.pts)},baseMediaDecodeTime:le(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){var i={start:{decode:le(t.start.dts),presentation:le(t.start.pts)},end:{decode:le(t.end.dts),presentation:le(t.end.pts)},baseMediaDecodeTime:le(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:le(t.start),end:le(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le(t.start),end:le(t.end)}})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Xt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=$t(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=Qt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!==typeof i||isNaN(i)?void 0:i*oe,r=ci(t,n),s=null;r&&((s={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(s.videoStart=r.video[0].ptsTime),s.hasAudio&&(s.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ue(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(ue(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new fi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new fi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),Zo=Wo(Xo),Yo=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,s=e.remux,a=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,h=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,c=e.onId3,f=e.onCaptions,p=e.onDone,m=e.onEndedTimeline,g=e.isEndOfTimeline,_={buffer:[]},v=g;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,s=n.initSegment,a=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,h=n.videoFramePtsTime;t.buffer.push({captions:a,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},c={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};"undefined"!==typeof l&&(c.videoFrameDtsTime=l),"undefined"!==typeof h&&(c.videoFramePtsTime=h),i(c)}(i,_,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(i,_),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&h(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&f(i.data.caption),"endedtimeline"===i.data.action&&(v=!1,m()),"transmuxed"===i.data.type&&(v||(t.onmessage=null,function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)}({transmuxedData:_,callback:p}),$o(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),"undefined"!==typeof s&&t.postMessage({action:"setRemux",remux:s}),i.byteLength){var y=i instanceof ArrayBuffer?i:i.buffer,b=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:y,byteOffset:b,byteLength:i.byteLength},[y])}g&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},$o=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():Yo(e.currentTransmux))},Qo=function(e,t){e.postMessage({action:t}),$o(e)},Jo=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Qo(t,e);t.transmuxQueue.push(Qo.bind(null,t,e))},eu=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Yo(e);e.transmuxer.transmuxQueue.push(e)},tu=function(e){Jo("reset",e)},iu=function(e){var t=new Zo;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},nu=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=(0,o.Z)({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function r(s){s.data.action===i&&(t.removeEventListener("message",r),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&(e.data=s.data.data)),n(s.data))})),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var a=[s?e.data:e.data.buffer];t.postMessage(r,a)}else t.postMessage(r)},ru=2,su=-101,au=-102,ou=function(e){e.forEach((function(e){e.abort()}))},uu=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:su,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:au,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:ru,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:ru,xhr:t}:null},lu=function(e,t,i){return function(n,r){var s=r.response,a=uu(n,r);if(a)return i(a,e);if(16!==s.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:ru,xhr:r},e);for(var o=new DataView(s),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return i(null,e)}},hu=function(e,t){var i=_t(e.map.bytes);if("mp4"!==i){var n=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(i||"unknown")+" container for initialization segment at URL: "+n,code:ru})}nu({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(i){var n=i.tracks,r=i.data;return e.map.bytes=r,n.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"===typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null)}})},du=function(e){var t=e.segment,i=e.finishProcessingFn,n=e.responseType;return function(e,r){var s=uu(e,r);if(s)return i(s,t);var a="arraybuffer"!==n&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer}(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(r),t.key?t.encryptedBytes=new Uint8Array(a):t.bytes=new Uint8Array(a),i(null,t)}},cu=function(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,s=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,c=e.doneFn,f=t.map&&t.map.tracks||{},p=Boolean(f.audio&&f.video),m=r.bind(null,t,"audio","start"),g=r.bind(null,t,"audio","end"),_=r.bind(null,t,"video","start"),v=r.bind(null,t,"video","end");nu({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=i=e.data;var r=e.result;r&&(n(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:p}),n=null,r.hasAudio&&!p&&m(r.audioStart),r.hasVideo&&_(r.videoStart),m=null,_=null),eu({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:p,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){n&&(p&&(e.isMuxed=!0),n(t,e))},onAudioTimingInfo:function(e){m&&"undefined"!==typeof e.start&&(m(e.start),m=null),g&&"undefined"!==typeof e.end&&g(e.end)},onVideoTimingInfo:function(e){_&&"undefined"!==typeof e.start&&(_(e.start),_=null),v&&"undefined"!==typeof e.end&&v(e.end)},onVideoSegmentTimingInfo:function(e){s(e)},onAudioSegmentTimingInfo:function(e){a(e)},onId3:function(e,i){o(t,e,i)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){h()},onDone:function(e){c&&(e.type="combined"===e.type?"video":e.type,c(null,t,e))}})}})},fu=function(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,s=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,c=e.doneFn,f=new Uint8Array(i);if(function(e){return et(e,["moof"]).length>0}(f)){t.isFmp4=!0;var p=t.map.tracks,m={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&"enca"!==p.audio.codec&&(m.audioCodec=p.audio.codec),p.video&&p.video.codec&&"encv"!==p.video.codec&&(m.videoCodec=p.video.codec),p.video&&p.audio&&(m.isMuxed=!0),n(t,m);var g=function(e){d(t,{data:f,type:m.hasAudio&&!m.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),c(null,t,{})};nu({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var n=e.data,s=e.startTime;i=n.buffer,t.bytes=f=n,m.hasAudio&&!m.isMuxed&&r(t,"audio","start",s),m.hasVideo&&r(t,"video","start",s),p.video&&n.byteLength&&t.transmuxer?nu({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[p.video.id],callback:function(e){i=e.data.buffer,t.bytes=f=e.data,g(e.captions)}}):g()}})}else if(t.transmuxer){if("undefined"===typeof t.container&&(t.container=_t(f)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),void c(null,t,{});cu({segment:t,bytes:i,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:c})}else c(null,t,{})},pu=function(e,t){var i,n=e.id,r=e.key,s=e.encryptedBytes,a=e.decryptionWorker;a.addEventListener("message",(function e(i){if(i.data.source===n){a.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}})),i=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),a.postMessage(Lo({source:n,encrypted:s,key:i,iv:r.iv}),[s.buffer,i.buffer])},mu=function(e){var t=e.activeXhrs,i=e.decryptionWorker,n=e.trackInfoFn,r=e.timingInfoFn,s=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,c=e.doneFn,f=0,p=!1;return function(e,m){if(!p){if(e)return p=!0,ou(t),c(e,m);if((f+=1)===t.length){var g=function(){if(m.encryptedBytes)return function(e){var t=e.decryptionWorker,i=e.segment,n=e.trackInfoFn,r=e.timingInfoFn,s=e.videoSegmentTimingInfoFn,a=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,c=e.doneFn;pu({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},(function(e){i.bytes=e,fu({segment:i,bytes:i.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:c})}))}({decryptionWorker:i,segment:m,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:c});fu({segment:m,bytes:m.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:a,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:c})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return pu({decryptionWorker:i,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key},(function(e){m.map.bytes=e,hu(m,(function(e){if(e)return ou(t),c(e,m);g()}))}));g()}}}},gu=function(e){var t=e.segment,i=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=Ia.mergeOptions(t.stats,function(e){var t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i}(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(e,t)}},_u=function(e){var t=e.xhr,i=e.xhrOptions,n=e.decryptionWorker,r=e.segment,s=e.abortFn,a=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,h=e.audioSegmentTimingInfoFn,d=e.id3Fn,c=e.captionsFn,f=e.isEndOfTimeline,p=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,_=[],v=mu({activeXhrs:_,decryptionWorker:n,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:c,isEndOfTimeline:f,endedTimelineFn:p,dataFn:m,doneFn:g});if(r.key&&!r.key.bytes){var y=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&y.push(r.map.key);var b=t(Ia.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),lu(r,y,v));_.push(b)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var T=t(Ia.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),lu(r,[r.map.key],v));_.push(T)}var S=Ia.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:ko(r.map)}),E=function(e){var t=e.segment,i=e.finishProcessingFn;return function(e,n){var r=uu(e,n);if(r)return i(r,t);var s=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=s,i(null,t);t.map.bytes=s,hu(t,(function(e){if(e)return e.xhr=n,e.status=n.status,i(e,t);i(null,t)}))}}({segment:r,finishProcessingFn:v}),w=t(S,E);_.push(w)}var k=Ia.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:ko(r)}),C=t(k,du({segment:r,finishProcessingFn:v,responseType:k.responseType}));C.addEventListener("progress",gu({segment:r,progressFn:a,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:c,isEndOfTimeline:f,endedTimelineFn:p,dataFn:m})),_.push(C);var A={};return _.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,i=e.abortFn;return function(e){e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}}({loadendState:A,abortFn:s}))})),function(){return ou(_)}},vu=Oa("CodecUtils"),yu=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},bu=function(e){var t={};return e.forEach((function(e){var i=e.mediaType,n=e.type,r=e.details;t[i]=t[i]||[],t[i].push(F(""+n+r))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return vu("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},Tu=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Su=function(e,t){var i=t.attributes||{},n=bu(function(e){var t=e.attributes||{};if(t.CODECS)return j(t.CODECS)}(t)||[]);if(yu(e,t)&&!n.audio&&!function(e,t){if(!yu(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1}(e,t)){var r=bu(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return j(r.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},Eu=Oa("PlaylistSelector"),wu=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},ku=function(e,t){if(!e)return"";var i=r().getComputedStyle(e);return i?i[t]:""},Cu=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Au=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||r().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||r().Number.MAX_VALUE)},Iu=function(e,t,i,n,s,a){if(e){var o={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:s},u=e.playlists;so.isAudioOnly(e)&&(u=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||r().Number.MAX_VALUE,width:t,height:i,playlist:e}}));Cu(l,(function(e,t){return e.bandwidth-t.bandwidth}));var h=(l=l.filter((function(e){return!so.isIncompatible(e.playlist)}))).filter((function(e){return so.isEnabled(e.playlist)}));h.length||(h=l.filter((function(e){return!so.isDisabled(e.playlist)})));var d=h.filter((function(e){return e.bandwidth*qo.BANDWIDTH_VARIANCE<t})),c=d[d.length-1],f=d.filter((function(e){return e.bandwidth===c.bandwidth}))[0];if(!1===s){var p=f||h[0]||l[0];if(p&&p.playlist){var m="sortedPlaylistReps";return f&&(m="bandwidthBestRep"),h[0]&&(m="enabledPlaylistReps"),Eu("choosing "+wu(p)+" using "+m+" with options",o),p.playlist}return Eu("could not choose a playlist with options",o),null}var g=d.filter((function(e){return e.width&&e.height}));Cu(g,(function(e,t){return e.width-t.width}));var _=g.filter((function(e){return e.width===i&&e.height===n}));c=_[_.length-1];var v,y,b,T=_.filter((function(e){return e.bandwidth===c.bandwidth}))[0];T||(y=(v=g.filter((function(e){return e.width>i||e.height>n}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),c=y[y.length-1],b=y.filter((function(e){return e.bandwidth===c.bandwidth}))[0]);var S=b||T||f||h[0]||l[0];if(S&&S.playlist){var E="sortedPlaylistReps";return b?E="resolutionPlusOneRep":T?E="resolutionBestRep":f?E="bandwidthBestRep":h[0]&&(E="enabledPlaylistReps"),Eu("choosing "+wu(S)+" using "+E+" with options",o),S.playlist}return Eu("could not choose a playlist with options",o),null}},Lu=function(){var e=this.useDevicePixelRatio&&r().devicePixelRatio||1;return Iu(this.playlists.master,this.systemBandwidth,parseInt(ku(this.tech_.el(),"width"),10)*e,parseInt(ku(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},xu=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,s=e.videoDuration;if(i){var a=r().WebKitDataCue||r().VTTCue,o=t.metadataTrack_;if(o&&(i.forEach((function(e){var t=e.cueTime+n;!("number"!==typeof t||r().isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ia.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ia.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ia.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),o.addCue(i)}))})),o.cues&&o.cues.length)){for(var u=o.cues,l=[],h=0;h<u.length;h++)u[h]&&l.push(u[h]);var d=l.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),c=Object.keys(d).sort((function(e,t){return Number(e)-Number(t)}));c.forEach((function(e,t){var i=d[e],n=Number(c[t+1])||s;i.forEach((function(e){e.endTime=n}))}))}}},Ru=function(e,t,i){var n,r;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime>=e&&r.endTime<=t&&i.removeCue(r)},Du=function(e){return"number"===typeof e&&isFinite(e)},Ou=1/60,Pu=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,s=e.playlist,a=s.mediaSequence,o=s.id,u=s.segments,l=void 0===u?[]:u,h=e.mediaIndex,d=e.partIndex,c=e.timeline,f=l.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)");var m="number"===typeof d,g=e.segment.uri?"segment":"pre-segment",_=m?Wa({preloadSegment:n})-1:0;return g+" ["+(a+h)+"/"+(a+f)+"]"+(m?" part ["+d+"/"+_+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+c+"] selected by ["+p+"] playlist ["+o+"]"},Mu=function(e){return e+"TimingInfo"},Nu=function(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,s=e.audioDisabled;if(i===n)return!1;if("audio"===r){var a=t.lastTimelineChange({type:"main"});return!a||a.to!==n}if("main"===r&&s){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==n}return!1},Uu=function(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+Pa},Bu=function(e,t){if("hls"!==t)return null;var i=function(e,t){var i=e&&"number"===typeof e.start&&"number"===typeof e.end?e.end-e.start:0,n=t&&"number"===typeof t.start&&"number"===typeof t.end?t.end-t.start:0;return Math.max(i,n)}(e.audioTimingInfo,e.videoTimingInfo);if(!i)return null;var n=e.playlist.targetDuration,r=Uu({segmentDuration:i,maxDuration:2*n}),s=Uu({segmentDuration:i,maxDuration:n}),a="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+i+" when the reported duration is "+e.duration+" and the target duration is "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||s?{severity:r?"warn":"info",message:a}:null},Fu=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!==typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Ia.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",(function(){n.isEndOfStream_()||(n.ended_=!1)})),n.fetchAtBuffer_=!1,n.logger_=Oa("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty((0,u.Z)(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",(function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),n}(0,l.Z)(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return iu({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&r().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,r().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&tu(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){if(!this.sourceUpdater_||!this.startingMediaInfo_)return Ia.createTimeRanges();if("main"===this.loaderType_){var e=this.startingMediaInfo_,t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=xo(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Ro(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var s=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+s+"]"),null!==this.mediaIndex)if(this.mediaIndex-=s,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var a=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!a.parts||!a.parts.length||!a.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}n&&(n.mediaIndex-=s,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(r().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"})},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&tu(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.startingMediaInfo_){var r=1,s=function(){0===--r&&i()};for(var a in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,s)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*vt.ONE_SECOND_IN_TS),s=Math.ceil((i-n)*vt.ONE_SECOND_IN_TS),a=e.slice(),o=e.length;o--&&!(e[o].pts<=s););if(-1===o)return a;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),a.splice(u,o-u+1),a}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,s)),this.inbandTextTracks_)Ru(e,t,this.inbandTextTracks_[a]);Ru(e,t,this.segmentMetadataTrack_),s()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&r().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r().setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&r().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r().setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"===typeof e&&t.segments[e],r=e+1===t.segments.length,s=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&s},i.chooseNextRequest_=function(){var e=Va(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),i=!this.hasPlayed_()&&t>=1,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,s=0;s<t.length;s++){var a=t[s];if(e===a.timeline&&(n.push(s),(r+=a.duration)>i))return s}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,e);else if(null!==this.mediaIndex){var a=r[this.mediaIndex],o="number"===typeof this.partIndex?this.partIndex:-1;s.startOfSegment=a.end?a.end:e,a.parts&&a.parts[o+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=o+1):s.mediaIndex=this.mediaIndex+1}else{var u=so.getMediaInfoForTime({playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),l=u.segmentIndex,h=u.startTime,d=u.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",s.mediaIndex=l,s.startOfSegment=h,s.partIndex=d}var c=r[s.mediaIndex],f=c&&"number"===typeof s.partIndex&&c.parts&&c.parts[s.partIndex];if(!c||"number"===typeof s.partIndex&&!f)return null;"number"!==typeof s.partIndex&&c.parts&&(s.partIndex=0);var p=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=r.length-1&&p&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.playlist,i=e.mediaIndex,n=e.startOfSegment,r=e.isSyncRequest,s=e.partIndex,a=e.forceTimestampOffset,o=e.getMediaInfoForTime,u=t.segments[i],l="number"===typeof s&&u.parts[s],h={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||u.resolvedUri,mediaIndex:i,partIndex:l?s:null,isSyncRequest:r,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:l&&l.duration||u.duration,segment:u,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o},d="undefined"!==typeof a?a:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:d});var c=Va(this.sourceUpdater_.audioBuffered());return"number"===typeof c&&(h.audioAppendStart=c-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=function(e,t,i){if("undefined"===typeof t||null===t||!e.length)return[];var n,r=Math.ceil((t-i+3)*vt.ONE_SECOND_IN_TS);for(n=0;n<e.length&&!(e[n].pts>r);n++);return e.slice(n)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h},i.timestampOffsetForSegment_=function(e){return function(e){var t=e.segmentTimeline,i=e.currentTimeline,n=e.startOfSegment,r=e.buffered;return e.overrideCheck||t!==i?t<i?n:r.length?r.end(r.length-1):n:null}(e)},i.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=so.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=function(e,t,i){return void 0===i&&(i=1),((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=s)){var a=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,s=e.segmentDuration,a=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!so.isIncompatible(e)})),h=l.filter(so.isEnabled);h.length||(h=l.filter((function(e){return!so.isDisabled(e)})));var d=h.filter(so.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:so.estimateSegmentRequestTime(s,n,e)*t-a}})),c=d.filter((function(e){return e.rebufferingImpact<=0}));return Cu(c,(function(e,t){return Au(t.playlist,e.playlist)})),c.length?c[0]:(Cu(d,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),d[0]||null)}({master:this.vhs_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(a){var o=r-s-a.rebufferingImpact,u=.5;s<=Pa&&(u=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<u||(this.bandwidth=a.playlist.attributes.BANDWIDTH*qo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},i.handleAbort_=function(e){this.logger_("Aborting "+Pu(e)),this.mediaRequestsAborted+=1},i.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},i.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;r<i.length;r++){var s=i[r];if(s!==n[r])return!1;if(e[s]!==t[s])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},i.handleTimingInfo_=function(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,s=Mu(t);r[s]=r[s]||{},r[s][i]=n,this.logger_("timinginfo: "+t+" - "+i+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},i.handleCaptions_=function(e,t){var i=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length)if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach((function(e){s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)})),Object.keys(s).forEach((function(e){var t=s[e],a=t.startTime,o=t.endTime,u=t.captions,l=i.inbandTextTracks_;i.logger_("adding cues from "+a+" -> "+o+" for "+e),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var s=i,a=i,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];u&&(s=u.label,a=u.language,o=u.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:o,label:s,language:a},!1).track}}}(l,i.vhs_.tech_,e),Ru(a,o,l[e]),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var s=r().WebKitDataCue||r().VTTCue;i.forEach((function(e){var i=e.stream;t[i].addCue(new s(e.startTime+n,e.endTime+n,e.text))}))}}({captionArray:u,inbandTextTracks:l,timestampOffset:n})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,i,this.vhs_.tech_),xu({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.currentMediaInfo_||!Nu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_;if(!e||!e.trackInfo)return!1;var t=this.currentMediaInfo_,i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Nu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Mu(t.type)].start;else{var n,r="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo;r&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:r,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var s=xo(n);if(this.activeInitSegmentId_===s)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=s}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,s=e.type,a=e.bytes,o=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+ja(o).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+ja(u).join(", "));var l=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0,d=u.length?u.start(0):0,c=u.length?u.end(u.length-1):0;if(h-l<=1&&c-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+ja(o).join(", ")+", video buffer: "+ja(u).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:s,bytes:a}));var f=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+f),this.remove(0,f,(function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=r().setTimeout((function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()}),1e3)}),!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}))},i.appendToSourceBuffer_=function(e){var t=e.segmentInfo,i=e.type,n=e.initSegment,r=e.data,s=e.bytes;if(!s){var a=[r],o=r.byteLength;n&&(a.unshift(n),o+=n.byteLength),s=function(e){var t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((function(e){t.set(e,i),i+=e.byteLength}))),t}({bytes:o,segments:a})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:s}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var i=(0,o.Z)({},e,{forceTimestampOffset:!0});(0,o.Z)(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&s;this.logger_("Requesting "+Pu(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=_u({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this)})},i.trimBackBuffer_=function(e){var t=function(e,t,i){var n=t-qo.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var s=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=s}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<Ou?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record 0.016666666666666666"):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===au)return;return this.pause(),e.code===su?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},i.updateMediaSecondsLoaded_=function(e){"number"===typeof e.start&&"number"===typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,s=e.currentVideoTimestampOffset,a=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if("undefined"!==typeof t)return t;if(!a)return u.start;var l=i.segments[n-1];return 0!==n&&l&&"undefined"!==typeof l.start&&l.end===r+s?o.start:r},i.waitForAppendsToComplete_=function(e){if(!this.currentMediaInfo_)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var t=this.currentMediaInfo_,i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,s="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!==typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);s&&e.waitingOnAppends++,a&&e.waitingOnAppends++,s&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var t=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.currentMediaInfo_,e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"===typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;t&&(e.timingInfo.end="number"===typeof t.end?t.end:t.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Bu(e,this.sourceType_);if(t&&("warn"===t.severity?Ia.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+Pu(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment;if(i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration)this.resetEverything();else null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Pu(e))},i.recordThroughput_=function(e){if(e.duration<Ou)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record 0.016666666666666666");else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Du(i)&&Du(n)){Ru(i,n,this.segmentMetadataTrack_);var s=r().WebKitDataCue||r().VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},o=new s(i,n,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}}},t}(Ia.EventTarget);function ju(){}var Vu,Hu=function(e){return"string"!==typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},qu=["video","audio"],Gu=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},Wu=function e(t,i){if(0!==i.queue.length){var n=0,r=i.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==t&&i.ready()&&"closed"!==i.mediaSource.readyState&&!Gu(t,i)){if(r.type!==t){if(n=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null}(t,i.queue),null===n)return;r=i.queue[n]}return i.queue.splice(n,1),i.queuePending[t]=r,r.action(t,i),r.doneFn?void 0:(i.queuePending[t]=null,void e(t,i))}}else i.updating()||"closed"===i.mediaSource.readyState||(i.queue.shift(),r.action(i),r.doneFn&&r.doneFn(),e("audio",i),e("video",i))}},zu=function(e,t){var i=t[e+"Buffer"],n=Hu(e);i&&(i.removeEventListener("updateend",t["on"+n+"UpdateEnd_"]),i.removeEventListener("error",t["on"+n+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Ku=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Xu=function(e,t,i){return function(n,r){var s=r[n+"Buffer"];if(Ku(r.mediaSource,s)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" b
1ytes to "+n+"Buffer");try{s.appendBuffer(e)}catch(a){r.logger_("Error with code "+a.code+" "+(22===a.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+n+"Buffer"),r.queuePending[n]=null,i(a)}}}},Zu=function(e,t){return function(i,n){var r=n[i+"Buffer"];if(Ku(n.mediaSource,r)){n.logger_("Removing "+e+" to "+t+" from "+i+"Buffer");try{r.remove(e,t)}catch(s){n.logger_("Remove "+e+" to "+t+" from "+i+"Buffer failed")}}}},Yu=function(e){return function(t,i){var n=i[t+"Buffer"];Ku(i.mediaSource,n)&&(i.logger_("Setting "+t+"timestampOffset to "+e),n.timestampOffset=e)}},$u=function(e){return function(t,i){e()}},Qu=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(i){Ia.log.warn("Failed to call media source endOfStream",i)}}}},Ju=function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){Ia.log.warn("Failed to set media source duration",i)}}},el=function(){return function(e,t){if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(Ku(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(n){Ia.log.warn("Failed to abort on "+e+"Buffer",n)}}}}},tl=function(e,t){return function(i){var n=Hu(e),r=H(t);i.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var s=i.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",i["on"+n+"UpdateEnd_"]),s.addEventListener("error",i["on"+n+"Error_"]),i.codecs[e]=t,i[e+"Buffer"]=s}},il=function(e){return function(t){var i=t[e+"Buffer"];if(zu(e,t),Ku(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(n){Ia.log.warn("Failed to removeSourceBuffer "+e+"Buffer",n)}}}},nl=function(e){return function(t,i){var n=i[t+"Buffer"],r=H(e);Ku(i.mediaSource,n)&&i.codecs[t]!==e&&(i.logger_("changing "+t+"Buffer codec from "+i.codecs[t]+" to "+e),n.changeType(r),i.codecs[t]=e)}},rl=function(e){var t=e.type,i=e.sourceUpdater,n=e.action,r=e.doneFn,s=e.name;i.queue.push({type:t,action:n,doneFn:r,name:s}),Wu(t,i)},sl=function(e,t){return function(i){if(t.queuePending[e]){var n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[e+"Error_"])}Wu(e,t)}},al=function(e){function t(t){var i;return(i=e.call(this)||this).mediaSource=t,i.sourceopenListener_=function(){return Wu("mediaSource",(0,u.Z)(i))},i.mediaSource.addEventListener("sourceopen",i.sourceopenListener_),i.logger_=Oa("SourceUpdater"),i.audioTimestampOffset_=0,i.videoTimestampOffset_=0,i.queue=[],i.queuePending={audio:null,video:null},i.delayedAudioAppendQueue_=[],i.videoAppendQueued_=!1,i.codecs={},i.onVideoUpdateEnd_=sl("video",(0,u.Z)(i)),i.onAudioUpdateEnd_=sl("audio",(0,u.Z)(i)),i.onVideoError_=function(e){i.videoError_=e},i.onAudioError_=function(e){i.audioError_=e},i.createdSourceBuffers_=!1,i.initializedEme_=!1,i.triggeredReady_=!1,i}(0,l.Z)(t,e);var i=t.prototype;return i.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},i.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},i.hasInitializedAnyEme=function(){return this.initializedEme_},i.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},i.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
vendor: 51,220 bytes, line 1
1,i.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},i.addSourceBuffer=function(e,t){rl({type:"mediaSource",sourceUpdater:this,action:tl(e,t),name:"addSourceBuffer"})},i.abort=function(e){rl({type:e,sourceUpdater:this,action:el(e),name:"abort"})},i.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?rl({type:"mediaSource",sourceUpdater:this,action:il(e),name:"removeSourceBuffer"}):Ia.log.error("removeSourceBuffer is not supported!")},i.canRemoveSourceBuffer=function(){return!Ia.browser.IE_VERSION&&!Ia.browser.IS_FIREFOX&&r().MediaSource&&r().MediaSource.prototype&&"function"===typeof r().MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return r().SourceBuffer&&r().SourceBuffer.prototype&&"function"===typeof r().SourceBuffer.prototype.changeType},i.canChangeType=function(){return this.constructor.canChangeType()},i.changeType=function(e,t){this.canChangeType()?rl({type:e,sourceUpdater:this,action:nl(t),name:"changeType"}):Ia.log.error("changeType is not supported!")},i.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!==typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(i){var n=e[i];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(i,n);t.canChangeType()&&t.changeType(i,n)}))},i.appendBuffer=function(e,t){var i=this,n=e.segmentInfo,r=e.type,s=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+s.length+" until video append");if(rl({type:r,sourceUpdater:this,action:Xu(s,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var a=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+a.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,a.forEach((function(e){i.appendBuffer.apply(i,e)}))}},i.audioBuffered=function(){return Ku(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ia.createTimeRange()},i.videoBuffered=function(){return Ku(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ia.createTimeRange()},i.buffered=function(){var e=Ku(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Ku(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var i=null,n=null,r=0,s=[],a=[];if(!e||!e.length||!t||!t.length)return Ia.createTimeRange();for(var o=e.length;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(o=t.length;o--;)s.push({time:t.start(o),type:"start"}),s.push({time:t.end(o),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),o=0;o<s.length;o++)"start"===s[o].type?2===++r&&(i=s[o].time):"end"===s[o].type&&1===--r&&(n=s[o].time),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return Ia.createTimeRanges(a)}(this.audioBuffered(),this.videoBuffered())},i.setDuration=function(e,t){void 0===t&&(t=ju),rl({type:"mediaSource",sourceUpdater:this,action:Ju(e),name:"duration",doneFn:t})},i.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=ju),"string"!==typeof e&&(e=void 0),rl({type:"mediaSource",sourceUpdater:this,action:Qu(e),name:"endOfStream",doneFn:t})},i.removeAudio=function(e,t,i){void 0===i&&(i=ju),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?rl({type:"audio",sourceUpdater:this,action:Zu(e,t),doneFn:i,name:"remove"}):i()},i.removeVideo=function(e,t,i){void 0===i&&(i=ju),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?rl({type:"video",sourceUpdater:this,action:Zu(e,t),doneFn:i,name:"remove"}):i()},i.updating=function(){return!(!Gu("audio",this)&&!Gu("video",this))},i.audioTimestampOffset=function(e){return"undefined"!==typeof e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(rl({type:"audio",sourceUpdater:this,action:Yu(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},i.videoTimestampOffset=function(e){return"undefined"!==typeof e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(rl({type:"video",sourceUpdater:this,action:Yu(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},i.audioQueueCallback=function(e){this.audioBuffer&&rl({type:"audio",sourceUpdater:this,action:$u(e),name:"callback"})},i.videoQueueCallback=function(e){this.videoBuffer&&rl({type:"video",sourceUpdater:this,action:$u(e),name:"callback"})},i.dispose=function(){var e=this;this.trigger("dispose"),qu.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return zu(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(Ia.EventTarget),ol=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},ul=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),ll=function(e){function t(t,i){var n;return void 0===i&&(i={}),(n=e.call(this,t,i)||this).mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=t.featuresNativeTextTracks,n.shouldSaveSegmentTimingInfo_=!1,n}(0,l.Z)(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return null},i.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ia.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Ia.createTimeRanges([[t,i]])},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=xo(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=ul.byteLength+e.bytes.byteLength,s=new Uint8Array(r);s.set(e.bytes),s.set(ul,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return n||e},i.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.track=function(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},i.remove=function(e,t){Ru(e,t,this.subtitlesTrack_)},i.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}},i.timestampOffsetForSegment_=function(){return null},i.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},i.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===su&&this.handleTimeout_(),e.code===au?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=s.segment;if(a.map&&(a.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!==typeof r().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var o,u=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",o),n.stopForError({message:"Error loading vtt.js"})};return o=function(){n.subtitlesTrack_.tech_.off("vttjserror",u),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",o),void this.subtitlesTrack_.tech_.one("vttjserror",u)}a.requested=!0;try{this.parseVTTCues_(s)}catch(l){return void this.stopForError({message:l.message})}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,s.cues.forEach((function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new(r().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){for(var n=[],r=0,s=0;s<t.length;s++)t[i].startTime===t[s].startTime&&t[i].endTime===t[s].endTime&&t[i].text===t[s].text&&++r>1&&n.push(t[s]);n.length&&n.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"===typeof r().TextDecoder?t=new(r().TextDecoder)("utf8"):(t=r().WebVTT.StringDecoder(),i=!0);var n=new(r().WebVTT.Parser)(r(),r().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){Ia.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var s=e.segment.map.bytes;i&&(s=ol(s)),n.parse(s)}var a=e.bytes;i&&(a=ol(a)),n.parse(a),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,s=r.MPEGTS/vt.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=s,e.endTime+=s})),!i.syncInfo){var a=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(a,o-n.duration)}}}else n.empty=!0},t}(Fu),hl=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},dl=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var s=null,a=null,o=qa(t);r=r||0;for(var u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],h=l.segment,d=e.timelineToDatetimeMappings[h.timeline];if(d&&h.dateTimeObject){var c=h.dateTimeObject.getTime()/1e3+d;if(h.parts&&"number"===typeof l.partIndex)for(var f=0;f<l.partIndex;f++)c+=h.parts[f].duration;var p=Math.abs(r-c);if(null!==a&&(0===p||a<p))break;a=p,s={time:c,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return s}},{name:"Segment",run:function(e,t,i,n,r){var s=null,a=null;r=r||0;for(var o=qa(t),u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],h=l.segment,d=l.part&&l.part.start||h&&h.start;if(h.timeline===n&&"undefined"!==typeof d){var c=Math.abs(r-d);if(null!==a&&a<c)break;(!s||null===a||a>=c)&&(a=c,s={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return s}},{name:"Discontinuity",run:function(e,t,i,n,r){var s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var a=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,h=e.discontinuities[l];if(h){var d=Math.abs(r-h.time);if(null!==a&&a<d)break;(!s||null===a||a>=d)&&(a=d,s={time:h.time,segmentIndex:u,partIndex:null})}}return s}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],cl=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=Oa("SyncController"),i}(0,l.Z)(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Za({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],s=0;s<dl.length;s++){var a=dl[s],o=a.run(this,e,t,i,n);o&&(o.strategy=a.name,r.push({strategy:a.name,syncPoint:o}))}return r},i.selectSyncPoint_=function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,s=1;s<e.length;s++){var a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+("number"===typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i},i.saveExpiredSegmentInfo=function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;i>=0;i--){var n=e.segments[i];if(n&&"undefined"!==typeof n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var s=r.dateTimeObject;r.discontinuity&&i&&s&&(this.timelineToDatetimeMappings[r.timeline]=-s.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,s=e.segment,a=e.part,o=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return a&&(a.start=n,a.end=r),(!s.start||n<s.start)&&(s.start=n),s.end=r,!0},i.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){var u=void 0;u=a<0?i.start-Za({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+Za({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[s]={time:u,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(Ia.EventTarget),fl=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}(0,l.Z)(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(Ia.EventTarget),pl=zo(Ko((function(){function e(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&i.path)}},i.exports),i.exports}var t=e((function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0})),i=e((function(e){function t(i,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(i,n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),n=e((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();var s=null,a=function(){function e(e){var t,i,n;s||(s=function(){var e,t,i,n,r,s,a,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],h=u[1],d=l[4],c=h[4],f=[],p=[];for(e=0;e<256;e++)p[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!d[t];t^=n||1,i=p[i]||1)for(s=(s=i^i<<1^i<<2^i<<3^i<<4)>>8^255&s^99,d[t]=s,c[s]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,a=257*f[s]^16843008*s,e=0;e<4;e++)l[e][t]=a=a<<24^a>>>8,h[e][s]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),h[e]=h[e].slice(0);return u}()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];var r=this._tables[0][4],a=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),h=[];for(this._key=[l,h],t=o;t<4*o+28;t++)n=l[t-1],(t%o===0||8===o&&t%o===4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o===0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],h[i]=t<=4||i<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,s){var a,o,u,l,h=this._key[1],d=e^h[0],c=n^h[1],f=i^h[2],p=t^h[3],m=h.length/4-2,g=4,_=this._tables[1],v=_[0],y=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l<m;l++)a=v[d>>>24]^y[c>>16&255]^b[f>>8&255]^T[255&p]^h[g],o=v[c>>>24]^y[f>>16&255]^b[p>>8&255]^T[255&d]^h[g+1],u=v[f>>>24]^y[p>>16&255]^b[d>>8&255]^T[255&c]^h[g+2],p=v[p>>>24]^y[d>>16&255]^b[c>>8&255]^T[255&f]^h[g+3],g+=4,d=a,c=o,f=u;for(l=0;l<4;l++)r[(3&-l)+s]=S[d>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^h[g++],a=d,d=c,c=f,f=p,p=a},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var s=e.STEP,a=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(a.subarray(h,h+s),i,n,l)),h=s;h<a.length;h+=s)n=new Uint32Array([u(a[h-4]),u(a[h-3]),u(a[h-2]),u(a[h-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(h,h+s),i,n,l));this.asyncStream_.push((function(){var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=function(e,t,i){var n,r,s,o,l,h,d,c,f,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new a(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],s=i[2],o=i[3],f=0;f<p.length;f+=4)l=u(p[f]),h=u(p[f+1]),d=u(p[f+2]),c=u(p[f+3]),m.decrypt(l,h,d,c,_,f),_[f]=u(_[f]^n),_[f+1]=u(_[f+1]^r),_[f+2]=u(_[f+2]^s),_[f+3]=u(_[f+3]^o),n=l,r=h,s=d,o=c;return g}(e,t,i);n.set(r,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new l(i,n,r,(function(e,i){self.postMessage(function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t}({source:t.source,decrypted:i}),[i.buffer])}))}}))),ml=Wo(pl),gl=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},_l=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},vl=function(e,t){t.activePlaylistLoader=e,e.load()},yl={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;_l(i,n);var s=n.activeTrack(),a=n.activeGroup(),o=(a.filter((function(e){return e.default}))[0]||a[0]).id,u=n.tracks[o];if(s!==u){for(var l in Ia.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Ia.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),_l(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},bl={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(function(){s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",yl[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e],a=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(function(){s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",yl[e](e,i))}},Tl={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],s=t.requestOptions,a=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,h=o.logger_,d=t.masterPlaylistLoader,c=ro(d.master);for(var f in a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}}),a[e])for(var p in u[f]||(u[f]=[]),a[e][f]){var m=a[e][f][p],g=void 0;if(c?(h("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new bo(m.playlists[0],i,s):m.resolvedUri?new bo(m.resolvedUri,i,s):m.playlists&&"dash"===n?new Ho(m.playlists[0],i,s,d):null,m=Ia.mergeOptions({id:p,playlistLoader:g},m),bl[e](e,m.playlistLoader,t),u[f].push(m),"undefined"===typeof l[p]){var _=new Ia.AudioTrack({id:p,kind:gl(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",yl[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,s=t.segmentLoaders[e],a=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,h=u.tracks,d=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new bo(p.resolvedUri,n,a);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new Ho(p.playlists[0],n,a,d)}else"vhs-json"===r&&(m=new bo(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=Ia.mergeOptions({id:f,playlistLoader:m},p),bl[e](e,p.playlistLoader,t),l[c].push(p),"undefined"===typeof h[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;h[f]=g}}s.on("error",yl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],s=r.groups,a=r.tracks;for(var o in n[e])for(var u in s[o]||(s[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var h=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(h[d.instreamId]&&(d=Ia.mergeOptions(d,h[d.instreamId])),void 0===d.default&&delete d.default,s[o].push(Ia.mergeOptions({id:u},l)),"undefined"===typeof a[u]){var c=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;a[u]=c}}}}},Sl=function e(t,i){for(var n=0;n<t.length;n++){if(io(i,t[n]))return!0;if(t[n].playlists&&e(t[n].playlists,i))return!0}return!1},El={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode||"hidden"===i[n].mode)return i[n];return null}}},wl=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Tl[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.vhs,s=e.segmentLoaders,a=s.AUDIO,o=s.main;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,s=n.media();if(!s)return null;var a=null;s.attributes[e]&&(a=r[s.attributes[e]]);var o=Object.keys(r);if(!a)if("AUDIO"===e&&o.length>1&&ro(t.master))for(var u=0;u<o.length;u++){var l=r[o[u]];if(Sl(l,s)){a=l;break}}else r.main?a=r.main:1===o.length&&(a=r[o[0]]);return"undefined"===typeof i?a:null!==i&&a&&a.filter((function(e){return e.id===i.id}))[0]||null}}(i,e),t[i].activeTrack=El[i](i,e),t[i].onGroupChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,s=t.mediaTypes[e],a=s.activeTrack(),o=s.getActiveGroup(),u=s.activePlaylistLoader,l=s.lastGroup_;o&&l&&o.id===l.id||(s.lastGroup_=o,s.lastTrack_=a,_l(n,s),o&&!o.isMasterPlaylist&&(o.playlistLoader?(n.resyncLoader(),vl(o.playlistLoader,s)):u&&r.resetEverything()))}}(i,e),t[i].onGroupChanging=function(e,t){return function(){var i=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,i.abort(),i.pause()}}(i,e),t[i].onTrackChanged=function(e,t){return function(){var i=t.masterPlaylistLoader,n=t.segmentLoaders,r=n[e],s=n.main,a=t.mediaTypes[e],o=a.activeTrack(),u=a.getActiveGroup(),l=a.activePlaylistLoader,h=a.lastTrack_;if((!h||!o||h.id!==o.id)&&(a.lastGroup_=u,a.lastTrack_=o,_l(r,a),u)){if(u.isMasterPlaylist){if(!o||!h||o.id===h.id)return;var d=t.vhs.masterPlaylistController_,c=d.selectPlaylist();if(d.media()===c)return;return a.logger_("track change. Switching master audio from "+h.id+" to "+o.id),i.pause(),s.resetEverything(),void d.fastQualityChange_(c)}if("AUDIO"===e){if(!u.playlistLoader)return s.setAudio(!0),void s.resetEverything();r.setAudio(!0),s.setAudio(!1)}l!==u.playlistLoader?(r.track&&r.track(o),r.resetEverything(),vl(u.playlistLoader,a)):vl(u.playlistLoader,a)}}}(i,e),t[i].getActiveGroup=function(e,t){var i=t.mediaTypes;return function(){var t=i[e].activeTrack();return t?i[e].activeGroup(t):null}}(i,e)}));var u=t.AUDIO.activeGroup();if(u){var l=(u.filter((function(e){return e.default}))[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),a.setAudio(!0)):o.setAudio(!0)}i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),i.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var h=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"}),n.trigger({type:"usage",name:"hls-audio-change"})};for(var d in n.audioTracks().addEventListener("change",h),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",h),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[d])},kl=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Cl=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Al=function(e){function t(t){var i;i=e.call(this)||this;var n=t.src,s=t.handleManifestRedirects,a=t.withCredentials,o=t.tech,l=t.bandwidth,h=t.externVhs,d=t.useCueTags,c=t.blacklistDuration,f=t.enableLowInitialPlaylist,p=t.sourceType,m=t.cacheEncryptionKeys,g=t.experimentalBufferBasedABR;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var _=t.maxPlaylistRetries;null!==_&&"undefined"!==typeof _||(_=1/0),Vu=h,i.experimentalBufferBasedABR=Boolean(g),i.withCredentials=a,i.tech_=o,i.vhs_=o.vhs,i.sourceType_=p,i.useCueTags_=d,i.blacklistDuration=c,i.maxPlaylistRetries=_,i.enableLowInitialPlaylist=f,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:a,handleManifestRedirects:s,maxPlaylistRetries:_,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ju,activeTrack:ju,getActiveGroup:ju,onGroupChanged:ju,onTrackChanged:ju,lastTrack_:null,logger_:Oa("MediaGroups["+t+"]")}})),e}(),i.mediaSource=new(r().MediaSource),i.handleDurationChange_=i.handleDurationChange_.bind((0,u.Z)(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind((0,u.Z)(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind((0,u.Z)(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=Ia.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new cl(t),i.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new ml,i.sourceUpdater_=new al(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new fl;var v={vhs:i.vhs_,parse708captions:t.parse708captions,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.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:l,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:m,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_};i.masterPlaylistLoader_="dash"===i.sourceType_?new Ho(n,i.vhs_,i.requestOptions_):new bo(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new Fu(Ia.mergeOptions(v,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new Fu(Ia.mergeOptions(v,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new ll(Ia.mergeOptions(v,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",(function(){return i.startABRTimer_()})),i.tech_.on("pause",(function(){return i.stopABRTimer_()})),i.tech_.on("play",(function(){return i.startABRTimer_()}))),kl.forEach((function(e){i[e+"_"]=Cl.bind((0,u.Z)(i),e)})),i.logger_=Oa("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var y="none"===i.tech_.preload()?"play":"loadstart";return i.tech_.one(y,(function(){var e=Date.now();i.tech_.one("loadeddata",(function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends}))})),i}(0,l.Z)(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),s=e.id||e.uri;r&&r!==s&&(this.logger_("switch media "+r+" -> "+s+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=r().setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(r().clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master();if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return e&&e.playlists||[];var t,i=e.mediaGroups.AUDIO,n=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)t=this.mediaTypes_.AUDIO.activeTrack();else{var r=i.main||n.length&&i[n[0]];for(var s in r)if(r[s].default){t={label:s};break}}if(!t)return[];var a=[];for(var o in i)if(i[o][t.label]){var u=i[o][t.label];u.playlists?a.push.apply(a,u.playlists):a.push(u)}return a},i.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*t.targetDuration*1e3;to(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),wl({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){e.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){var i;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),!i||!e.shouldSwitchToMedia_(i))return;if(e.initialMedia_=i,e.switchMedia_(e.initialMedia_,"initial"),!("vhs-json"===e.sourceType_&&e.initialMedia_.segments))return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*t.targetDuration*1e3;to(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&(e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck")))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},i.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},i.triggerPresenceUsage_=function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var s in i.AUDIO)for(var a in i.AUDIO[s]){i.AUDIO[s][a].uri||(n=!1)}n&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(i.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Vu.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,s=e.bufferHighWaterLine,a=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Ia.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t||!t.endList)return u(l+" as current playlist "+(t?"is live":"is not set")),!0;if(i.id===t.id)return!1;var h=o?qo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:qo.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return u(l+" as duration < max low water line ("+a+" < "+h+")"),!0;var d=i.attributes.BANDWIDTH,c=t.attributes.BANDWIDTH;if(d<c&&(!o||n<s)){var f=l+" as next bandwidth < current bandwidth ("+d+" < "+c+")";return o&&(f+=" and forwardBuffer < bufferHighWaterLine ("+n+" < "+s+")"),u(f),!0}if((!o||d>c)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+d+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Ia.browser.IE_VERSION||Ia.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},i.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(Ia.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(i.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(i.end(0))}return this.hasPlayed_=!0,this.load(),!0},i.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")},i.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},i.handleDurationChange_=function(){this.tech_.trigger("durationchange")},i.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.currentMediaInfo_||this.mainSegmentLoader_.currentMediaInfo_.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},i.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var i=Vu.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=Ma;var s=r.end(r.length-1);return s-n<=Ma&&i-s<=Ma},i.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var i=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!i)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));i.playlistErrors_++;var n,r=this.masterPlaylistLoader_.master.playlists,s=r.filter(Ja),a=1===s.length&&s[0]===i;if(1===r.length&&t!==1/0)return Ia.log.warn("Problem encountered with playlist "+i.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(a);if(a){var o=!1;r.forEach((function(e){if(e!==i){var t=e.excludeUntil;"undefined"!==typeof t&&t!==1/0&&(o=!0,delete e.excludeUntil)}})),o&&(Ia.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}n=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Ia.log.warn,h=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+h+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,c="number"===typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",a||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var s=[];(r||"audio"===e)&&s.push("AUDIO"),(r||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"===typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Ua(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(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},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Vu.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Vu.Playlist.seekable(t,i,Vu.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Vu.Playlist.seekable(t,i,Vu.Playlist.liveEdgeDelay(n,t))).length)return}var s,a;this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Ia.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===a||(this.logger_("seekable updated ["+Fa(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},i.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))}else{var i=this.tech_.buffered(),n=Vu.Playlist.duration(this.masterPlaylistLoader_.media());i.length>0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;
1for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader;return!(!this.mainSegmentLoader_.currentMediaInfo_||e&&!this.audioSegmentLoader_.currentMediaInfo_)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.currentMediaInfo_||{},audio:this.audioSegmentLoader_.currentMediaInfo_||{}};t.video=t.main;var i=Su(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||W)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||W,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var s,a={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?q(o):G(o)))){var i=t[e].isFmp4?"browser":"muxer";a[i]=a[i]||[],a[i].push(n[e]),"audio"===e&&(s=i)}var r,o})),r&&s&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;
vendor: 6,876 bytes, line 1
1this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+s+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(j(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(j(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(a).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+a[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var s=Su(e.master,r),a=[];!s.audio||G(s.audio)||q(s.audio)||a.push("audio codec "+s.audio),!s.video||G(s.video)||q(s.video)||a.push("video codec "+s.video),s.text&&"stpp.ttml.im1t"===s.text&&a.push("text codec "+s.text),a.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+a.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=bu(j(e)),s=Tu(r),a=r.video&&j(r.video)[0]||null,o=r.audio&&j(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Su(t.masterPlaylistLoader_.master,r),h=Tu(l);if(l.audio||l.video){if(h!==s&&u.push('codec count "'+h+'" !== "'+s+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&j(l.video)[0]||null,c=l.audio&&j(l.audio)[0]||null;d&&a&&d.type.toLowerCase()!==a.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+a.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,s=i,a=0;a<e.segments.length;a++){var o=e.segments[a];if(n||(n=hl(t,s+o.duration/2)),n){if("cueIn"in o){n.endTime=s,n.adEndTime=s,s+=o.duration,n=null;continue}if(s<n.endTime){s+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&((n=new(r().VTTCue)(s,s+o.duration,o.cueOut)).adStartTime=s,n.adEndTime=s+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],h=u[1];(n=new(r().VTTCue)(s,s+o.duration,"")).adStartTime=s-l,n.adEndTime=n.adStartTime+h,t.addCue(n)}s+=o.duration}}(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=qo.GOAL_BUFFER_LENGTH,i=qo.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,qo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=qo.BUFFER_LOW_WATER_LINE,i=qo.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,qo.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,qo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return qo.BUFFER_HIGH_WATER_LINE},t}(Ia.EventTarget),Il=function(e,t,i){var n,r,s,a=e.masterPlaylistController_,o=a[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(a);if(t.attributes){var u=t.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=Su(a.master(),t),this.playlist=t,this.id=i,this.enabled=(n=e.playlists,r=t.id,s=o,function(e){var t=n.master.playlists[r],i=Qa(t),a=Ja(t);return"undefined"===typeof e?a:(e?delete t.disabled:t.disabled=!0,e===a||i||(s(),e?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),e)})},Ll=["seeking","seeked","pause","playing","error"],xl=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Oa("PlaybackWatcher"),this.logger_("initialize");var i=function(){return t.monitorCurrentTime_()},n=function(){return t.monitorCurrentTime_()},s=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},o=function(){return t.fixesBadSeeks_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],h={};l.forEach((function(e){h[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},u[e+"SegmentLoader_"].on("appendsdone",h[e].updateend),u[e+"SegmentLoader_"].on("playlistupdate",h[e].reset),t.tech_.on(["seeked","seeking"],h[e].reset)})),this.tech_.on("seekablechanged",o),this.tech_.on("waiting",s),this.tech_.on(Ll,a),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.logger_("dispose"),t.tech_.off("seekablechanged",o),t.tech_.off("waiting",s),t.tech_.off(Ll,a),t.tech_.off("canplay",n),t.tech_.off("play",i),l.forEach((function(e){u[e+"SegmentLoader_"].off("appendsdone",h[e].updateend),u[e+"SegmentLoader_"].off("playlistupdate",h[e].reset),t.tech_.off(["seeked","seeking"],h[e].reset)})),t.checkCurrentTimeTimeout_&&r().clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&r().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=r().setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;
1if(e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:ja(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=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 e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ma>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:Ma)}if("undefined"!==typeof e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Fa(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&!(t.end(0)-t.start(0)<2*i)&&!(n>t.start(0))&&t.start(0)-n<i}({buffered:r,targetDuration:this.media().targetDuration,currentTime:i})&&(e=r.start(0)+Ma,this.logger_("Buffered region starts ("+r.start(0)+")  just beyond seek point ("+i+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ua(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var s=Ba(r,t);if(s.length>0){var a=s.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+s.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+Ma;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,i=e.audioBuffered,n=e.currentTime;if(t){var r;if(t.length&&i.length){var s=Ua(t,n-3),a=Ua(t,n),o=Ua(i,n);o.length&&!a.length&&s.length&&(r={start:s.end(0),end:o.end(0)})}else{Ba(t,n).length||(r=this.gapFromVideoUnderflow_(t,n))}return!!r&&(this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+n),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Ba(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Pa),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}
vendor: 16,678 bytes, line 1
1,t.gapFromVideoUnderflow_=function(e,t){for(var i=function(e){if(e.length<2)return Ia.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return Ia.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),s=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:s}}return null},e}(),Rl={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Dl=function e(t,i){var n=0,r=0,s=Ia.mergeOptions(Rl,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var a=function(){r&&t.currentTime(r)},o=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",a),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*s.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):s.getSource&&"function"===typeof s.getSource?(n=Date.now(),s.getSource.call(t,o)):void Ia.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",a),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}},Ol=function(e){Dl(this,e)},Pl="2.9.1",Ml={PlaylistLoader:bo,Playlist:so,utils:Oo,STANDARD_PLAYLIST_SELECTOR:Lu,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(so.isEnabled);return Cu(t,(function(e,t){return Au(e,t)})),t.filter((function(t){return!!Su(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Lu,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&r().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Iu(this.playlists.master,t,parseInt(ku(this.tech_.el(),"width"),10)*n,parseInt(ku(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Au,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||r().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||r().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:wo()};Object.keys(qo).forEach((function(e){Object.defineProperty(Ml,e,{get:function(){return Ia.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),qo[e]},set:function(t){Ia.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!==typeof t||t<0?Ia.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):qo[e]=t}})}));var Nl="videojs-vhs",Ul=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};Ml.canPlaySource=function(){return Ia.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Bl=function(e){var t=e.player,i=e.sourceKeySystems,n=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var s=function(e,t){return e.reduce((function(e,i){if(!i.contentProtection)return e;var n=t.reduce((function(e,t){var n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])}(n?r.concat([n]):r,Object.keys(i)),a=[],o=[];return s.forEach((function(e){o.push(new Promise((function(e,i){t.tech_.one("keysessioncreated",e)}))),a.push(new Promise((function(i,n){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?n(e):i()}))})))})),Promise.race([Promise.all(a),Promise.race(o)])},Fl=function(e){var t=e.player,i=function(e,t,i){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=bu(j(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r=H(n.video),s=H(n.audio),a={};for(var o in e)a[o]={},s&&(a[o].audioContentType=s),r&&(a[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"===typeof e[o]&&(a[o].url=e[o]);return Ia.mergeOptions(e,a)}(e.sourceKeySystems,e.media,e.audioMedia);return!!i&&(t.currentSource().keySystems=i,!(i&&!t.eme)||(Ia.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},jl=function(){if(!r().localStorage)return null;var e=r().localStorage.getItem(Nl);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}};Ml.supportsNativeHls=function(){if(!a()||!a().createElement)return!1;var e=a().createElement("video");if(!Ia.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Ml.supportsNativeDash=!!(a()&&a().createElement&&Ia.getTech("Html5").isSupported())&&/maybe|probably/i.test(a().createElement("video").canPlayType("application/dash+xml")),Ml.supportsTypeNatively=function(e){return"hls"===e?Ml.supportsNativeHls:"dash"===e&&Ml.supportsNativeDash},Ml.isSupported=function(){return Ia.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Vl=function(e){function t(t,i,n){var r;if(r=e.call(this,i,Ia.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&Ia.log.warn("Using hls options is deprecated. Use vhs instead."),"number"===typeof n.initialBandwidth&&(r.options_.bandwidth=n.initialBandwidth),r.logger_=Oa("VhsHandler"),i.options_&&i.options_.playerId){var s=Ia(i.options_.playerId);s.hasOwnProperty("hls")||Object.defineProperty(s,"hls",{get:function(){return Ia.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"hls-player-access"}),(0,u.Z)(r)},configurable:!0}),s.hasOwnProperty("vhs")||Object.defineProperty(s,"vhs",{get:function(){return Ia.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"vhs-player-access"}),(0,u.Z)(r)},configurable:!0}),s.hasOwnProperty("dash")||Object.defineProperty(s,"dash",{get:function(){return Ia.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),(0,u.Z)(r)},configurable:!0}),r.player_=s}if(r.tech_=i,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(a(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=a().fullscreenElement||a().webkitFullscreenElement||a().mozFullScreenElement||a().msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()})),r.on(r.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),r.on(r.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}(0,l.Z)(t,e);var i=t.prototype;return i.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?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,"number"!==typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=jl();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=qo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===qo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS"].forEach((function(t){"undefined"!==typeof e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},i.src=function(e,t){var i=this;if(e){var n;this.setOptions_(),this.options_.src=0===(n=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(n.substring(n.indexOf(",")+1)):n,this.options_.tech=this.tech_,this.options_.externVhs=Ml,this.options_.sourceType=X(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&Ia.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Al(this.options_);var s=Ia.mergeOptions({liveRangeSafeTimeDelta:Ma},this.options_,{seekable:function(){return i.seekable()},media:function(){return i.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new xl(s),this.masterPlaylistController_.on("error",(function(){var e=Ia.players[i.tech_.options_.playerId],t=i.masterPlaylistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var a=this.options_.experimentalBufferBasedABR?Ml.movingAverageBandwidthSelector(.55):Ml.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Ml.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,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Ia.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 i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ja(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ja(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!r().localStorage)return!1;var t=jl();t=t?Ia.mergeOptions(t,e):e;try{r().localStorage.setItem(Nl,JSON.stringify(t))}catch(i){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ro(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!Qa(e)})).map((function(t,i){return new Il(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=r().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Fl({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});11!==Ia.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),Bl({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media ke
1ys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Ia.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Ul(t,i.playlists)})),this.playlists.on("mediachange",(function(){Ul(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":Pl,"mux.js":"5.11.1","mpd-parser":"0.17.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return al.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=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_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&r().URL.revokeObjectURL&&(r().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Po({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Mo({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Ia.getComponent("Component")),Hl={name:"videojs-http-streaming",VERSION:Pl,canHandleSource:function(e,t){void 0===t&&(t={});var i=Ia.mergeOptions(Ia.options,t);return Hl.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Ia.mergeOptions(Ia.options,i);return t.vhs=new Vl(e,t,n),Ia.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Ia.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=wo(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Ia.mergeOptions(Ia.options,t).vhs.overrideNative,n=void 0===i?!Ia.browser.IS_ANY_SAFARI:i,r=X(e);return r&&(!Ml.supportsTypeNatively(r)||n)?"maybe":""}};q("avc1.4d400d,mp4a.40.2")&&Ia.getTech("Html5").registerSourceHandler(Hl,0),Ia.VhsHandler=Vl,Object.defineProperty(Ia,"HlsHandler",{get:function(){return Ia.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Vl},configurable:!0}),Ia.VhsSourceHandler=Hl,Object.defineProperty(Ia,"HlsSourceHandler",{get:function(){return Ia.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Hl},configurable:!0}),Ia.Vhs=Ml,Object.defineProperty(Ia,"Hls",{get:function(){return Ia.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ml},configurable:!0}),Ia.use||(Ia.registerComponent("Hls",Ml),Ia.registerComponent("Vhs",Ml)),Ia.options.vhs=Ia.options.vhs||{},Ia.options.hls=Ia.options.hls||{},Ia.registerPlugin?Ia.registerPlugin("reloadSourceOnError",Ol):Ia.plugin("reloadSourceOnError",Ol);
1var ql=Ia},61343:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ge}});var n=i(10870);class r{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");let t=Object(e);for(let i=1;i<arguments.length;i++){let e=arguments[i];if(void 0!==e&&null!==e)for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}return t},"function"!==typeof self.Promise&&i(82702).polyfill()}}r.install();var s=r,a=i(17187),o=i.n(a);class u{static e(e,t){e&&!u.FORCE_GLOBAL_TAG||(e=u.GLOBAL_TAG);let i=`[${e}] > ${t}`;u.ENABLE_CALLBACK&&u.emitter.emit("log","error",i),u.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}static i(e,t){e&&!u.FORCE_GLOBAL_TAG||(e=u.GLOBAL_TAG);let i=`[${e}] > ${t}`;u.ENABLE_CALLBACK&&u.emitter.emit("log","info",i),u.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}static w(e,t){e&&!u.FORCE_GLOBAL_TAG||(e=u.GLOBAL_TAG);let i=`[${e}] > ${t}`;u.ENABLE_CALLBACK&&u.emitter.emit("log","warn",i),u.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}static d(e,t){e&&!u.FORCE_GLOBAL_TAG||(e=u.GLOBAL_TAG);let i=`[${e}] > ${t}`;u.ENABLE_CALLBACK&&u.emitter.emit("log","debug",i),u.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}static v(e,t){e&&!u.FORCE_GLOBAL_TAG||(e=u.GLOBAL_TAG);let i=`[${e}] > ${t}`;u.ENABLE_CALLBACK&&u.emitter.emit("log","verbose",i),u.ENABLE_VERBOSE&&console.log(i)}}u.GLOBAL_TAG="flv.js",u.FORCE_GLOBAL_TAG=!1,u.ENABLE_ERROR=!0,u.ENABLE_INFO=!0,u.ENABLE_WARN=!0,u.ENABLE_DEBUG=!0,u.ENABLE_VERBOSE=!0,u.ENABLE_CALLBACK=!1,u.emitter=new(o());var l=u;var h=class{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}get lastSecondKBps(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}};class d{constructor(e){this._message=e}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class c extends d{constructor(e){super(e)}get name(){return"IllegalStateException"}}class f extends d{constructor(e){super(e)}get name(){return"InvalidArgumentException"}}class p extends d{constructor(e){super(e)}get name(){return"NotImplementedException"}}const m={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},g={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class _{constructor(e){this._type=e||"undefined",this._status=m.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=m.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===m.kConnecting||this._status===m.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(e){this._onContentLengthKnown=e}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(e){this._onURLRedirect=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}open(e,t){throw new p("Unimplemented abstract function!")}abort(){throw new p("Unimplemented abstract function!")}}let v={};!function(){let e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],n={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},r={};if(n.browser){r[n.browser]=!0;let e=n.majorVersion.split(".");r.version={major:parseInt(n.majorVersion,10),string:n.version},e.length>1&&(r.version.minor=parseInt(e[1],10)),e.length>2&&(r.version.build=parseInt(e[2],10))}if(n.platform&&(r[n.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;let e="msie";n.browser=e,r[e]=!0}if(r.edge){delete r.edge;let e="msedge";n.browser=e,r[e]=!0}if(r.opr){let e="opera";n.browser=e,r[e]=!0}if(r.safari&&r.android){let e="android";n.browser=e,r[e]=!0}r.name=n.browser,r.platform=n.platform;for(let s in v)v.hasOwnProperty(s)&&delete v[s];Object.assign(v,r)}();var y=v;var b=class extends _{static isSupported(){try{let e=y.msedge&&y.version.minor>=15048,t=!y.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}constructor(e,t){super("fetch-stream-loader"),this.TAG="FetchStream
1Loader",this._seekHandler=e,this._config=t,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);let n=this._seekHandler.getConfig(i,t),r=new self.Headers;if("object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&r.append(t,e[t])}let s={method:"GET",headers:r,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===typeof this._config.headers)for(let a in this._config.headers)r.append(a,this._config.headers[a]);!1===e.cors&&(s.mode="same-origin"),e.withCredentials&&(s.credentials="include"),e.referrerPolicy&&(s.referrerPolicy=e.referrerPolicy),this._status=m.kConnecting,self.fetch(n.url,s).then((e=>{if(this._requestAbort)return this._requestAbort=!1,void(this._status=m.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&this._onURLRedirect){let t=this._seekHandler.removeURLParameters(e.url);this._onURLRedirect(t)}let t=e.headers.get("Content-Length");return null!=t&&(this._contentLength=parseInt(t),0!==this._contentLength&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,e.body.getReader())}if(this._status=m.kError,!this._onError)throw new d("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((e=>{if(this._status=m.kError,!this._onError)throw e;this._onError(g.EXCEPTION,{code:-1,msg:e.message})}))}abort(){this._requestAbort=!0}_pump(e){return e.read().then((t=>{if(t.done)if(null!==this._contentLength&&this._receivedLength<this._contentLength){this._status=m.kError;let e=g.EARLY_EOF,t={code:-1,msg:"Fetch stream meet Early-EOF"};if(!this._onError)throw new d(t.msg);this._onError(e,t)}else this._status=m.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(!0===this._requestAbort)return this._requestAbort=!1,this._status=m.kComplete,e.cancel();this._status=m.kBuffering;let i=t.value.buffer,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),this._pump(e)}})).catch((e=>{if(11===e.code&&y.msedge)return;this._status=m.kError;let t=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===this._contentLength||null!==this._contentLength&&this._receivedLength<this._contentLength)?(t=g.EXCEPTION,i={code:e.code,msg:e.message}):(t=g.EARLY_EOF,i={code:e.code,msg:"Fetch stream meet Early-EOF"}),!this._onError)throw new d(i.msg);this._onError(t,i)}))}};var T=class extends _{static isSupported(){try{let e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return l.w("MozChunkedLoader",e.message),!1}}constructor(e,t){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);let n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;let r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}if("object"===typeof this._config.headers){let e=this._config.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}this._status=m.kConnecting,r.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=m.kComplete}_onReadyStateChange(e){let t=e.target;if(2===t.readyState){if(void 0!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){let e=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(e)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=m.kError,!this._onError)throw new d("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=m.kBuffering}}_onProgress(e){if(this._status===m.kError)return;null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onLoadEnd(e){!0!==this._requestAbort?this._status!==m.kError&&(this._status=m.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}_onXhrError(e){this._status=m.kError;let t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=g.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=g.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d(i.msg);this._onError(t,i)}};var S=class extends _{static isSupported(){try{let e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return l.w("RangeLoader",e.message),!1}}constructor(e,t){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=e,this._config=t,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new h,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(e,t){this._dataSource=e,this._range=t,this._status=m.kConnecting;let i=!1;void 0!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}_openSubRange(){let e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,i=t+e;null!=this._contentLength&&i-this._range.from>=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(e,t){this._lastTimeLoaded=0;let i=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?i=this._currentRedirectedURL:void 0!=e.redirectedURL&&(i=e.redirectedURL));let n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;let r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}if("object"===typeof this._config.headers){let e=this._config.headers;for(let t in e)e.hasOwnProperty(t)&&r.setRequestHeader(t,e[t])}r.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=m.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(e){let t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){let e=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&e!==this._currentRedirectedURL&&(this._currentRedirectedURL=e,this._onURLRedirect&&this._onURLRedirect(e))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=m.kBuffering}else{if(this._status=m.kError,!this._onError)throw new d("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(g.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}_onProgress(e){if(this._status===m.kError)return;if(null===this._contentLength){let t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;let i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let t=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(t)}_normalizeSpeed(e){let t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,s=i;if(e<t[0])return t[0];for(;r<=s;){if(n=r+Math.floor((s-r)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:s=n-1}}_onLoad(e){if(this._status===m.kError)return;if(this._waitForTotalLength)return void(this._waitForTotalLength=!1);this._lastTimeLoaded=0;let t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){let e=this._normalizeSpeed(t);this._currentSpeedNormalized!==e&&(this._currentSpeedNormalized=e,this._currentChunkSizeKB=e)}let i=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;let r=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():r=!0,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),r&&(this._status=m.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(e){this._status=m.kError;let t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=g.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=g.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d(i.msg);this._onError(t,i)}};var E=class extends _{static isSupported(){try{return"undefined"!==typeof self.WebSocket}catch(e){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(e){try{let t=this._ws=new self.WebSocket(e.url);
1t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=m.kConnecting}catch(t){this._status=m.kError;let e={code:t.code,msg:t.message};if(!this._onError)throw new d(e.msg);this._onError(g.EXCEPTION,e)}}abort(){let e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=m.kComplete}_onWebSocketOpen(e){this._status=m.kBuffering}_onWebSocketClose(e){!0!==this._requestAbort?(this._status=m.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}_onWebSocketMessage(e){if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){let t=new FileReader;t.onload=()=>{this._dispatchArrayBuffer(t.result)},t.readAsArrayBuffer(e.data)}else{this._status=m.kError;let t={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new d(t.msg);this._onError(g.EXCEPTION,t)}}_dispatchArrayBuffer(e){let t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onWebSocketError(e){this._status=m.kError;let t={code:e.code,msg:e.message};if(!this._onError)throw new d(t.msg);this._onError(g.EXCEPTION,t)}};var w=class{constructor(e){this._zeroStart=e||!1}getConfig(e,t){let i={};if(0!==t.from||-1!==t.to){let e;e=-1!==t.to?`bytes=${t.from.toString()}-${t.to.toString()}`:`bytes=${t.from.toString()}-`,i.Range=e}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}}removeURLParameters(e){return e}};var k=class{constructor(e,t){this._startName=e,this._endName=t}getConfig(e,t){let i=e;if(0!==t.from||-1!==t.to){let e=!0;-1===i.indexOf("?")&&(i+="?",e=!1),e&&(i+="&"),i+=`${this._startName}=${t.from.toString()}`,-1!==t.to&&(i+=`&${this._endName}=${t.to.toString()}`)}return{url:i,headers:{}}}removeURLParameters(e){let t,i=e.split("?")[0],n=e.indexOf("?");-1!==n&&(t=e.substring(n+1));let r="";if(void 0!=t&&t.length>0){let e=t.split("&");for(let t=0;t<e.length;t++){let i=e[t].split("="),n=t>0;i[0]!==this._startName&&i[0]!==this._endName&&(n&&(r+="&"),r+=e[t])}}return 0===r.length?i:i+"?"+r}};var C=class{constructor(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=393216,void 0!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new h,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(e){this._extraData=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onSeeked(){return this._onSeeked}set onSeeked(e){this._onSeeked=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}get onRedirect(){return this._onRedirect}set onRedirect(e){this._onRedirect=e}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(e){this._onRecoveredEarlyEof=e}get currentURL(){return this._dataSource.url}get hasRedirect(){return null!=this._redirectedURL||void 0!=this._dataSource.redirectedURL}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===S?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let e=this._config;if("range"===e.seekType)this._seekHandler=new w(this._config.rangeLoadZeroStart);else if("param"===e.seekType){let t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new k(t,i)}else{if("custom"!==e.seekType)throw new f(`Invalid seekType in config: ${e.seekType}`);if("function"!==typeof e.customSeekHandler)throw new f("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}
1_selectLoader(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=E;else if(b.isSupported())this._loaderClass=b;else if(T.isSupported())this._loaderClass=T;else{if(!S.isSupported())throw new d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=S}}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}seek(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}_internalSeek(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;let i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()}updateUrl(e){if(!e||"string"!==typeof e||0===e.length)throw new f("Url must be a non-empty string!");this._dataSource.url=e}_expandBuffer(e){let t=this._stashSize;for(;t+1048576<e;)t*=2;if(t+=1048576,t===this._bufferSize)return;let i=new ArrayBuffer(t);if(this._stashUsed>0){let e=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(e,0)}this._stashBuffer=i,this._bufferSize=t}_normalizeSpeed(e){let t=this._speedNormalizeList,i=t.length-1,n=0,r=0,s=i;if(e<t[0])return t[0];for(;r<=s;){if(n=r+Math.floor((s-r)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:s=n-1}}_adjustStashSize(e){let t=0;t=this._config.isLive||e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);let i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t}_dispatchChunks(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}_onURLRedirect(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}_onContentLengthKnown(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}_onLoaderChunkArrival(e,t,i){if(!this._onDataArrival)throw new c("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);let n=this._speedSampler.lastSecondKBps;if(0!==n){let e=this._normalizeSpeed(n);this._speedNormalized!==e&&(this._speedNormalized=e,this._adjustStashSize(e))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{let i=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart);if(n<t.byteLength){if(n>0){let e=new Uint8Array(t,n);i.set(e,0),this._stashUsed=e.byteLength,this._stashByteStart+=n}}else this._stashUsed=0,this._stashByteStart+=n;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{let n=this._dispatchChunks(e,t);if(n<e.byteLength){let r=e.byteLength-n;r>this._bufferSize&&(this._expandBuffer(r),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e,n),0),this._stashUsed+=r,this._stashByteStart=t+n}}}else if(0===this._stashUsed){let i=this._dispatchChunks(e,t);if(i<e.byteLength){let n=e.byteLength-i;n>this._bufferSize&&this._expandBuffer(n),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,i),0),this._stashUsed+=n,this._stashByteStart=t+i}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);let t=new Uint8Array(this._stashBuffer,0,this._bufferSize);t.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;let i=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(i<this._stashUsed&&i>0){let e=new Uint8Array(this._stashBuffer,i);t.set(e,0)}this._stashUsed-=i,this._stashByteStart+=i}}_flushStashBuffer(e){if(this._stashUsed>0){let t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){let e=new Uint8Array(this._stashBuffer,0,this._bufferSize),n=new Uint8Array(t,i);e.set(n,0),this._stashUsed=n.byteLength,this._stashByteStart+=i}return 0}l.w(this.TAG,`${n} bytes unconsumed data remain when flush buffer, dropped`)}return this._stashUsed=0,this._stashByteStart=0,n}return 0}_onLoaderComplete(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(e,t){if(l.e(this.TAG,`Loader error, code = ${t.code}, msg = ${t.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=g.UNRECOVERABLE_EARLY_EOF),e===g.EARLY_EOF){if(!this._config.isLive&&this._totalLength){let e=this._currentRange.to+1;return void(e<this._totalLength&&(l.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(e,!1)))}e=g.UNRECOVERABLE_EARLY_EOF}if(!this._onError)throw new d("IOException: "+t.msg);this._onError(e,t)}};const A={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function I(){return Object.assign({},A)}
1class L{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let e=new C({},I()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}static getNetworkLoaderTypeName(){let e=new C({},I()),t=e.loaderType;return e.destroy(),t}static supportNativeMediaPlayback(e){void 0==L.videoElement&&(L.videoElement=window.document.createElement("video"));let t=L.videoElement.canPlayType(e);return"probably"===t||"maybe"==t}static getFeatureList(){let e={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.mseFlvPlayback=L.supportMSEH264Playback(),e.networkStreamIO=L.supportNetworkStreamIO(),e.networkLoaderName=L.getNetworkLoaderTypeName(),e.mseLiveFlvPlayback=e.mseFlvPlayback&&e.networkStreamIO,e.nativeMP4H264Playback=L.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeWebmVP8Playback=L.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=L.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e}}var x=L;var R={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class D{static get forceGlobalTag(){return l.FORCE_GLOBAL_TAG}static set forceGlobalTag(e){l.FORCE_GLOBAL_TAG=e,D._notifyChange()}static get globalTag(){return l.GLOBAL_TAG}static set globalTag(e){l.GLOBAL_TAG=e,D._notifyChange()}static get enableAll(){return l.ENABLE_VERBOSE&&l.ENABLE_DEBUG&&l.ENABLE_INFO&&l.ENABLE_WARN&&l.ENABLE_ERROR}static set enableAll(e){l.ENABLE_VERBOSE=e,l.ENABLE_DEBUG=e,l.ENABLE_INFO=e,l.ENABLE_WARN=e,l.ENABLE_ERROR=e,D._notifyChange()}static get enableDebug(){return l.ENABLE_DEBUG}static set enableDebug(e){l.ENABLE_DEBUG=e,D._notifyChange()}static get enableVerbose(){return l.ENABLE_VERBOSE}static set enableVerbose(e){l.ENABLE_VERBOSE=e,D._notifyChange()}static get enableInfo(){return l.ENABLE_INFO}static set enableInfo(e){l.ENABLE_INFO=e,D._notifyChange()}static get enableWarn(){return l.ENABLE_WARN}static set enableWarn(e){l.ENABLE_WARN=e,D._notifyChange()}static get enableError(){return l.ENABLE_ERROR}static set enableError(e){l.ENABLE_ERROR=e,D._notifyChange()}static getConfig(){return{globalTag:l.GLOBAL_TAG,forceGlobalTag:l.FORCE_GLOBAL_TAG,enableVerbose:l.ENABLE_VERBOSE,enableDebug:l.ENABLE_DEBUG,enableInfo:l.ENABLE_INFO,enableWarn:l.ENABLE_WARN,enableError:l.ENABLE_ERROR,enableCallback:l.ENABLE_CALLBACK}}static applyConfig(e){l.GLOBAL_TAG=e.globalTag,l.FORCE_GLOBAL_TAG=e.forceGlobalTag,l.ENABLE_VERBOSE=e.enableVerbose,l.ENABLE_DEBUG=e.enableDebug,l.ENABLE_INFO=e.enableInfo,l.ENABLE_WARN=e.enableWarn,l.ENABLE_ERROR=e.enableError,l.ENABLE_CALLBACK=e.enableCallback}static _notifyChange(){let e=D.emitter;if(e.listenerCount("change")>0){let t=D.getConfig();e.emit("change",t)}}static registerListener(e){D.emitter.addListener("change",e)}static removeListener(e){D.emitter.removeListener("change",e)}static addLogListener(e){l.emitter.addListener("log",e),l.emitter.listenerCount("log")>0&&(l.ENABLE_CALLBACK=!0,D._notifyChange())}static removeLogListener(e){l.emitter.removeListener("log",e),0===l.emitter.listenerCount("log")&&(l.ENABLE_CALLBACK=!1,D._notifyChange())}}D.emitter=new(o());var O=D;var P=class{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}isSeekable(){return!0===this.hasKeyframesIndex}getNearestKeyframe(e){if(null==this.keyframesIndex)return null;let t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}}_search(e,t){let i=0,n=e.length-1,r=0,s=0,a=n;for(t<e[0]&&(i=0,s=a+1);s<=a;){if(r=s+Math.floor((a-s)/2),r===n||t>=e[r]&&t<e[r+1]){i=r;break}e[r]<t?s=r+1:a=r-1}return i}};function M(e,t,i){let n=e;if(t+i<n.length){for(;i--;)if(128!==(192&n[++t]))return!1;return!0}return!1}var N=function(e){let t=[],i=e,n=0,r=e.length;for(;n<r;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(M(i,n,1)){let e=(31&i[n])<<6|63&i[n+1];if(e>=128){t.push(String.fromCharCode(65535&e)),n+=2;continue}}}else if(i[n]<240){if(M(i,n,2)){let e=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2];if(e>=2048&&55296!==(63488&e)){t.push(String.fromCharCode(65535&e)),n+=3;continue}}}else if(i[n]<248&&M(i,n,3)){let e=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3];if(e>65536&&e<1114112){e-=65536,t.push(String.fromCharCode(e>>>10|55296)),t.push(String.fromCharCode(1023&e|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};let U=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}();class B{static parseScriptData(e,t,i){let n={};try{let r=B.parseValue(e,t,i),s=B.parseValue(e,t+r.size,i-r.size);n[r.data]=s.data}catch(r){l.e("AMF",r.toString())}return n}static parseObject(e,t,i){if(i<3)throw new c("Data not enough when parse ScriptDataObject");let n=B.parseString(e,t,i),r=B.parseValue(e,t+n.size,i-n.size),s=r.objectEnd;return{data:{name:n.data,value:r.data},size:n.size+r.size,objectEnd:s}}static parseVariable(e,t,i){return B.parseObject(e,t,i)}static parseString(e,t,i){if(i<2)throw new c("Data not enough when parse String");let n,r=new DataView(e,t,i).getUint16(0,!U);return n=r>0?N(new Uint8Array(e,t+2,r)):"",{data:n,size:2+r}}static parseLongString(e,t,i){if(i<4)throw new c("Data not enough when parse LongString");let n,r=new DataView(e,t,i).getUint32(0,!U);return n=r>0?N(new Uint8Array(e,t+4,r)):"",{data:n,size:4+r}}static parseDate(e,t,i){if(i<10)throw new c("Data size invalid when parse Date");let n=new DataView(e,t,i),r=n.getFloat64(0,!U);return r+=60*n.getInt16(8,!U)*1e3,{data:new Date(r),size:10}}static parseValue(e,t,i){if(i<1)throw new c("Data not enough when parse Value");let n,r=new DataView(e,t,i),s=1,a=r.getUint8(0),o=!1;
1try{switch(a){case 0:n=r.getFloat64(1,!U),s+=8;break;case 1:n=!!r.getUint8(1),s+=1;break;case 2:{let r=B.parseString(e,t+1,i-1);n=r.data,s+=r.size;break}case 3:{n={};let a=0;for(9===(16777215&r.getUint32(i-4,!U))&&(a=3);s<i-4;){let r=B.parseObject(e,t+s,i-s-a);if(r.objectEnd)break;n[r.data.name]=r.data.value,s+=r.size}if(s<=i-3){9===(16777215&r.getUint32(s-1,!U))&&(s+=3)}break}case 8:{n={},s+=4;let a=0;for(9===(16777215&r.getUint32(i-4,!U))&&(a=3);s<i-8;){let r=B.parseVariable(e,t+s,i-s-a);if(r.objectEnd)break;n[r.data.name]=r.data.value,s+=r.size}if(s<=i-3){9===(16777215&r.getUint32(s-1,!U))&&(s+=3)}break}case 9:n=void 0,s=1,o=!0;break;case 10:{n=[];let a=r.getUint32(1,!U);s+=4;for(let r=0;r<a;r++){let r=B.parseValue(e,t+s,i-s);n.push(r.data),s+=r.size}break}case 11:{let r=B.parseDate(e,t+1,i-1);n=r.data,s+=r.size;break}case 12:{let r=B.parseString(e,t+1,i-1);n=r.data,s+=r.size;break}default:s=i,l.w("AMF","Unsupported AMF value type "+a)}}catch(u){l.e("AMF",u.toString())}return{data:n,size:s,objectEnd:o}}}var F=B;var j=class{constructor(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let e=this._total_bytes-this._buffer_index;if(e<=0)throw new c("ExpGolomb: _fillCurrentWord() but no bytes available");let t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}readBits(e){if(e>32)throw new f("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){let t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}let t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;let i=e-this._current_word_bits_left;this._fillCurrentWord();let n=Math.min(i,this._current_word_bits_left),r=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t=t<<n|r,t}readBool(){return 1===this.readBits(1)}readByte(){return this.readBits(8)}_skipLeadingZero(){let e;for(e=0;e<this._current_word_bits_left;e++)if(0!==(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}readUEG(){let e=this._skipLeadingZero();return this.readBits(e+1)-1}readSEG(){let e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}};class V{static _ebsp2rbsp(e){let t=e,i=t.byteLength,n=new Uint8Array(i),r=0;for(let s=0;s<i;s++)s>=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(n[r]=t[s],r++);return new Uint8Array(n.buffer,0,r)}static parseSPS(e){let t=V._ebsp2rbsp(e),i=new j(t);i.readByte();let n=i.readByte();i.readByte();let r=i.readByte();i.readUEG();let s=V.getProfileString(n),a=V.getLevelString(r),o=1,u=420,l=[0,420,422,444],h=8;if((100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n)&&(o=i.readUEG(),3===o&&i.readBits(1),o<=3&&(u=l[o]),h=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool())){let e=3!==o?8:12;for(let t=0;t<e;t++)i.readBool()&&(t<6?V._skipScalingList(i,16):V._skipScalingList(i,64))}i.readUEG();let d=i.readUEG();if(0===d)i.readUEG();else if(1===d){i.readBits(1),i.readSEG(),i.readSEG();let e=i.readUEG();for(let t=0;t<e;t++)i.readSEG()}let c=i.readUEG();i.readBits(1);let f=i.readUEG(),p=i.readUEG(),m=i.readBits(1);0===m&&i.readBits(1),i.readBits(1);let g=0,_=0,v=0,y=0;i.readBool()&&(g=i.readUEG(),_=i.readUEG(),v=i.readUEG(),y=i.readUEG());let b=1,T=1,S=0,E=!0,w=0,k=0;if(i.readBool()){if(i.readBool()){let e=i.readByte(),t=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],n=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];e>0&&e<16?(b=t[e-1],T=n[e-1]):255===e&&(b=i.readByte()<<8|i.readByte(),T=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){let e=i.readBits(32),t=i.readBits(32);E=i.readBool(),w=t,k=2*e,S=w/k}}let C=1;1===b&&1===T||(C=b/T);let A=0,I=0;if(0===o)A=1,I=2-m;else{A=3===o?1:2,I=(1===o?2:1)*(2-m)}let L=16*(f+1),x=16*(p+1)*(2-m);L-=(g+_)*A,x-=(v+y)*I;let R=Math.ceil(L*C);return i.destroy(),i=null,{profile_string:s,level_string:a,bit_depth:h,ref_frames:c,chroma_format:u,chroma_format_string:V.getChromaFormatString(u),frame_rate:{fixed:E,fps:S,fps_den:k,fps_num:w},sar_ratio:{width:b,height:T}
1,codec_size:{width:L,height:x},present_size:{width:R,height:x}}}static _skipScalingList(e,t){let i=8,n=8,r=0;for(let s=0;s<t;s++)0!==n&&(r=e.readSEG(),n=(i+r+256)%256),i=0===n?i:n}static getProfileString(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(e){return(e/10).toFixed(1)}static getChromaFormatString(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var H=V;var q={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};class G{constructor(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new P,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(e){let t=new Uint8Array(e),i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;let n=(4&t[4])>>>2!==0,r=0!==(1&t[4]),s=(a=t)[o=5]<<24|a[o+1]<<16|a[o+2]<<8|a[o+3];var a,o;return s<9?i:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:n,hasVideoTrack:r}}bindDataSource(e){return e.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(e){this._onTrackMetadata=e}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(e){this._onMediaInfo=e}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(e){this._onMetaDataArrived=e}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(e){this._onScriptDataArrived=e}get onError(){return this._onError}set onError(e){this._onError=e}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(e){this._onDataAvailable=e}get timestampBase(){return this._timestampBase}set timestampBase(e){this._timestampBase=e}get overridedDuration(){return this._duration}set overridedDuration(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}set overridedHasAudio(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}set overridedHasVideo(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}resetMediaInfo(){this._mediaInfo=new P}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}parseChunks(e,t){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new c("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let i=0,n=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;i=G.probe(e).dataOffset}if(this._firstParse){this._firstParse=!1,t+i!==this._dataOffset&&l.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(e,i).getUint32(0,!n)&&l.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}for(;i<e.byteLength;){this._dispatch=!0;let r=new DataView(e,i);if(i+11+4>e.byteLength)break;let s=r.getUint8(0),a=16777215&r.getUint32(0,!n);if(i+11+a+4>e.byteLength)break;if(8!==s&&9!==s&&18!==s){l.w(this.TAG,`Unsupported tag type ${s}, skipped`),i+=11+a+4;continue}let o=r.getUint8(4),u=r.getUint8(5),h=r.getUint8(6)|u<<8|o<<16|r.getUint8(7)<<24;0!==(16777215&r.getUint32(7,!n))&&l.w(this.TAG,"Meet tag which has StreamID != 0!");let d=i+11;switch(s){case 8:this._parseAudioData(e,d,a,h);break;case 9:this._parseVideoData(e,d,a,h,t+i);break;case 18:this._parseScriptData(e,d,a)}let c=r.getUint32(11+a,!n);c!==11+a&&l.w(this.TAG,`Invalid PrevTagSize ${c}`),i+=11+a+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}_parseScriptData(e,t,i){let n=F.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!==typeof n.onMetaData)return void l.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&l.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;let e=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},e)),"boolean"===typeof e.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=e.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"===typeof e.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=e.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"===typeof e.audiodatarate&&(this._mediaInfo.audioDataRate=e.audiodatarate),"number"===typeof e.videodatarate&&(this._mediaInfo.videoDataRate=e.videodatarate),"number"===typeof e.width&&(this._mediaInfo.width=e.width),"number"===typeof e.height&&(this._mediaInfo.height=e.height),"number"===typeof e.duration){if(!this._durationOverrided){let t=Math.floor(e.duration*this._timescale);this._duration=t,this._mediaInfo.duration=t}}else this._mediaInfo.duration=0;if("number"===typeof e.framerate){let t=Math.floor(1e3*e.framerate);if(t>0){let e=t/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=e,this._referenceFrameRate.fps_num=t,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=e}}if("object"===typeof e.keyframes){this._mediaInfo.hasKeyframesIndex=!0;let t=e.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(t),e.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=e,l.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))}_parseKeyframesIndex(e){let t=[],i=[];for(let n=1;n<e.times.length;n++){let r=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(r),i.push(e.filepositions[n])}return{times:t,filepositions:i}}_parseAudioData(e,t,i,n){if(i<=1)return void l.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");if(!0===this._hasAudioFlagOverrided&&!1===this._hasAudio)return;this._littleEndian;let r=new DataView(e,t,i).getUint8(0),s=r>>>4;if(2!==s&&10!==s)return void this._onError(q.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+s);let a=0,o=(12&r)>>>2;if(!(o>=0&&o<=4))return void this._onError(q.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+o);a=this._flvSoundRateTable[o];let u=1&r,h=this._audioMetadata,d=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),h=this._audioMetadata={},h.type="audio",h.id=d.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=a,h.channelCount=0===u?1:2),10===s){let r=this._parseAACAudioData(e,t+1,i-1);if(void 0==r)return;if(0===r.packetType){h.config&&l.w(this.TAG,"Found another AudioSpecificConfig!");let e=r.data;h.audioSampleRate=e.samplingRate,h.channelCount=e.channelCount,h.codec=e.codec,h.originalCodec=e.originalCodec,h.config=e.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,l.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",h);let t=this._mediaInfo;t.audioCodec=h.originalCodec,t.audioSampleRate=h.audioSampleRate,t.audioChannelCount=h.channelCount,t.hasVideo?null!=t.videoCodec&&(t.mimeType='video/x-flv; codecs="'+t.videoCodec+","+t.audioCodec+'"'):t.mimeType='video/x-flv; codecs="'+t.audioCodec+'"',t.isComplete()&&this._onMediaInfo(t)}else if(1===r.packetType){let e=this._timestampBase+n,t={unit:r.data,length:r.data.byteLength,dts:e,pts:e};d.samples.push(t),d.length+=r.data.length}else l.e(this.TAG,`Flv: Unsupported AAC data type ${r.packetType}`)}
1else if(2===s){if(!h.codec){let n=this._parseMP3AudioData(e,t+1,i-1,!0);if(void 0==n)return;h.audioSampleRate=n.samplingRate,h.channelCount=n.channelCount,h.codec=n.codec,h.originalCodec=n.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,l.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h);let r=this._mediaInfo;r.audioCodec=h.codec,r.audioSampleRate=h.audioSampleRate,r.audioChannelCount=h.channelCount,r.audioDataRate=n.bitRate,r.hasVideo?null!=r.videoCodec&&(r.mimeType='video/x-flv; codecs="'+r.videoCodec+","+r.audioCodec+'"'):r.mimeType='video/x-flv; codecs="'+r.audioCodec+'"',r.isComplete()&&this._onMediaInfo(r)}let r=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0==r)return;let s=this._timestampBase+n,a={unit:r,length:r.byteLength,dts:s,pts:s};d.samples.push(a),d.length+=r.length}}_parseAACAudioData(e,t,i){if(i<=1)return void l.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");let n={},r=new Uint8Array(e,t,i);return n.packetType=r[0],0===r[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=r.subarray(1),n}_parseAACAudioSpecificConfig(e,t,i){let n=new Uint8Array(e,t,i),r=null,s=0,a=0,o=null,u=0,l=null;if(s=a=n[0]>>>3,u=(7&n[0])<<1|n[1]>>>7,u<0||u>=this._mpegSamplingRates.length)return void this._onError(q.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");let h=this._mpegSamplingRates[u],d=(120&n[1])>>>3;if(d<0||d>=8)return void this._onError(q.FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===s&&(l=(7&n[1])<<1|n[2]>>>7,o=(124&n[2])>>>2);let c=self.navigator.userAgent.toLowerCase();return-1!==c.indexOf("firefox")?u>=6?(s=5,r=new Array(4),l=u-3):(s=2,r=new Array(2),l=u):-1!==c.indexOf("android")?(s=2,r=new Array(2),l=u):(s=5,l=u,r=new Array(4),u>=6?l=u-3:1===d&&(s=2,r=new Array(2),l=u)),r[0]=s<<3,r[0]|=(15&u)>>>1,r[1]=(15&u)<<7,r[1]|=(15&d)<<3,5===s&&(r[1]|=(15&l)>>>1,r[2]=(1&l)<<7,r[2]|=8,r[3]=0),{config:r,samplingRate:h,channelCount:d,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+a}}_parseMP3AudioData(e,t,i,n){if(i<4)return void l.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");this._littleEndian;let r=new Uint8Array(e,t,i),s=null;if(n){if(255!==r[0])return;let e=r[1]>>>3&3,t=(6&r[1])>>1,i=(240&r[2])>>>4,n=(12&r[2])>>>2,a=3!==(r[3]>>>6&3)?2:1,o=0,u=0,l=34,h="mp3";switch(e){case 0:o=this._mpegAudioV25SampleRateTable[n];break;case 2:o=this._mpegAudioV20SampleRateTable[n];break;case 3:o=this._mpegAudioV10SampleRateTable[n]}switch(t){case 1:l=34,i<this._mpegAudioL3BitRateTable.length&&(u=this._mpegAudioL3BitRateTable[i]);break;case 2:l=33,i<this._mpegAudioL2BitRateTable.length&&(u=this._mpegAudioL2BitRateTable[i]);break;case 3:l=32,i<this._mpegAudioL1BitRateTable.length&&(u=this._mpegAudioL1BitRateTable[i])}s={bitRate:u,samplingRate:o,channelCount:a,codec:h,originalCodec:h}}else s=r;return s}_parseVideoData(e,t,i,n,r){if(i<=1)return void l.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");if(!0===this._hasVideoFlagOverrided&&!1===this._hasVideo)return;let s=new Uint8Array(e,t,i)[0],a=(240&s)>>>4,o=15&s;7===o?this._parseAVCVideoPacket(e,t+1,i-1,n,r,a):this._onError(q.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${o}`)}_parseAVCVideoPacket(e,t,i,n,r,s){if(i<4)return void l.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");let a=this._littleEndian,o=new DataView(e,t,i),u=o.getUint8(0),h=(16777215&o.getUint32(0,!a))<<8>>8;if(0===u)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===u)this._parseAVCVideoData(e,t+4,i-4,n,r,s,h);else if(2!==u)return void this._onError(q.FORMAT_ERROR,`Flv: Invalid video packet type ${u}`)}_parseAVCDecoderConfigurationRecord(e,t,i){if(i<7)return void l.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");let n=this._videoMetadata,r=this._videoTrack,s=this._littleEndian,a=new DataView(e,t,i);n?"undefined"!==typeof n.avcc&&l.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),n=this._videoMetadata={},n.type="video",n.id=r.id,n.timescale=this._timescale,n.duration=this._duration);let o=a.getUint8(0),u=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1!==o||0===u)return void this._onError(q.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=1+(3&a.getUint8(4)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(q.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));let h=31&a.getUint8(5);if(0===h)return void this._onError(q.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");h>1&&l.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${h}`);let d=6;for(let l=0;l<h;l++){let i=a.getUint16(d,!s);if(d+=2,0===i)continue;let r=new Uint8Array(e,t+d,i);d+=i;let o=H.parseSPS(r);if(0!==l)continue;n.codecWidth=o.codec_size.width,n.codecHeight=o.codec_size.height,n.presentWidth=o.present_size.width,n.presentHeight=o.present_size.height,n.profile=o.profile_string,n.level=o.level_string,n.bitDepth=o.bit_depth,n.chromaFormat=o.chroma_format,n.sarRatio=o.sar_ratio,n.frameRate=o.frame_rate,!1!==o.frame_rate.fixed&&0!==o.frame_rate.fps_num&&0!==o.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);let u=n.frameRate.fps_den,h=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(u/h);let c=r.subarray(1,4),f="avc1.";for(let e=0;e<3;e++){let t=c[e].toString(16);t.length<2&&(t="0"+t),f+=t}
1n.codec=f;let p=this._mediaInfo;p.width=n.codecWidth,p.height=n.codecHeight,p.fps=n.frameRate.fps,p.profile=n.profile,p.level=n.level,p.refFrames=o.ref_frames,p.chromaFormat=o.chroma_format_string,p.sarNum=n.sarRatio.width,p.sarDen=n.sarRatio.height,p.videoCodec=f,p.hasAudio?null!=p.audioCodec&&(p.mimeType='video/x-flv; codecs="'+p.videoCodec+","+p.audioCodec+'"'):p.mimeType='video/x-flv; codecs="'+p.videoCodec+'"',p.isComplete()&&this._onMediaInfo(p)}let c=a.getUint8(d);if(0!==c){c>1&&l.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${c}`),d++;for(let e=0;e<c;e++){let e=a.getUint16(d,!s);d+=2,0!==e&&(d+=e)}n.avcc=new Uint8Array(i),n.avcc.set(new Uint8Array(e,t,i),0),l.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(q.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}_parseAVCVideoData(e,t,i,n,r,s,a){let o=this._littleEndian,u=new DataView(e,t,i),h=[],d=0,c=0;const f=this._naluLengthSize;let p=this._timestampBase+n,m=1===s;for(;c<i;){if(c+4>=i){l.w(this.TAG,`Malformed Nalu near timestamp ${p}, offset = ${c}, dataSize = ${i}`);break}let n=u.getUint32(c,!o);if(3===f&&(n>>>=8),n>i-f)return void l.w(this.TAG,`Malformed Nalus near timestamp ${p}, NaluSize > DataSize!`);let r=31&u.getUint8(c+f);5===r&&(m=!0);let s=new Uint8Array(e,t+c,f+n),a={type:r,data:s};h.push(a),d+=s.byteLength,c+=f+n}if(h.length){let e=this._videoTrack,t={units:h,length:d,isKeyframe:m,dts:p,cts:a,pts:p+a};m&&(t.fileposition=r),e.samples.push(t),e.length+=d}}}var W=G;class z{static init(){z.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let t in z.types)z.types.hasOwnProperty(t)&&(z.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);let e=z.constants={};e.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),e.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),e.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSC=e.STCO=e.STTS,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.HDLR_VIDEO=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]),e.HDLR_AUDIO=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]),e.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(e){let t=8,i=null,n=Array.prototype.slice.call(arguments,1),r=n.length;for(let a=0;a<r;a++)t+=n[a].byteLength;i=new Uint8Array(t),i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);let s=8;for(let a=0;a<r;a++)i.set(n[a],s),s+=n[a].byteLength;return i}static generateInitSegment(e){let t=z.box(z.types.ftyp,z.constants.FTYP),i=z.moov(e),n=new Uint8Array(t.byteLength+i.byteLength);return n.set(t,0),n.set(i,t.byteLength),n}static moov(e){let t=z.mvhd(e.timescale,e.duration),i=z.trak(e),n=z.mvex(e);return z.box(z.types.moov,t,i,n)}static mvhd(e,t){return z.box(z.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,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]))}static trak(e){return z.box(z.types.trak,z.tkhd(e),z.mdia(e))}static tkhd(e){let t=e.id,i=e.duration,n=e.presentWidth,r=e.presentHeight;return z.box(z.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,r>>>8&255,255&r,0,0]))}static mdia(e){return z.box(z.types.mdia,z.mdhd(e),z.hdlr(e),z.minf(e))}static mdhd(e){let t=e.timescale,i=e.duration;return z.box(z.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}static hdlr(e){let t=null;return t="audio"===e.type?z.constants.HDLR_AUDIO:z.constants.HDLR_VIDEO,z.box(z.types.hdlr,t)}static minf(e){let t=null;return t="audio"===e.type?z.box(z.types.smhd,z.constants.SMHD):z.box(z.types.vmhd,z.constants.VMHD),z.box(z.types.minf,t,z.dinf(),z.stbl(e))}static dinf(){return z.box(z.types.dinf,z.box(z.types.dref,z.constants.DREF))}static stbl(e){return z.box(z.types.stbl,z.stsd(e),z.box(z.types.stts,z.constants.STTS),z.box(z.types.stsc,z.constants.STSC),z.box(z.types.stsz,z.constants.STSZ),z.box(z.types.stco,z.constants.STCO))}static stsd(e){return"audio"===e.type?"mp3"===e.codec?z.box(z.types.stsd,z.constants.STSD_PREFIX,z.mp3(e)):z.box(z.types.stsd,z.constants.STSD_PREFIX,z.mp4a(e)):z.box(z.types.stsd,z.constants.STSD_PREFIX,z.avc1(e))}static mp3(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return z.box(z.types[".mp3"],n)}static mp4a(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return z.box(z.types.mp4a,n,z.esds(e))}static esds(e){let t=e.config||[],i=t.length,n=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(t).concat([6,1,2]));return z.box(z.types.esds,n)}static avc1(e){let t=e.avcc,i=e.codecWidth,n=e.codecHeight,r=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,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return z.box(z.types.avc1,r,z.box(z.types.avcC,t))}static mvex(e){return z.box(z.types.mvex,z.trex(e))}static trex(e){let t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return z.box(z.types.trex,i)}static moof(e,t){return z.box(z.types.moof,z.mfhd(e.sequenceNumber),z.traf(e,t))}static mfhd(e){let t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return z.box(z.types.mfhd,t)}static traf(e,t){let i=e.id,n=z.box(z.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),r=z.box(z.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),s=z.sdtp(e),a=z.trun(e,s.byteLength+16+16+8+16+8+8);return z.box(z.types.traf,n,r,a,s)}static sdtp(e){let t=e.samples||[],i=t.length,n=new Uint8Array(4+i);for(let r=0;r<i;r++){let e=t[r].flags;n[r+4]=e.isLeading<<6|e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy}return z.box(z.types.sdtp,n)}static trun(e,t){let i=e.samples||[],n=i.length,r=12+16*n,s=new Uint8Array(r);t+=8+r,s.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(let a=0;a<n;a++){let e=i[a].duration,t=i[a].size,n=i[a].flags,r=i[a].cts;s.set([e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.isNonSync,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r],12+16*a)}return z.box(z.types.trun,s)}static mdat(e){return z.box(z.types.mdat,e)}}z.init();var K=z;var X=class{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}};class Z{constructor(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null}}class Y{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}class ${constructor(){this._list=[]}clear(){this._list=[]}appendArray(e){let t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}getLastSyncPointBeforeDts(e){if(0==this._list.length)return null;let t=this._list,i=0,n=t.length-1,r=0,s=0,a=n;for(e<t[0].dts&&(i=0,s=a+1);s<=a;){if(r=s+Math.floor((a-s)/2),r===n||e>=t[r].dts&&e<t[r+1].dts){i=r;break}t[r].dts<e?s=r+1:a=r-1}return this._list[i]}}class Q{constructor(e){this._type=e,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return 0===this._list.length}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(e){let t=this._list;if(0===t.length)return-2;let i=t.length-1,n=0,r=0,s=i,a=0;if(e<t[0].originalBeginDts)return a=-1,a;for(;r<=s;){if(n=r+Math.floor((s-r)/2),n===i||e>t[n].lastSample.originalDts&&e<t[n+1].originalBeginDts){a=n;break}t[n].originalBeginDts<e?r=n+1:s=n-1}return a}_searchNearestSegmentAfter(e){return this._searchNearestSegmentBefore(e)+1}append(e){let t=this._list,i=e,n=this._lastAppendLocation,r=0;-1!==n&&n<t.length&&i.originalBeginDts>=t[n].lastSample.originalDts&&(n===t.length-1||n<t.length-1&&i.originalBeginDts<t[n+1].originalBeginDts)?r=n+1:t.length>0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)}getLastSegmentBefore(e){let t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}getLastSampleBefore(e){let t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}getLastSyncPointBefore(e){let t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;for(;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null}}var J=class{constructor(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Q("audio"),this._videoSegmentInfoList=new Q("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!y.chrome||!(y.version.major<50||50===y.version.major&&y.version.build<2661)),this._fillSilentAfterSeek=y.msedge||y.msie,this._mp3UseMpegAudio=!y.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(e){this._onInitSegment=e}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(e){this._onMediaSegment=e}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(e,t){if(!this._onMediaSegment)throw new c("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}_onTrackMetadataReceived(e,t){let i=null,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=K.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=K.generateInitSegment(t)}if(!this._onInitSegment)throw new c("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:`${e}/${n}`,mediaDuration:t.duration})}_calculateDtsBase(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);let n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)}_remuxAudio(e,t){if(null==this._audioMeta)return;let i,n=e,r=n.samples,s=-1,a=-1,o=this._audioMeta.refSampleDuration,u="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,h=this._dtsBaseInited&&void 0===this._audioNextDts,d=!1;if(!r||0===r.length)return;if(1===r.length&&!t)return;let c=0,f=null,p=0;u?(c=0,p=n.length):(c=8,p=8+n.length);let m=null;if(r.length>1&&(m=r.pop(),p-=m.length),null!=this._audioStashedLastSample){let e=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(e),p+=e.length}null!=m&&(this._audioStashedLastSample=m);let g=r[0].dts-this._dtsBase;if(this._audioNextDts)i=g-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())i=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(d=!0);else{let e=this._audioSegmentInfoList.getLastSampleBefore(g);if(null!=e){let t=g-(e.originalDts+e.duration);t<=3&&(t=0),i=g-(e.dts+e.duration+t)}else i=0}if(d){let e=g-i,t=this._videoSegmentInfoList.getLastSegmentBefore(g);if(null!=t&&t.beginDts<e){let i=X.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(i){let n=t.beginDts,s=e-t.beginDts;l.v(this.TAG,`InsertPrefixSilentAudio: dts: ${n}, duration: ${s}`),r.unshift({unit:i,dts:n,pts:n}),p+=i.byteLength}}else d=!1}let _=[];for(let E=0;E<r.length;E++){let e=r[E],t=e.unit,n=e.dts-this._dtsBase,a=n-i;-1===s&&(s=a);let u=0;if(E!==r.length-1){u=r[E+1].dts-this._dtsBase-i-a}else if(null!=m){u=m.dts-this._dtsBase-i-a}else u=_.length>=1?_[_.length-1].duration:Math.floor(o);let h=!1,d=null;if(u>1.5*o&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!y.safari){h=!0;let e=Math.abs(u-o),i=Math.ceil(e/o),r=a+o;l.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\ndts: ${a+u} ms, expected: ${a+Math.round(o)} ms, delta: ${Math.round(e)} ms, generate: ${i} frames`);let s=X.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==s&&(l.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),s=t),d=[];for(let t=0;t<i;t++){let e=Math.round(r);if(d.length>0){let t=d[d.length-1];t.duration=e-t.dts}let t={dts:e,pts:e,cts:0,unit:s,size:s.byteLength,duration:0,originalDts:n,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};d.push(t),p+=t.size,r+=o}let c=d[d.length-1];c.duration=a+u-c.dts,u=Math.round(o)}_.push({dts:a,pts:a,cts:0,unit:e.unit,size:e.unit.byteL
1ength,duration:u,originalDts:n,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),h&&_.push.apply(_,d)}u?f=new Uint8Array(p):(f=new Uint8Array(p),f[0]=p>>>24&255,f[1]=p>>>16&255,f[2]=p>>>8&255,f[3]=255&p,f.set(K.types.mdat,4));for(let l=0;l<_.length;l++){let e=_[l].unit;f.set(e,c),c+=e.byteLength}let v=_[_.length-1];a=v.dts+v.duration,this._audioNextDts=a;let b=new Y;b.beginDts=s,b.endDts=a,b.beginPts=s,b.endPts=a,b.originalBeginDts=_[0].originalDts,b.originalEndDts=v.originalDts+v.duration,b.firstSample=new Z(_[0].dts,_[0].pts,_[0].duration,_[0].originalDts,!1),b.lastSample=new Z(v.dts,v.pts,v.duration,v.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(b),n.samples=_,n.sequenceNumber++;let T=null;T=u?new Uint8Array:K.moof(n,s),n.samples=[],n.length=0;let S={type:"audio",data:this._mergeBoxes(T,f).buffer,sampleCount:_.length,info:b};u&&h&&(S.timestampOffset=s),this._onMediaSegment("audio",S)}_remuxVideo(e,t){if(null==this._videoMeta)return;let i,n=e,r=n.samples,s=-1,a=-1,o=-1,u=-1;if(!r||0===r.length)return;if(1===r.length&&!t)return;let l=8,h=null,d=8+e.length,c=null;if(r.length>1&&(c=r.pop(),d-=c.length),null!=this._videoStashedLastSample){let e=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(e),d+=e.length}null!=c&&(this._videoStashedLastSample=c);let f=r[0].dts-this._dtsBase;if(this._videoNextDts)i=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())i=0;else{let e=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=e){let t=f-(e.originalDts+e.duration);t<=3&&(t=0),i=f-(e.dts+e.duration+t)}else i=0}let p=new Y,m=[];for(let v=0;v<r.length;v++){let e=r[v],t=e.dts-this._dtsBase,n=e.isKeyframe,a=t-i,u=e.cts,l=a+u;-1===s&&(s=a,o=l);let h=0;if(v!==r.length-1){h=r[v+1].dts-this._dtsBase-i-a}else if(null!=c){h=c.dts-this._dtsBase-i-a}else h=m.length>=1?m[m.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(n){let t=new Z(a,l,h,e.dts,!0);t.fileposition=e.fileposition,p.appendSyncPoint(t)}m.push({dts:a,pts:l,cts:u,units:e.units,size:e.length,isKeyframe:n,duration:h,originalDts:t,flags:{isLeading:0,dependsOn:n?2:1,isDependedOn:n?1:0,hasRedundancy:0,isNonSync:n?0:1}})}h=new Uint8Array(d),h[0]=d>>>24&255,h[1]=d>>>16&255,h[2]=d>>>8&255,h[3]=255&d,h.set(K.types.mdat,4);for(let v=0;v<m.length;v++){let e=m[v].units;for(;e.length;){let t=e.shift().data;h.set(t,l),l+=t.byteLength}}let g=m[m.length-1];if(a=g.dts+g.duration,u=g.pts+g.duration,this._videoNextDts=a,p.beginDts=s,p.endDts=a,p.beginPts=o,p.endPts=u,p.originalBeginDts=m[0].originalDts,p.originalEndDts=g.originalDts+g.duration,p.firstSample=new Z(m[0].dts,m[0].pts,m[0].duration,m[0].originalDts,m[0].isKeyframe),p.lastSample=new Z(g.dts,g.pts,g.duration,g.originalDts,g.isKeyframe),this._isLive||this._videoSegmentInfoList.append(p),n.samples=m,n.sequenceNumber++,this._forceFirstIDR){let e=m[0].flags;e.dependsOn=2,e.isNonSync=0}let _=K.moof(n,s);n.samples=[],n.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(_,h).buffer,sampleCount:m.length,info:p})}_mergeBoxes(e,t){let i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i}};var ee={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};var te=class{constructor(e,t){this.TAG="TransmuxingController",this._emitter=new(o()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!==typeof e.cors&&(e.cors=!0),"boolean"!==typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;let i=0;this._mediaDataSource.segments.forEach((n=>{n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(e,t){this._currentSegmentIndex=e;let i=this._mediaDataSource.segments[e],n=this._ioctl=new C(i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}
1resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(e){if(null==this._mediaInfo||!this._mediaInfo.isSeekable())return;let t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){let i=this._mediaInfo.segments[t];if(void 0==i)this._pendingSeekTime=e;else{let t=i.getNearestKeyframe(e);this._remuxer.seek(t.milliseconds),this._ioctl.seek(t.fileposition),this._pendingResolveSeekPoint=t.milliseconds}}else{let i=this._mediaInfo.segments[t];if(void 0==i)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{let n=i.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(e){let t=this._mediaDataSource.segments,i=t.length-1;for(let n=0;n<t.length;n++)if(e<t[n].timestampBase){i=n-1;break}return i}_onInitChunkArrival(e,t){let i=null,n=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else if((i=W.probe(e)).match){this._demuxer=new W(i,this._config),this._remuxer||(this._remuxer=new J(this._config));let r=this._mediaDataSource;void 0==r.duration||isNaN(r.duration)||(this._demuxer.overridedDuration=r.duration),"boolean"===typeof r.hasAudio&&(this._demuxer.overridedHasAudio=r.hasAudio),"boolean"===typeof r.hasVideo&&(this._demuxer.overridedHasVideo=r.hasVideo),this._demuxer.timestampBase=r.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),n=this._demuxer.parseChunks(e,t)}else i=null,l.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((()=>{this._internalAbort()})),this._emitter.emit(ee.DEMUX_ERROR,q.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),n=0;return n}_onMediaInfo(e){null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,P.prototype));let t=Object.assign({},e);Object.setPrototypeOf(t,P.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=t,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((()=>{let e=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(e)}))}_onMetaDataArrived(e){this._emitter.emit(ee.METADATA_ARRIVED,e)}_onScriptDataArrived(e){this._emitter.emit(ee.SCRIPTDATA_ARRIVED,e)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(e){let t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ee.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(e){let t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}_onIORecoveredEarlyEof(){this._emitter.emit(ee.RECOVERED_EARLY_EOF)}_onIOException(e,t){l.e(this.TAG,`IOException: type = ${e}, code = ${t.code}, msg = ${t.msg}`),this._emitter.emit(ee.IO_ERROR,e,t),this._disableStatisticsReporter()}_onDemuxException(e,t){l.e(this.TAG,`DemuxException: type = ${e}, info = ${t}`),this._emitter.emit(ee.DEMUX_ERROR,e,t)}_onRemuxerInitSegmentArrival(e,t){this._emitter.emit(ee.INIT_SEGMENT,e,t)}
1_onRemuxerMediaSegmentArrival(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(ee.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){let e=t.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,y.safari&&e.length>0&&e[0].originalDts===i&&(i=e[0].pts),this._emitter.emit(ee.RECOMMEND_SEEKPOINT,i)}}_enableStatisticsReporter(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(e){let t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(ee.MEDIA_INFO,i)}_reportStatisticsInfo(){let e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ee.STATISTICS_INFO,e)}};var ie=function(e){let t=null,i=function(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}.bind(this);function n(t,i){let n={msg:ee.INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function r(t,i){let n={msg:ee.MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function a(){let t={msg:ee.LOADING_COMPLETE};e.postMessage(t)}function o(){let t={msg:ee.RECOVERED_EARLY_EOF};e.postMessage(t)}function u(t){let i={msg:ee.MEDIA_INFO,data:t};e.postMessage(i)}function l(t){let i={msg:ee.METADATA_ARRIVED,data:t};e.postMessage(i)}function h(t){let i={msg:ee.SCRIPTDATA_ARRIVED,data:t};e.postMessage(i)}function d(t){let i={msg:ee.STATISTICS_INFO,data:t};e.postMessage(i)}function c(t,i){e.postMessage({msg:ee.IO_ERROR,data:{type:t,info:i}})}function f(t,i){e.postMessage({msg:ee.DEMUX_ERROR,data:{type:t,info:i}})}function p(t){e.postMessage({msg:ee.RECOMMEND_SEEKPOINT,data:t})}s.install(),e.addEventListener("message",(function(s){switch(s.data.cmd){case"init":t=new te(s.data.param[0],s.data.param[1]),t.on(ee.IO_ERROR,c.bind(this)),t.on(ee.DEMUX_ERROR,f.bind(this)),t.on(ee.INIT_SEGMENT,n.bind(this)),t.on(ee.MEDIA_SEGMENT,r.bind(this)),t.on(ee.LOADING_COMPLETE,a.bind(this)),t.on(ee.RECOVERED_EARLY_EOF,o.bind(this)),t.on(ee.MEDIA_INFO,u.bind(this)),t.on(ee.METADATA_ARRIVED,l.bind(this)),t.on(ee.SCRIPTDATA_ARRIVED,h.bind(this)),t.on(ee.STATISTICS_INFO,d.bind(this)),t.on(ee.RECOMMEND_SEEKPOINT,p.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(s.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":{let e=s.data.param;O.applyConfig(e),!0===e.enableCallback?O.addLogListener(i):O.removeLogListener(i);break}}}))};var ne=class{constructor(e,t){if(this.TAG="Transmuxer",this._emitter=new(o()),t.enableWorker&&"undefined"!==typeof Worker)try{let n=i(18034);this._worker=n(ie),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},O.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:O.getConfig()})}catch(n){l.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new te(e,t)}else this._controller=new te(e,t);if(this._controller){let e=this._controller;e.on(ee.IO_ERROR,this._onIOError.bind(this)),e.on(ee.DEMUX_ERROR,this._onDemuxError.bind(this)),e.on(ee.INIT_SEGMENT,this._onInitSegment.bind(this)),e.on(ee.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),e.on(ee.
1LOADING_COMPLETE,this._onLoadingComplete.bind(this)),e.on(ee.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),e.on(ee.MEDIA_INFO,this._onMediaInfo.bind(this)),e.on(ee.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),e.on(ee.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),e.on(ee.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),e.on(ee.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),O.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}hasWorker(){return null!=this._worker}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(e,t){Promise.resolve().then((()=>{this._emitter.emit(ee.INIT_SEGMENT,e,t)}))}_onMediaSegment(e,t){Promise.resolve().then((()=>{this._emitter.emit(ee.MEDIA_SEGMENT,e,t)}))}_onLoadingComplete(){Promise.resolve().then((()=>{this._emitter.emit(ee.LOADING_COMPLETE)}))}_onRecoveredEarlyEof(){Promise.resolve().then((()=>{this._emitter.emit(ee.RECOVERED_EARLY_EOF)}))}_onMediaInfo(e){Promise.resolve().then((()=>{this._emitter.emit(ee.MEDIA_INFO,e)}))}_onMetaDataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(ee.METADATA_ARRIVED,e)}))}_onScriptDataArrived(e){Promise.resolve().then((()=>{this._emitter.emit(ee.SCRIPTDATA_ARRIVED,e)}))}_onStatisticsInfo(e){Promise.resolve().then((()=>{this._emitter.emit(ee.STATISTICS_INFO,e)}))}_onIOError(e,t){Promise.resolve().then((()=>{this._emitter.emit(ee.IO_ERROR,e,t)}))}_onDemuxError(e,t){Promise.resolve().then((()=>{this._emitter.emit(ee.DEMUX_ERROR,e,t)}))}_onRecommendSeekpoint(e){Promise.resolve().then((()=>{this._emitter.emit(ee.RECOMMEND_SEEKPOINT,e)}))}_onLoggingConfigChanged(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}_onWorkerMessage(e){let t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case ee.INIT_SEGMENT:case ee.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case ee.LOADING_COMPLETE:case ee.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case ee.MEDIA_INFO:Object.setPrototypeOf(i,P.prototype),this._emitter.emit(t.msg,i);break;case ee.METADATA_ARRIVED:case ee.SCRIPTDATA_ARRIVED:case ee.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case ee.IO_ERROR:case ee.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case ee.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":l.emitter.emit("log",i.type,i.logcat)}}};var re={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};var se=class{constructor(e){this.TAG="MSEController",this._config=e,this._emitter=new(o()),this._config.isLive&&void 0==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new $}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaSource)throw new c("MediaSource has been attached to an HTMLMediaElement!");let t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let t=this._mediaSource;
1for(let i in this._sourceBuffers){let n=this._pendingSegments[i];n.splice(0,n.length),this._pendingSegments[i]=null,this._pendingRemoveRanges[i]=null,this._lastInitSegments[i]=null;let r=this._sourceBuffers[i];if(r){if("closed"!==t.readyState){try{t.removeSourceBuffer(r)}catch(e){l.e(this.TAG,e.message)}r.removeEventListener("error",this.e.onSourceBufferError),r.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[i]=null,this._sourceBuffers[i]=null}}if("open"===t.readyState)try{t.endOfStream()}catch(e){l.e(this.TAG,e.message)}t.removeEventListener("sourceopen",this.e.onSourceOpen),t.removeEventListener("sourceended",this.e.onSourceEnded),t.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);let i=e,n=`${i.container}`;i.codec&&i.codec.length>0&&(n+=`;codecs=${i.codec}`);let r=!1;if(l.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])l.v(this.TAG,`Notice: ${i.type} mimeType changed, origin: ${this._mimeTypes[i.type]}, target: ${n}`);else{r=!0;try{let e=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);e.addEventListener("error",this.e.onSourceBufferError),e.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(s){return l.e(this.TAG,s.message),void this._emitter.emit(re.ERROR,{code:s.code,msg:s.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),y.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(e){let t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}seek(e){for(let i in this._sourceBuffers){if(!this._sourceBuffers[i])continue;let e=this._sourceBuffers[i];if("open"===this._mediaSource.readyState)try{e.abort()}catch(t){l.e(this.TAG,t.message)}this._idrList.clear();let n=this._pendingSegments[i];if(n.splice(0,n.length),"closed"!==this._mediaSource.readyState){for(let t=0;t<e.buffered.length;t++){let n=e.buffered.start(t),r=e.buffered.end(t);this._pendingRemoveRanges[i].push({start:n,end:r})}if(e.updating||this._doRemoveRanges(),y.safari){let t=this._lastInitSegments[i];t&&(this._pendingSegments[i].push(t),e.updating||this._doAppendSegments())}}}}endOfStream(){let e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}getNearestKeyframe(e){return this._idrList.getLastSyncPointBeforeDts(e)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let e=this._mediaElement.currentTime;for(let t in this._sourceBuffers){let i=this._sourceBuffers[t];if(i){let t=i.buffered;if(t.length>=1&&e-t.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let e=this._mediaElement.currentTime;for(let t in this._sourceBuffers){let i=this._sourceBuffers[t];if(i){let n=i.buffered,r=!1;for(let i=0;i<n.length;i++){let s=n.start(i),a=n.end(i);if(s<=e&&e<a+3){if(e-s>=this._config.autoCleanupMaxBackwardDuration){r=!0;let i=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:s,end:i})}}else a<e&&(r=!0,this._pendingRemoveRanges[t].push({start:s,end:a}))}r&&!i.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let e=this._sourceBuffers;if(0===this._mediaElement.readyState||"open"!==this._mediaSource.readyState)return;if(e.video&&e.video.updating||e.audio&&e.audio.updating)return;
1let t=this._mediaSource.duration,i=this._pendingMediaDuration;i>0&&(isNaN(t)||i>t)&&(l.v(this.TAG,`Update MediaSource duration from ${t} to ${i}`),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let e in this._pendingRemoveRanges){if(!this._sourceBuffers[e]||this._sourceBuffers[e].updating)continue;let t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];for(;i.length&&!t.updating;){let e=i.shift();t.remove(e.start,e.end)}}}_doAppendSegments(){let e=this._pendingSegments;for(let i in e)if(this._sourceBuffers[i]&&!this._sourceBuffers[i].updating&&e[i].length>0){let n=e[i].shift();if(n.timestampOffset){let e=this._sourceBuffers[i].timestampOffset,t=n.timestampOffset/1e3;Math.abs(e-t)>.1&&(l.v(this.TAG,`Update MPEG audio timestampOffset from ${e} to ${t}`),this._sourceBuffers[i].timestampOffset=t),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[i].appendBuffer(n.data),this._isBufferFull=!1,"video"===i&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(t){this._pendingSegments[i].unshift(n),22===t.code?(this._isBufferFull||this._emitter.emit(re.BUFFER_FULL),this._isBufferFull=!0):(l.e(this.TAG,t.message),this._emitter.emit(re.ERROR,{code:t.code,msg:t.message}))}}}_onSourceOpen(){if(l.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let e=this._pendingSourceBufferInit;for(;e.length;){let t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(re.SOURCE_OPEN)}_onSourceEnded(){l.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){l.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let e=this._pendingSegments;return e.video.length>0||e.audio.length>0}_hasPendingRemoveRanges(){let e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(re.UPDATE_END)}_onSourceBufferError(e){l.e(this.TAG,`SourceBuffer Error: ${e}`)}};const ae={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},oe={NETWORK_EXCEPTION:g.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:q.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:q.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:q.CODEC_UNSUPPORTED};var ue=class{constructor(e,t){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(o()),this._config=I(),"object"===typeof t&&Object.assign(this._config,t),"flv"!==e.type.toLowerCase())throw new f("FlvPlayer requires an flv MediaDataSource input!");!0===e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let i=y.chrome&&(y.version.major<50||50===y.version.major&&y.version.build<2661);this._alwaysSeekKeyframe=!!(i||y.msedge||y.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){e===R.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((()=>{this._emitter.emit(R.MEDIA_INFO,this.mediaInfo)})):e===R.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((()=>{this._emitter.emit(R.STATISTICS_INFO,this.statisticsInfo)})),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new se(this._config),this._msectl.on(re.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(re.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(re.SOURCE_OPEN,(()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())})),this._msectl.on(re.ERROR,(e=>{this._emitter.emit(R.ERROR,ae.MEDIA_ERROR,oe.MEDIA_MSE_ERROR,e)}
1)),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(t){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new c("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new c("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new ne(this._mediaDataSource,this._config),this._transmuxer.on(ee.INIT_SEGMENT,((e,t)=>{this._msectl.appendInitSegment(t)})),this._transmuxer.on(ee.MEDIA_SEGMENT,((e,t)=>{if(this._msectl.appendMediaSegment(t),this._config.lazyLoad&&!this._config.isLive){let e=this._mediaElement.currentTime;t.info.endDts>=1e3*(e+this._config.lazyLoadMaxDuration)&&null==this._progressChecker&&(l.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}})),this._transmuxer.on(ee.LOADING_COMPLETE,(()=>{this._msectl.endOfStream(),this._emitter.emit(R.LOADING_COMPLETE)})),this._transmuxer.on(ee.RECOVERED_EARLY_EOF,(()=>{this._emitter.emit(R.RECOVERED_EARLY_EOF)})),this._transmuxer.on(ee.IO_ERROR,((e,t)=>{this._emitter.emit(R.ERROR,ae.NETWORK_ERROR,e,t)})),this._transmuxer.on(ee.DEMUX_ERROR,((e,t)=>{this._emitter.emit(R.ERROR,ae.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(ee.MEDIA_INFO,(e=>{this._mediaInfo=e,this._emitter.emit(R.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(ee.METADATA_ARRIVED,(e=>{this._emitter.emit(R.METADATA_ARRIVED,e)})),this._transmuxer.on(ee.SCRIPTDATA_ARRIVED,(e=>{this._emitter.emit(R.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(ee.STATISTICS_INFO,(e=>{this._statisticsInfo=this._fillStatisticsInfo(e),this._emitter.emit(R.STATISTICS_INFO,Object.assign({},this._statisticsInfo))})),this._transmuxer.on(ee.RECOMMEND_SEEKPOINT,(e=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e/1e3)})),this._transmuxer.open()))}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0;for(let r=0;r<e.length;r++){let s=e.start(r),a=e.end(r);if(s<=t&&t<a){i=s,n=a;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(l.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){l.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1;for(let n=0;n<t.length;n++){let r=t.start(n),s=t.end(n);if(e>=r&&e<s){e>=s-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(l.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(e){let t=this._mediaElement.buffered;for(let i=0;i<t.length;i++){let n=t.start(i),r=t.end(i);if(e>=n&&e<r)return!0}return!1}_internalSeek(e){let t=this._isTimepointBuffered(e),i=!1,n=0;if(e<1&&this._mediaElement.buffered.length>0){let t=this._mediaElement.buffered.start(0);(t<1&&e<t||y.safari)&&(i=!0,n=y.safari?.1:t)}if(i)this._requestSetTime=!0,this._mediaElement.currentTime=n;else if(t){if(this._alwaysSeekKeyframe){let t=this._msectl.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement.currentTime=null!=t?t.dts/1e3:e}else this._requestSetTime=!0,this._mediaElement.currentTime=e;null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(e){let t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){let e=t.buffered;e.length>0&&t.currentTime<e.start(0)&&(l.w(this.TAG,`Playback seems stuck at ${t.currentTime}, seek to ${e.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=e.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}
1_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(e){let t=this._mediaElement.currentTime,i=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(t<1&&i.length>0){let e=i.start(0);if(e<1&&t<e||y.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=y.safari?.1:e)}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){let e=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=e&&(this._requestSetTime=!0,this._mediaElement.currentTime=e.dts/1e3)}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}_onvCanPlay(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(e){this._checkAndResumeStuckPlayback(!0)}_onvProgress(e){this._checkAndResumeStuckPlayback()}};var le=class{constructor(e,t){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(o()),this._config=I(),"object"===typeof t&&Object.assign(this._config,t),"flv"===e.type.toLowerCase())throw new f("NativePlayer does't support flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new f(`NativePlayer(${e.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){e===R.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((()=>{this._emitter.emit(R.MEDIA_INFO,this.mediaInfo)})):e===R.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((()=>{this._emitter.emit(R.STATISTICS_INFO,this.statisticsInfo)})),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(t){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new c("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}get mediaInfo(){let e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}get statisticsInfo(){let e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}
1_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(R.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(R.STATISTICS_INFO,this.statisticsInfo)}};s.install();let he={createPlayer:function(e,t){let i=e;if(null==i||"object"!==typeof i)throw new f("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new f("MediaDataSource must has type field to indicate video file type!");return"flv"===i.type?new ue(i,t):new le(i,t)},isSupported:function(){return x.supportMSEH264Playback()},getFeatureList:function(){return x.getFeatureList()}};he.BaseLoader=_,he.LoaderStatus=m,he.LoaderErrors=g,he.Events=R,he.ErrorTypes=ae,he.ErrorDetails=oe,he.FlvPlayer=ue,he.NativePlayer=le,he.LoggingControl=O,Object.defineProperty(he,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var de=he;const ce=n.Z.getTech("Html5"),fe=n.Z.mergeOptions||n.Z.util.mergeOptions,pe={mediaDataSource:{},config:{}};class me extends ce{constructor(e,t){super(e=fe(pe,e),t)}setSrc(e){this.flvPlayer&&(this.flvPlayer.detachMediaElement(),this.flvPlayer.destroy());const t=this.options_.mediaDataSource,i=this.options_.config;t.type=void 0===t.type?"flv":t.type,t.url=e,this.flvPlayer=de.createPlayer(t,i),this.flvPlayer.attachMediaElement(this.el_),this.flvPlayer.load()}dispose(){this.flvPlayer&&(this.flvPlayer.detachMediaElement(),this.flvPlayer.destroy()),super.dispose()}}me.isSupported=function(){return de&&de.isSupported()},me.formats={"video/flv":"FLV","video/x-flv":"FLV"},me.canPlayType=function(e){return me.isSupported()&&e in me.formats?"maybe":""},me.canPlaySource=function(e,t){return me.canPlayType(e.type)},me.VERSION="__VERSION__",n.Z.registerTech("Flvjs",me);var ge=me},13407:function(e,t,i){var n=i(58908),r=e.exports={WebVTT:i(63706),VTTCue:i(22230),VTTRegion:i(13710)};n.vttjs=r,n.WebVTT=r.WebVTT;var s=r.VTTCue,a=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=s,n.VTTRegion=a},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},63706:function(e,t,i){var n=i(89144),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function s(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"===typeof r[s]){var a=r[s].split(i);if(2===a.length)t(a[0],a[1])}}function l(e,t,i){var n=e;function r(){var t=a(e);if(null===t)throw new s(s.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new s(s.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(r){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(r){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(r){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}s.prototype=r(Error.prototype),s.prototype.constructor=s,s.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var h=n.createElement&&n.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>
1]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=d[t];if(!n)return null;var r=e.document.createElement(n),s=f[t];return s&&i&&(r[s]=i.trim()),r}for(var s,o,u=e.document.createElement("div"),l=u,m=[];null!==(s=i());)if("<"!==s[0])l.appendChild(e.document.createTextNode((o=s,h.innerHTML=o,o=h.textContent,h.textContent="",o)));else{if("/"===s[1]){m.length&&m[m.length-1]===s.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=a(s.substr(1,s.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var v=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=r(v[1],v[3])))continue;if(!n(l,g))continue;if(v[2]){var y=v[2].split(".");y.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=y.join(" ")}m.push(v[1]),l.appendChild(g),l=g}return u}var g=[[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 _(e){for(var t=0;t<g.length;t++){var i=g[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function v(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var s=i.match(/^.*(\n|\r)/);return s?(e.length=0,s[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var s=0;s<i.length;s++)if(_(i.charCodeAt(s)))return"rtl";return"ltr"}function y(){}function b(e,t,i){y.call(this),this.cue=t,this.cueDiv=m(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")}
vendor: 11,136 bytes, line 1
1)}}function T(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function S(e,t,i,n){var r=new T(t),s=t.cue,a=function(e){if("number"===typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(s),o=[];if(s.snapToLines){var u;switch(s.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,h=l*Math.round(a),d=i[u]+l,c=o[0];Math.abs(h)>d&&(h=h<0?-1:1,h*=Math.ceil(d/l)*l),a<0&&(h+=""===s.vertical?i.height:i.width,o=o.reverse()),r.move(c,h)}else{var f=r.lineHeight/i.height*100;switch(s.lineAlign){case"center":a-=f/2;break;case"end":a-=f}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,s=new T(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var u=e.intersectPercentage(i);a>u&&(r=new T(e),a=u),e=new T(s)}return r||s}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}y.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},y.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(y.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},T.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},T.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],s=T.getSimpleBoxPosition(n),a={font:Math.round(.05*s.height*100)/100+"px sans-serif"};!function(){for(var i,o,u=0;u<t.length;u++)o=t[u],i=new b(e,o,a),n.appendChild(i.div),S(0,i,s,r),o.displayState=i.div,r.push(T.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},E.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},E.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof s))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){e.match(/X-TIMESTAMP-MAP/)?u(e,(function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new o;u(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",a(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}),/=/):u(e,(function(e,i){if("Region"===e)!function(e){var i=new o;if(u(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new o;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var h=(r=i()).match(/^WEBVTT([ \t].*)?$/);if(!h||!h[0])throw new s(s.Errors.BadSignature);t.state="HEADER"}for(var d=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(d?d=!1:r=i(),t.state){case"HEADER":/:/.test(r)?n(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(f){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{l(r,t.cue,t.regionList)}catch(f){t.reportOrThrowError(f),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var c=-1!==r.indexOf("--\x3e");if(!r||c&&(d=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(t.state="ID");continue}}}catch(f){t.reportOrThrowError(f),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new s(s.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=E},22230:function(e){var t={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(e){return"string"===typeof e&&(!!i[e.toLowerCase()]&&e.toLowerCase())}function r(e,i,r){this.hasBeenReset=!1;var s="",a=!1,o=e,u=i,l=r,h=null,d="",c=!0,f="auto",p="start",m="auto",g="auto",_=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(e){s=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(e){h=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var i=function(e){return"string"===typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return f},set:function(e){if("number"!==typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");f=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=n(e);t?(p=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=n(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},13710:function(e){var t={"":!0,up:!0};function i(e){return"number"===typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,r=0,s=100,a=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");s=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a}
1,set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var i=function(e){return"string"===typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):u=i}}})}},18034:function(e){var t=arguments[3],i=arguments[4],n=arguments[5],r=JSON.stringify;e.exports=function(e,s){for(var a,o=Object.keys(n),u=0,l=o.length;u<l;u++){var h=o[u],d=n[h].exports;if(d===e||d&&d.default===e){a=h;break}}if(!a){a=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(u=0,l=o.length;u<l;u++){c[h=o[u]]=h}i[a]=["function(require,module,exports){"+e+"(self); }",c]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[a]=a,i[f]=["function(require,module,exports){var f = require("+r(a)+");(f.default ? f.default : f)(self);}",p];var m={};!function e(t){for(var n in m[t]=!0,i[t][1]){var r=i[t][1][n];m[r]||e(r)}}(f);var g="("+t+")({"+Object.keys(m).map((function(e){return r(e)+":["+i[e][0]+","+r(i[e][1])+"]"})).join(",")+"},{},["+r(f)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,v=new Blob([g],{type:"text/javascript"});if(s&&s.bare)return v;var y=_.createObjectURL(v),b=new Worker(y);return b.objectURL=y,b}},33081:function(e,t,i){function n(e){this.options=e||{locator:{}}}function r(){this.cdata=!1}function s(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function a(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function o(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}n.prototype.parseFromString=function(e,t){var i=this.options,n=new d,s=i.domBuilder||new r,o=i.errorHandler,u=i.locator,h=i.xmlns||{},c=/\/x?html?$/.test(t),f=c?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&s.setDocumentLocator(u),n.errorHandler=function(e,t,i){if(!e){if(t instanceof r)return t;e=t}var n={},s=e instanceof Function;function o(t){var r=e[t];!r&&s&&(r=2==e.length?function(i){e(t,i)}:e),n[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+a(i))}||function(){}}return i=i||{},o("warning"),o("error"),o("fatalError"),n}(o,s,u),n.domBuilder=i.domBuilder||s,c&&(h[""]="http://www.w3.org/1999/xhtml"),h.xml=h.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"===typeof e?n.parse(e,h,f):n.errorHandler.error("invalid doc source"),s.doc},r.prototype={startDocument:function(){this.doc=(new f).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),o=n.length;u(this,a),this.currentElement=a,this.locator&&s(this.locator,a);for(var l=0;l<o;l++){e=n.getURI(l);var h=n.getValue(l),d=(i=n.getQName(l),r.createAttributeNS(e,i));this.locator&&s(n.getLocator(l),d),d.value=d.nodeValue=h,a.setAttributeNode(d)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&s(this.locator,i),u(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=o.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&s(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=o.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&s(this.locator,n),u(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(e,t,i);this.locator&&s(this.locator,r),u(this,r)}},warning:function(e){console.warn("[xmldom warning]\t"+e,a(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,a(this.locator))},fatalError:function(e){throw new c(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){r.prototype[e]=function(){return null}}));var l=i(93791),h=i(99888),d=h.XMLReader,c=h.ParseError,f=i(79034).DOMImplementation;
vendor: 15,926 bytes, line 1
1i(79034),t.a=n},79034:function(e,t){function i(e,t){for(var i in e)t[i]=e[i]}function n(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,i(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var r={},s=r.ELEMENT_NODE=1,a=r.ATTRIBUTE_NODE=2,o=r.TEXT_NODE=3,u=r.CDATA_SECTION_NODE=4,l=r.ENTITY_REFERENCE_NODE=5,h=r.ENTITY_NODE=6,d=r.PROCESSING_INSTRUCTION_NODE=7,c=r.COMMENT_NODE=8,f=r.DOCUMENT_NODE=9,p=r.DOCUMENT_TYPE_NODE=10,m=r.DOCUMENT_FRAGMENT_NODE=11,g=r.NOTATION_NODE=12,_={},v={},y=(_.INDEX_SIZE_ERR=(v[1]="Index size error",1),_.DOMSTRING_SIZE_ERR=(v[2]="DOMString size error",2),_.HIERARCHY_REQUEST_ERR=(v[3]="Hierarchy request error",3)),b=(_.WRONG_DOCUMENT_ERR=(v[4]="Wrong document",4),_.INVALID_CHARACTER_ERR=(v[5]="Invalid character",5),_.NO_DATA_ALLOWED_ERR=(v[6]="No data allowed",6),_.NO_MODIFICATION_ALLOWED_ERR=(v[7]="No modification allowed",7),_.NOT_FOUND_ERR=(v[8]="Not found",8)),T=(_.NOT_SUPPORTED_ERR=(v[9]="Not supported",9),_.INUSE_ATTRIBUTE_ERR=(v[10]="Attribute in use",10));_.INVALID_STATE_ERR=(v[11]="Invalid state",11),_.SYNTAX_ERR=(v[12]="Syntax error",12),_.INVALID_MODIFICATION_ERR=(v[13]="Invalid modification",13),_.NAMESPACE_ERR=(v[14]="Invalid namespace",14),_.INVALID_ACCESS_ERR=(v[15]="Invalid access",15);function S(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,v[e]),this.message=v[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return i.code=e,t&&(this.message=this.message+": "+t),i}function E(){}function w(e,t){this._node=e,this._refresh=t,k(this)}function k(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);ne(e,"length",n.length),i(n,e),e._inc=t}}function C(){}function A(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function I(e,t,i,n){if(n?t[A(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&M(r,e,n),function(e,t,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function L(e,t,i){var n=A(t,i);if(!(n>=0))throw S(b,new Error(e.tagName+"@"+i));for(var r=t.length-1;n<r;)t[n]=t[++n];if(t.length=r,e){var s=e.ownerDocument;s&&(M(s,e,i),i.ownerElement=null)}}function x(e){if(this._features={},e)for(var t in e)this._features=e[t]}function R(){}function D(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function O(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(O(e,t))return!0}while(e=e.nextSibling)}function P(){}function M(e,t,i,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&delete t._nsMap[i.prefix?i.localName:""]}function N(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s}}}function U(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,N(e.ownerDocument,e),t}function B(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===m){var r=t.firstChild;if(null==r)return t;var s=t.lastChild}else r=s=t;var a=i?i.previousSibling:e.lastChild;r.previousSibling=a,s.nextSibling=i,a?a.nextSibling=r:e.firstChild=r,null==i?e.lastChild=s:i.previousSibling=s;do{r.parentNode=e}while(r!==s&&(r=r.nextSibling));return N(e.ownerDocument||e,e),t.nodeType==m&&(t.firstChild=t.lastChild=null),t}function F(){this._nsMap={}}function j(){}function V(){}function H(){}function q(){}function G(){}function W(){}function z(){}function K(){}function X(){}function Z(){}function Y(){}function $(){}function Q(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r&&null==(r=n.lookupPrefix(s)))var a=[{namespace:s,prefix:null}];return ee(this,i,e,t,a),i.join("")}function J(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!n&&!r)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix==n)return a.namespace!=r}return!0}function ee(e,t,i,n,r){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case s:r||(r=[]);r.length;var h=e.attributes,g=h.length,_=e.firstChild,v=e.tagName;i="http://www.w3.org/1999/xhtml"===e.namespaceURI||i,t.push("<",v);for(var y=0;y<g;y++){"xmlns"==(b=h.item(y)).prefix?r.push({prefix:b.localName,namespace:b.value}):"xmlns"==b.nodeName&&r.push({prefix:"",namespace:b.value})}for(y=0;y<g;y++){var b;if(J(b=h.item(y),0,r)){var T=b.prefix||"",S=b.namespaceURI,E=T?" xmlns:"+T:" xmlns";t.push(E,'="',S,'"'),r.push({prefix:T,namespace:S})}ee(b,t,i,n,r)}if(J(e,0,r)){T=e.prefix||"",S=e.namespaceURI,E=T?" xmlns:"+T:" xmlns";t.push(E,'="',S,'"'),r.push({prefix:T,namespace:S})}if(_||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(v)){if(t.push(">"),i&&/^script$/i.test(v))for(;_;)_.data?t.push(_.data):ee(_,t,i,n,r),_=_.nextSibling;else for(;_;)ee(_,t,i,n,r),_=_.nextSibling;t.push("</",v,">")}else t.push("/>");return;case f:case m:for(_=e.firstChild;_;)ee(_,t,i,n,r),_=_.nextSibling;return;case a:return t.push(" ",e.name,'="',e.value.replace(/[&"]/g,D),'"');case o:return t.push(e.data.replace(/[<&]/g,D).replace(/]]>/g,"]]&gt;"));case u:return t.push("<![CDATA[",e.data,"]]>");case c:return t.push("\x3c!--",e.data,"--\x3e");case p:var w=e.publicId,k=e.systemId;if(t.push("<!DOCTYPE ",e.name),w)t.push(" PUBLIC ",w),k&&"."!=k&&t.push(" ",k),t.push(">");else if(k&&"."!=k)t.push(" SYSTEM ",k,">");else{var C=e.internalSubset;C&&t.push(" [",C,"]"),t.push(">")}return;case d:return t.push("<?",e.target," ",e.data,"?>");case l:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function te(e,t,i){var n;switch(t.nodeType){case s:(n=t.cloneNode(!1)).ownerDocument=e;case m:break;case a:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(te(e,r,i)),r=r.nextSibling;return n}function ie(e,t,i){var n=new t.constructor;for(var r in t){var o=t[r];"object"!=typeof o&&o!=n[r]&&(n[r]=o)}switch(t.childNodes&&(n.childNodes=new E),n.ownerDocument=e,n.nodeType){case s:var u=t.attributes,l=n.attributes=new C,h=u.length;l._ownerElement=n;for(var d=0;d<h;d++)n.setAttributeNode(ie(e,u.item(d),!0));break;case a:i=!0}if(i)for(var c=t.firstChild;c;)n.appendChild(ie(e,c,i)),c=c.nextSibling;return n}function ne(e,t,i){e[t]=i}S.prototype=Error.prototype,i(_,S),E.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)ee(this[n],i,e,t);return i.join("")}},w.prototype.item=function(e){return k(this),this[e]},n(w,E),C.prototype={length:0,item:E.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new S(T);var i=this.getNamedItem(e.nodeName);return I(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new S(T);return t=this.getNamedItemNS(e.namespaceURI,e.localName),I(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return L(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return L(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},x.prototype={hasFeature:function(e,t){var i=this._features[e.toLowerCase()];return!(!i||t&&!(t in i))},createDocument:function(e,t,i){var n=new P;if(n.implementation=this,n.childNodes=new E,n.doctype=i,i&&n.appendChild(i),t){var r=n.createElementNS(e,t);n.appendChild(r)}return n},createDocumentType:function(e,t,i){var n=new W;return n.name=e,n.nodeName=e,n.publicId=t,n.systemId=i,n}},R.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return B(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return U(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ie(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==o&&e.nodeType==o?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==a?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==a?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},i(r,R),i(r,R.prototype),P.prototype={nodeName:"#document",nodeType:f,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==m){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==s&&(this.documentElement=e),B(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),U(this,e)},importNode:function(e,t){return te(this,e,t)},getElementById:function(e){var t=null;return O(this.documentElement,(function(i){if(i.nodeType==s&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new w(this,(function(e){var i=[];return O(e.documentElement,(function(n){n!==e&&n.nodeType==s&&t.test(n.getAttribute("class"))&&i.push(n)})),i}))},createElement:function(e){var t=new F;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new E,(t.attributes=new C)._ownerElement=t,t},createDocumentFragment:function(){var e=new Z;return e.ownerDocument=this,e.childNodes=new E,e},createTextNode:function(e){var t=new H;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new q;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new G;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Y;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new j;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new X;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new F,n=t.split(":"),r=i.attributes=new C;return i.childNodes=new E,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new j,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},n(P,R),F.prototype={nodeType:s,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===m?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,N(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new w(this,(function(t){var i=[];return O(t,(function(n){n===t||n.nodeType!=s||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new w(this,(function(i){var n=[];return O(i,(function(r){r===i||r.nodeType!==s||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},P.prototype.getElementsByTagName=F.prototype.getElementsByTagName,P.prototype.getElementsByTagNameNS=F.prototype.getElementsByTagNameNS,n(F,R),j.prototype.nodeType=a,n(j,R),V.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(v[y])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},n(V,R),H.prototype={nodeName:"#text",nodeType:o,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},n(H,V),q.prototype={nodeName:"#comment",nodeType:c},n(q,V),G.prototype={nodeName:"#cdata-section",nodeType:u},n(G,V),W.prototype.nodeType=p,n(W,R),z.prototype.nodeType=g,n(z,R),K.prototype.nodeType=h,n(K,R),X.prototype.nodeType=l,n(X,R),Z.prototype.nodeName="#document-fragment",Z.prototype.nodeType=m,n(Z,R),Y.prototype.nodeType=d,n(Y,R),$.prototype.serializeToString=function(e,t,i){return Q.call(e,t,i)},R.prototype.toString=Q;try{if(Object.defineProperty){function re(e){switch(e.nodeType){case s:case m:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(re(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(w.prototype,"length",{get:function(){return k(this),this.$$length}}),Object.defineProperty(R.prototype,"textContent",{get:function(){return re(this)},set:function(e){switch(this.nodeType){case s:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ne=function(e,t,i){e["$$"+t]=i}}}catch(se){}t.DOMImplementation=x},93791:function(e,t){t.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslas
vendor: 4,110 bytes, line 1
1h:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}},99888:function(e,t){var i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+i.source+n.source+"*(?::"+i.source+n.source+"*)?$");function s(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,s)}function a(){}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,i,n,r,s){function a(e,t,n){e in i.attributeNames&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}for(var o,u=++t,l=0;;){var h=e.charAt(u);switch(h){case"=":if(1===l)o=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(s.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!((u=e.indexOf(h,t))>0))throw new Error("attribute value no end '"+h+"' match");a(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t),s.warning('attribute "'+o+'" missed start quot('+h+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:i.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,i.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==l&&i.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:i.setTagName(e.slice(t,u));
vendor: 4,767 bytes, line 1
1case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,u)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===l&&(d=o),4==l?(s.warning('attribute "'+d+'" missed quot(")!'),a(o,d.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===n[""]&&d.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"\x80":h=" ";default:if(h<=" ")switch(l){case 0:i.setTagName(e.slice(t,u)),l=6;break;case 1:o=e.slice(t,u),l=2;break;case 4:var d=e.slice(t,u).replace(/&#?\w+;/g,r);s.warning('attribute "'+d+'" missed quot(")!!'),a(o,d,t);case 5:l=6}else switch(l){case 2:i.tagName;"http://www.w3.org/1999/xhtml"===n[""]&&o.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=u,l=1;break;case 5:s.warning('attribute space is required"'+o+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function l(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,u=a.value;if((f=o.indexOf(":"))>0)var l=a.prefix=o.slice(0,f),h=o.slice(f+1),d="xmlns"===l&&h;else h=o,l=null,d="xmlns"===o&&"";a.localName=h,!1!==d&&(null==r&&(r={},c(i,i={})),i[d]=r[d]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(d,u))}for(s=e.length;s--;){(l=(a=e[s]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=i[l||""]))}var f;(f=n.indexOf(":"))>0?(l=e.prefix=n.slice(0,f),h=e.localName=n.slice(f+1)):(l=null,h=e.localName=n);var p=e.uri=i[l||""];if(t.startElement(p,h,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,h,n),r)for(l in r)t.endPrefixMapping(l)}function h(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(i)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,n),r.characters(a,0,a.length),s)}return t+1}function d(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}function c(e,t){for(var i in e)t[i]=e[i]}function f(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var o=s[1][0],u=!1,l=!1;a>3&&(/^public$/i.test(s[2][0])?(u=s[3][0],l=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(l=s[3][0]));var h=s[a-1];return i.startDTD(o,u,l),i.endDTD(),h.index+h[0].length}return-1}function p(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function m(){this.attributeNames={}}s.prototype=new Error,s.prototype.name=s.name,a.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),c(t,t={}),function(e,t,i,n,r){function a(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function c(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function g(t){if(t>w){var i=e.substring(w,t).replace(/&#?\w+;/g,c);T&&_(w),n.characters(i,0,t-w),w=t}}function _(t,i){for(;t>=y&&(i=b.exec(e));)v=i.index,y=v+i[0].length,T.lineNumber++;T.columnNumber=t-v+1}var v=0,y=0,b=/.*(?:\r\n?|\n)|.*$/g,T=n.locator,S=[{currentNSMap:t}],E={},w=0;for(;;){try{var k=e.indexOf("<",w);if(k<0){if(!e.substr(w).match(/^\s*$/)){var C=n.doc,A=C.createTextNode(e.substr(w));C.appendChild(A),n.currentElement=A}return}switch(k>w&&g(k),e.charAt(k+1)){case"/":var I=e.indexOf(">",k+3),L=e.substring(k+2,I),x=S.pop();I<0?(L=e.substring(k+2).replace(/[\s<].*/,""),r.error("end tag name: "+L+" is not complete:"+x.tagName),I=k+1+L.length):L.match(/\s</)&&(L=L.replace(/[\s<].*/,""),r.error("end tag name: "+L+" maybe not complete"),I=k+1+L.length);var R=x.localNSMap,D=x.tagName==L;if(D||x.tagName&&x.tagName.toLowerCase()==L.toLowerCase()){if(n.endElement(x.uri,x.localName,L),R)for(var O in R)n.endPrefixMapping(O);D||r.fatalError("end tag name: "+L+" is not match the current start tagName:"+x.tagName)}else S.push(x);I++;break;case"?":T&&_(k),I=p(e,k,n);break;case"!":T&&_(k),I=f(e,k,n,r);break;default:T&&_(k);var P=new m,M=S[S.length-1].currentNSMap,N=(I=u(e,k,P,M,c,r),P.length);
1if(!P.closed&&d(e,I,P.tagName,E)&&(P.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),T&&N){for(var U=o(T,{}),B=0;B<N;B++){var F=P[B];_(F.offset),F.locator=o(T,{})}n.locator=U,l(P,n,M)&&S.push(P),n.locator=T}else l(P,n,M)&&S.push(P);"http://www.w3.org/1999/xhtml"!==P.uri||P.closed?I++:I=h(e,I,P.tagName,c,n)}}catch(j){if(j instanceof s)throw j;r.error("element parse error: "+j),I=-1}I>w?w=I:g(Math.max(k,w)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},m.prototype={setTagName:function(e){if(!r.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!r.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=a,t.ParseError=s},10434:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},66419:function(e,t,i){e.exports=function(){var e="1.13.1",t="object"==typeof self&&self.self===self&&self||"object"==typeof i.g&&i.g.global===i.g&&i.g||Function("return this")()||{},n=Array.prototype,r=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,a=n.push,o=n.slice,u=r.toString,l=r.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,c=Array.isArray,f=Object.keys,p=Object.create,m=h&&ArrayBuffer.isView,g=isNaN,_=isFinite,v=!{toString:null}.propertyIsEnumerable("toString"),y=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],b=Math.pow(2,53)-1;function T(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),r=0;r<i;r++)n[r]=arguments[r+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var s=Array(t+1);for(r=0;r<t;r++)s[r]=arguments[r];return s[t]=n,e.apply(this,s)}}function S(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function E(e){return void 0===e}function w(e){return!0===e||!1===e||"[object Boolean]"===u.call(e)}function k(e){var t="[object "+e+"]";return function(e){return u.call(e)===t}}var C=k("String"),A=k("Number"),I=k("Date"),L=k("RegExp"),x=k("Error"),R=k("Symbol"),D=k("ArrayBuffer"),O=k("Function"),P=t.document&&t.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof P&&(O=function(e){return"function"==typeof e||!1});var M=O,N=k("Object"),U=d&&N(new DataView(new ArrayBuffer(8))),B="undefined"!=typeof Map&&N(new Map),F=k("DataView"),j=U?function(e){return null!=e&&M(e.getInt8)&&D(e.buffer)}:F,V=c||k("Array");function H(e,t){return null!=e&&l.call(e,t)}var q=k("Arguments");!function(){q(arguments)||(q=function(e){return H(e,"callee")})}();var G=q;function W(e){return A(e)&&g(e)}function z(e){return function(){return e}}function K(e){return function(t){var i=e(t);return"number"==typeof i&&i>=0&&i<=b}}function X(e){return function(t){return null==t?void 0:t[e]}}var Z=X("byteLength"),Y=K(Z),$=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Q=h?function(e){return m?m(e)&&!j(e):Y(e)&&$.test(u.call(e))}:z(!1),J=X("length");function ee(e,t){t=function(e){for(var t={},i=e.length,n=0;n<i;++n)t[e[n]]=!0;return{contains:function(e){return t[e]},push:function(i){return t[i]=!0,e.push(i)}}}(t);var i=y.length,n=e.constructor,s=M(n)&&n.prototype||r,a="constructor";for(H(e,a)&&!t.contains(a)&&t.push(a);i--;)(a=y[i])in e&&e[a]!==s[a]&&!t.contains(a)&&t.push(a)}function te(e){if(!S(e))return[];if(f)return f(e);var t=[];for(var i in e)H(e,i)&&t.push(i);return v&&ee(e,t),t}function ie(e,t){var i=te(t),n=i.length;if(null==e)return!n;for(var r=Object(e),s=0;s<n;s++){var a=i[s];if(t[a]!==r[a]||!(a in r))return!1}return!0}function ne(e){return e instanceof ne?e:this instanceof ne?void(this._wrapped=e):new ne(e)}function re(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Z(e))}ne.VERSION=e,ne.prototype.value=function(){return this._wrapped},ne.prototype.valueOf=ne.prototype.toJSON=ne.prototype.value,ne.prototype.toString=function(){return String(this._wrapped)};var se="[object DataView]";function ae(e,t,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var r=typeof e;return("function"===r||"object"===r||"object"==typeof t)&&function e(t,i,n,r){t instanceof ne&&(t=t._wrapped),i instanceof ne&&(i=i._wrapped);var a=u.call(t);if(a!==u.call(i))return!1;if(U&&"[object Object]"==a&&j(t)){if(!j(i))return!1;a=se}switch(a){case"[object RegExp]":case"[object String]":return""+t==""+i;case"[object Number]":return+t!=+t?+i!=+i:0==+t?1/+t==1/i:+t==+i;case"[object Date]":case"[object Boolean]":return+t==+i;case"[object Symbol]":return s.valueOf.call(t)===s.valueOf.call(i);case"[object ArrayBuffer]":case se:return e(re(t),re(i),n,r)}var o="[object Array]"===a;if(!o&&Q(t)){if(Z(t)!==Z(i))return!1;if(t.buffer===i.buffer&&t.byteOffset===i.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof i)return!1;var l=t.constructor,h=i.constructor;if(l!==h&&!(M(l)&&l instanceof l&&M(h)&&h instanceof h)&&"constructor"in t&&"constructor"in i)return!1}r=r||[];for(var d=(n=n||[]).length;d--;)if(n[d]===t)return r[d]===i;if(n.push(t),r.push(i),o){if((d=t.length)!==i.length)return!1;for(;d--;)if(!ae(t[d],i[d],n,r))return!1}else{var c,f=te(t);if(d=f.length,te(i).length!==d)return!1;for(;d--;)if(!H(i,c=f[d])||!ae(t[c],i[c],n,r))return!1}return n.pop(),r.pop(),!0}(e,t,i,n)}function oe(e){if(!S(e))return[];var t=[];for(var i in e)t.push(i);return v&&ee(e,t),t}function ue(e){var t=J(e);return function(i){if(null==i)return!1;var n=oe(i);if(J(n))return!1;for(var r=0;r<t;r++)if(!M(i[e[r]]))return!1;return e!==pe||!M(i[le])}}var le="forEach",he="has",de=["clear","delete"],ce=["get",he,"set"],fe=de.concat(le,ce),pe=de.concat(ce),me=["add"].concat(de,le,he),ge=B?ue(fe):k("Map"),_e=B?ue(pe):k("WeakMap"),ve=B?ue(me):k("Set"),ye=k("WeakSet");function be(e){for(var t=te(e),i=t.length,n=Array(i),r=0;r<i;r++)n[r]=e[t[r]];return n}function Te(e){for(var t={},i=te(e),n=0,r=i.length;n<r;n++)t[e[i[n]]]=i[n];return t}function Se(e){var t=[];
vendor: 4,798 bytes, line 1
1for(var i in e)M(e[i])&&t.push(i);return t.sort()}function Ee(e,t){return function(i){var n=arguments.length;if(t&&(i=Object(i)),n<2||null==i)return i;for(var r=1;r<n;r++)for(var s=arguments[r],a=e(s),o=a.length,u=0;u<o;u++){var l=a[u];t&&void 0!==i[l]||(i[l]=s[l])}return i}}var we=Ee(oe),ke=Ee(te),Ce=Ee(oe,!0);function Ae(e){if(!S(e))return{};if(p)return p(e);var t=function(){};t.prototype=e;var i=new t;return t.prototype=null,i}function Ie(e){return S(e)?V(e)?e.slice():we({},e):e}function Le(e){return V(e)?e:[e]}function xe(e){return ne.toPath(e)}function Re(e,t){for(var i=t.length,n=0;n<i;n++){if(null==e)return;e=e[t[n]]}return i?e:void 0}function De(e,t,i){var n=Re(e,xe(t));return E(n)?i:n}function Oe(e){return e}function Pe(e){return e=ke({},e),function(t){return ie(t,e)}}function Me(e){return e=xe(e),function(t){return Re(t,e)}}function Ne(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,r){return e.call(t,i,n,r)};case 4:return function(i,n,r,s){return e.call(t,i,n,r,s)}}return function(){return e.apply(t,arguments)}}function Ue(e,t,i){return null==e?Oe:M(e)?Ne(e,t,i):S(e)&&!V(e)?Pe(e):Me(e)}function Be(e,t){return Ue(e,t,1/0)}function Fe(e,t,i){return ne.iteratee!==Be?ne.iteratee(e,t):Ue(e,t,i)}function je(){}function Ve(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ne.toPath=Le,ne.iteratee=Be;var He=Date.now||function(){return(new Date).getTime()};function qe(e){var t=function(t){return e[t]},i="(?:"+te(e).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(r,t):e}}var Ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},We=qe(Ge),ze=qe(Te(Ge)),Ke=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Xe=/(.)^/,Ze={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ye=/\\|'|\r|\n|\u2028|\u2029/g;function $e(e){return"\\"+Ze[e]}var Qe=/^\s*(\w|\$)+\s*$/,Je=0;function et(e,t,i,n,r){if(!(n instanceof t))return e.apply(i,r);var s=Ae(e.prototype),a=e.apply(s,r);return S(a)?a:s}var tt=T((function(e,t){var i=tt.placeholder,n=function(){for(var r=0,s=t.length,a=Array(s),o=0;o<s;o++)a[o]=t[o]===i?arguments[r++]:t[o];for(;r<arguments.length;)a.push(arguments[r++]);return et(e,n,this,this,a)};return n}));tt.placeholder=ne;var it=T((function(e,t,i){if(!M(e))throw new TypeError("Bind must be called on a function");var n=T((function(r){return et(e,n,t,this,i.concat(r))}));return n})),nt=K(J);function rt(e,t,i,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var r=n.length,s=0,a=J(e);s<a;s++){var o=e[s];if(nt(o)&&(V(o)||G(o)))if(t>1)rt(o,t-1,i,n),r=n.length;else for(var u=0,l=o.length;u<l;)n[r++]=o[u++];else i||(n[r++]=o)}return n}var st=T((function(e,t){var i=(t=rt(t,!1,!1)).length;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;){var n=t[i];e[n]=it(e[n],e)}return e})),at=T((function(e,t,i){return setTimeout((function(){return e.apply(null,i)}),t)})),ot=tt(at,ne,1);function ut(e){return function(){return!e.apply(this,arguments)}}function lt(e,t){var i;return function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}}var ht=tt(lt,2);function dt(e,t,i){t=Fe(t,i);for(var n,r=te(e),s=0,a=r.length;s<a;s++)if(t(e[n=r[s]],n,e))return n}function ct(e){return function(t,i,n){i=Fe(i,n);for(var r=J(t),s=e>0?0:r-1;s>=0&&s<r;s+=e)if(i(t[s],s,t))return s;return-1}}var ft=ct(1),pt=ct(-1);function mt(e,t,i,n){for(var r=(i=Fe(i,n,1))(t),s=0,a=J(e);s<a;){var o=Math.floor((s+a)/2);i(e[o])<r?s=o+1:a=o}return s}function gt(e,t,i){return function(n,r,s){var a=0,u=J(n);if("number"==typeof s)e>0?a=s>=0?s:Math.max(s+u,a):u=s>=0?Math.min(s+1,u):s+u+1;else if(i&&s&&u)return n[s=i(n,r)]===r?s:-1;if(r!=r)return(s=t(o.call(n,a,u),W))>=0?s+a:-1;for(s=e>0?a:u-1;s>=0&&s<u;s+=e)if(n[s]===r)return s;return-1}}var _t=gt(1,ft,mt),vt=gt(-1,pt);function yt(e,t,i){var n=(nt(e)?ft:dt)(e,t,i);if(void 0!==n&&-1!==n)return e[n]}function bt(e,t,i){var n,r;if(t=Ne(t,i),nt(e))for(n=0,r=e.length;n<r;n++)t(e[n],n,e);else{var s=te(e);for(n=0,r=s.length;n<r;n++)t(e[s[n]],s[n],e)}return e}function Tt(e,t,i){t=Fe(t,i);for(var n=!nt(e)&&te(e),r=(n||e).length,s=Array(r),a=0;a<r;a++){var o=n?n[a]:a;s[a]=t(e[o],o,e)}return s}function St(e){var t=function(t,i,n,r){var s=!nt(t)&&te(t),a=(s||t).length,o=e>0?0:a-1;for(r||(n=t[s?s[o]:o],o+=e);o>=0&&o<a;o+=e){var u=s?s[o]:o;n=i(n,t[u],u,t)}return n};return function(e,i,n,r){var s=arguments.length>=3;return t(e,Ne(i,r,4),n,s)}}var Et=St(1),wt=St(-1);function kt(e,t,i){var n=[];return t=Fe(t,i),bt(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n}function Ct(e,t,i){t=Fe(t,i);for(var n=!nt(e)&&te(e),r=(n||e).length,s=0;s<r;s++){var a=n?n[s]:s;
vendor: 8,987 bytes, line 1
1if(!t(e[a],a,e))return!1}return!0}function At(e,t,i){t=Fe(t,i);for(var n=!nt(e)&&te(e),r=(n||e).length,s=0;s<r;s++){var a=n?n[s]:s;if(t(e[a],a,e))return!0}return!1}function It(e,t,i,n){return nt(e)||(e=be(e)),("number"!=typeof i||n)&&(i=0),_t(e,t,i)>=0}var Lt=T((function(e,t,i){var n,r;return M(t)?r=t:(t=xe(t),n=t.slice(0,-1),t=t[t.length-1]),Tt(e,(function(e){var s=r;if(!s){if(n&&n.length&&(e=Re(e,n)),null==e)return;s=e[t]}return null==s?s:s.apply(e,i)}))}));function xt(e,t){return Tt(e,Me(t))}function Rt(e,t,i){var n,r,s=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,u=(e=nt(e)?e:be(e)).length;o<u;o++)null!=(n=e[o])&&n>s&&(s=n);else t=Fe(t,i),bt(e,(function(e,i,n){((r=t(e,i,n))>a||r===-1/0&&s===-1/0)&&(s=e,a=r)}));return s}function Dt(e,t,i){if(null==t||i)return nt(e)||(e=be(e)),e[Ve(e.length-1)];var n=nt(e)?Ie(e):be(e),r=J(n);t=Math.max(Math.min(t,r),0);for(var s=r-1,a=0;a<t;a++){var o=Ve(a,s),u=n[a];n[a]=n[o],n[o]=u}return n.slice(0,t)}function Ot(e,t){return function(i,n,r){var s=t?[[],[]]:{};return n=Fe(n,r),bt(i,(function(t,r){var a=n(t,r,i);e(s,t,a)})),s}}var Pt=Ot((function(e,t,i){H(e,i)?e[i].push(t):e[i]=[t]})),Mt=Ot((function(e,t,i){e[i]=t})),Nt=Ot((function(e,t,i){H(e,i)?e[i]++:e[i]=1})),Ut=Ot((function(e,t,i){e[i?0:1].push(t)}),!0),Bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ft(e,t,i){return t in i}var jt=T((function(e,t){var i={},n=t[0];if(null==e)return i;M(n)?(t.length>1&&(n=Ne(n,t[1])),t=oe(e)):(n=Ft,t=rt(t,!1,!1),e=Object(e));for(var r=0,s=t.length;r<s;r++){var a=t[r],o=e[a];n(o,a,e)&&(i[a]=o)}return i})),Vt=T((function(e,t){var i,n=t[0];return M(n)?(n=ut(n),t.length>1&&(i=t[1])):(t=Tt(rt(t,!1,!1),String),n=function(e,i){return!It(t,i)}),jt(e,n,i)}));function Ht(e,t,i){return o.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))}function qt(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[0]:Ht(e,e.length-t)}function Gt(e,t,i){return o.call(e,null==t||i?1:t)}var Wt=T((function(e,t){return t=rt(t,!0,!0),kt(e,(function(e){return!It(t,e)}))})),zt=T((function(e,t){return Wt(e,t)}));function Kt(e,t,i,n){w(t)||(n=i,i=t,t=!1),null!=i&&(i=Fe(i,n));for(var r=[],s=[],a=0,o=J(e);a<o;a++){var u=e[a],l=i?i(u,a,e):u;t&&!i?(a&&s===l||r.push(u),s=l):i?It(s,l)||(s.push(l),r.push(u)):It(r,u)||r.push(u)}return r}var Xt=T((function(e){return Kt(rt(e,!0,!0))}));function Zt(e){for(var t=e&&Rt(e,J).length||0,i=Array(t),n=0;n<t;n++)i[n]=xt(e,n);return i}var Yt=T(Zt);function $t(e,t){return e._chain?ne(t).chain():t}function Qt(e){return bt(Se(e),(function(t){var i=ne[t]=e[t];ne.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),$t(this,i.apply(ne,e))}})),ne}bt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=n[e];ne.prototype[e]=function(){var i=this._wrapped;return null!=i&&(t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0]),$t(this,i)}})),bt(["concat","join","slice"],(function(e){var t=n[e];ne.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),$t(this,e)}}));var Jt=Qt({__proto__:null,VERSION:e,restArguments:T,isObject:S,isNull:function(e){return null===e},isUndefined:E,isBoolean:w,isElement:function(e){return!(!e||1!==e.nodeType)},isString:C,isNumber:A,isDate:I,isRegExp:L,isError:x,isSymbol:R,isArrayBuffer:D,isDataView:j,isArray:V,isFunction:M,isArguments:G,isFinite:function(e){return!R(e)&&_(e)&&!isNaN(parseFloat(e))},isNaN:W,isTypedArray:Q,isEmpty:function(e){if(null==e)return!0;var t=J(e);return"number"==typeof t&&(V(e)||C(e)||G(e))?0===t:0===J(te(e))},isMatch:ie,isEqual:function(e,t){return ae(e,t)},isMap:ge,isWeakMap:_e,isSet:ve,isWeakSet:ye,keys:te,allKeys:oe,values:be,pairs:function(e){for(var t=te(e),i=t.length,n=Array(i),r=0;r<i;r++)n[r]=[t[r],e[t[r]]];return n},invert:Te,functions:Se,methods:Se,extend:we,extendOwn:ke,assign:ke,defaults:Ce,create:function(e,t){var i=Ae(e);return t&&ke(i,t),i},clone:Ie,tap:function(e,t){return t(e),e},get:De,has:function(e,t){for(var i=(t=xe(t)).length,n=0;n<i;n++){var r=t[n];if(!H(e,r))return!1;e=e[r]}return!!i},mapObject:function(e,t,i){t=Fe(t,i);for(var n=te(e),r=n.length,s={},a=0;a<r;a++){var o=n[a];s[o]=t(e[o],o,e)}return s},identity:Oe,constant:z,noop:je,toPath:Le,property:Me,propertyOf:function(e){return null==e?je:function(t){return De(e,t)}},matcher:Pe,matches:Pe,times:function(e,t,i){var n=Array(Math.max(0,e));t=Ne(t,i,1);for(var r=0;r<e;r++)n[r]=t(r);return n},random:Ve,now:He,escape:We,unescape:ze,templateSettings:Ke,template:function(e,t,i){!t&&i&&(t=i),t=Ce({},t,ne.templateSettings);var n=RegExp([(t.escape||Xe).source,(t.interpolate||Xe).source,(t.evaluate||Xe).source].join("|")+"|$","g"),r=0,s="__p+='";e.replace(n,(function(t,i,n,a,o){return s+=e.slice(r,o).replace(Ye,$e),r=o+t.length,i?s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(s+="';\n"+a+"\n__p+='"),t})),s+="';\n";var a,o=t.variable;if(o){if(!Qe.test(o))throw new Error("variable is not a bare identifier: "+o)}else s="with(obj||{}){\n"+s+"}\n",o="obj";s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{a=new Function(o,"_",s)}catch(e){throw e.source=s,e}var u=function(e){return a.call(this,e,ne)};return u.source="function("+o+"){\n"+s+"}",u},result:function(e,t,i){var n=(t=xe(t)).length;if(!n)return M(i)?i.call(e):i;for(var r=0;r<n;r++){var s=null==e?void 0:e[t[r]];void 0===s&&(s=i,r=n),e=M(s)?s.call(e):s}return e},uniqueId:function(e){var t=++Je+"";return e?e+t:t},chain:function(e){var t=ne(e);return t._chain=!0,t},iteratee:Be,partial:tt,bind:it,bindAll:st,memoize:function(e,t){var i=function(n){var r=i.cache,s=""+(t?t.apply(this,arguments):n);return H(r,s)||(r[s]=e.apply(this,arguments)),r[s]};return i.cache={},i},delay:at,defer:ot,throttle:function(e,t,i){var n,r,s,a,o=0;i||(i={});var u=function(){o=!1===i.leading?0:He(),n=null,a=e.apply(r,s),n||(r=s=null)},l=function(){var l=He();o||!1!==i.leading||(o=l);var h=t-(l-o);return r=this,s=arguments,h<=0||h>t?(n&&(clearTimeout(n),n=null),o=l,a=e.apply(r,s),n||(r=s=null)):n||!1===i.trailing||(n=setTimeout(u,h)),a};return l.cancel=function(){clearTimeout(n),o=0,n=r=s=null},l},debounce:function(e,t,i){var n,r,s,a,o,u=function(){var l=He()-r;t>l?n=setTimeout(u,t-l):(n=null,i||(a=e.apply(o,s)),n||(s=o=null))},l=T((function(l){return o=this,s=l,r=He(),n||(n=setTimeout(u,t),i&&(a=e.apply(o,s))),a}));return l.cancel=function(){clearTimeout(n),n=s=o=null},l},wrap:function(e,t){return tt(t,e)},negate:ut,compose:function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:lt,once:ht,findKey:dt,findIndex:ft,findLastIndex:pt,sortedIndex:mt,indexOf:_t,lastIndexOf:vt,find:yt,detect:yt,findWhere:function(e,t){return yt(e,Pe(t))},each:bt,forEach:bt,map:Tt,collect:Tt,reduce:Et,foldl:Et,inject:Et,reduceRight:wt,foldr:wt,filter:kt,select:kt,reject:function(e,t,i){return kt(e,ut(Fe(t)),i)},every:Ct,all:Ct,some:At,any:At,contains:It,includes:It,include:It,invoke:Lt,pluck:xt,where:function(e,t){return kt(e,Pe(t))},max:Rt,min:function(e,t,i){var n,r,s=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,u=(e=nt(e)?e:be(e)).length;o<u;o++)null!=(n=e[o])&&n<s&&(s=n);else t=Fe(t,i),bt(e,(function(e,i,n){((r=t(e,i,n))<a||r===1/0&&s===1/0)&&(s=e,a=r)}));return s},shuffle:function(e){return Dt(e,1/0)},sample:Dt,sortBy:function(e,t,i){var n=0;return t=Fe(t,i),xt(Tt(e,(function(e,i,r){return{value:e,index:n++,criteria:t(e,i,r)}})).sort((function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return e.index-t.index})),"value")},groupBy:Pt,indexBy:Mt,countBy:Nt,partition:Ut,toArray:function(e){return e?V(e)?o.call(e):C(e)?e.match(Bt):nt(e)?Tt(e,Oe):be(e):[]},size:function(e){return null==e?0:nt(e)?e.length:te(e).length},pick:jt,omit:Vt,first:qt,head:qt,take:qt,initial:Ht,last:function(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[e.length-1]:Gt(e,Math.max(0,e.length-t))},rest:Gt,tail:Gt,drop:Gt,compact:function(e){return kt(e,Boolean)},flatten:function(e,t){return rt(e,t,!1)},without:zt,uniq:Kt,unique:Kt,union:Xt,intersection:function(e){for(var t=[],i=arguments.length,n=0,r=J(e);n<r;n++){var s=e[n];if(!It(t,s)){var a;for(a=1;a<i&&It(arguments[a],s);a++);a===i&&t.push(s)}}return t},difference:Wt,unzip:Zt,transpose:Zt,zip:Yt,object:function(e,t){for(var i={},n=0,r=J(e);n<r;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},range:function(e,t,i){null==t&&(t=e||0,e=0),i||(i=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/i),0),r=Array(n),s=0;s<n;s++,e+=i)r[s]=e;return r},chunk:function(e,t){if(null==t||t<1)return[];for(var i=[],n=0,r=e.length;n<r;)i.push(o.call(e,n,n+=t));return i},mixin:Qt,default:ne});return Jt._=Jt,Jt}()}}]);

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