403Webshell
Server IP : 172.67.187.206  /  Your IP : 162.159.115.41
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Inetpub/www/myschool/triamudom/tuprblearn/media/player/videojs/amd/build/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Inetpub/www/myschool/triamudom/tuprblearn/media/player/videojs/amd/build/video-lazy.min.js
function _typeof(e){if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}(function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define ("media_videojs/video-lazy",["./window","./document"],t):(e=e||self,e.videojs=t(e.window,e.document))})(this,function(e,t){e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;var ht=[],_t=function(t,a){return function(r,n,i){var s=a.levels[n],o=new RegExp("^("+s+")$");if("log"!==r){i.unshift(r.toUpperCase()+":")}i.unshift(t+":");if(ht){ht.push([].concat(i))}if(!e.console){return}var l=e.console[r];if(!l&&"debug"===r){l=e.console.info||e.console.log}if(!l||!s||!o.test(r)){return}l[Array.isArray(i)?"apply":"call"](e.console,i)}};function a(e){var t="info",r,n=function(){for(var e=arguments.length,a=Array(e),n=0;n<e;n++){a[n]=arguments[n]}r("log",t,a)};r=_t(e,n);n.createLogger=function(t){return a(e+": "+t)};n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};n.level=function(e){if("string"==typeof e){if(!n.levels.hasOwnProperty(e)){throw new Error("\""+e+"\" in not a valid log level")}t=e}return t};n.history=function(){return ht?[].concat(ht):[]};n.history.filter=function(e){return(ht||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})};n.history.clear=function(){if(ht){ht.length=0}};n.history.disable=function(){if(null!==ht){ht.length=0;ht=null}};n.history.enable=function(){if(null===ht){ht=[]}};n.error=function(){for(var e=arguments.length,a=Array(e),n=0;n<e;n++){a[n]=arguments[n]}return r("error",t,a)};n.warn=function(){for(var e=arguments.length,a=Array(e),n=0;n<e;n++){a[n]=arguments[n]}return r("warn",t,a)};n.debug=function(){for(var e=arguments.length,a=Array(e),n=0;n<e;n++){a[n]=arguments[n]}return r("debug",t,a)};return n}var ft=a("VIDEOJS"),bt=ft.createLogger,Tt=Object.prototype.toString,vt=function(e){return o(e)?Object.keys(e):[]};function r(e,t){vt(e).forEach(function(a){return t(e[a],a)})}function n(e,t,a){if(void 0===a){a=0}return vt(e).reduce(function(a,r){return t(a,e[r],r)},a)}function s(e){for(var t=arguments.length,a=Array(1<t?t-1:0),n=1;n<t;n++){a[n-1]=arguments[n]}if(Object.assign){return Object.assign.apply(Object,[e].concat(a))}a.forEach(function(t){if(!t){return}r(t,function(t,a){e[a]=t})});return e}function o(e){return!!e&&"object"===_typeof(e)}function l(e){return o(e)&&"[object Object]"===Tt.call(e)&&e.constructor===Object}function d(t,a){if(!t||!a){return""}if("function"==typeof e.getComputedStyle){var r=e.getComputedStyle(t);return r?r.getPropertyValue(a)||r[a]:""}return""}function p(e){return"string"==typeof e&&/\S/.test(e)}function u(e){if(/\s/.test(e)){throw new Error("class has illegal whitespace characters")}}function c(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function m(){return t===e.document}function g(e){return o(e)&&1===e.nodeType}function y(){try{return e.parent!==e.self}catch(e){return!0}}function h(e){return function(a,r){if(!p(a)){return t[e](null)}if(p(r)){r=t.querySelector(r)}var n=g(r)?r:t;return n[e]&&n[e](a)}}function _(e,a,r,n){if(void 0===e){e="div"}if(void 0===a){a={}}if(void 0===r){r={}}var i=t.createElement(e);Object.getOwnPropertyNames(a).forEach(function(e){var t=a[e];if(-1!==e.indexOf("aria-")||"role"===e||"type"===e){ft.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\n"+("createEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."));i.setAttribute(e,t)}else if("textContent"===e){f(i,t)}else{i[e]=t}});Object.getOwnPropertyNames(r).forEach(function(e){i.setAttribute(e,r[e])});if(n){N(i,n)}return i}function f(e,t){if("undefined"==typeof e.textContent){e.innerText=t}else{e.textContent=t}return e}function b(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function T(e,t){u(t);if(e.classList){return e.classList.contains(t)}return c(t).test(e.className)}function v(e,t){if(e.classList){e.classList.add(t)}else if(!T(e,t)){e.className=(e.className+" "+t).trim()}return e}function S(e,t){if(e.classList){e.classList.remove(t)}else{u(t);e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")}return e}function k(e,t,a){var r=T(e,t);if("function"==typeof a){a=a(e,t)}if("boolean"!=typeof a){a=!r}if(a===r){return}if(a){v(e,t)}else{S(e,t)}return e}function C(e,t){Object.getOwnPropertyNames(t).forEach(function(a){var r=t[a];if(null===r||"undefined"==typeof r||!1===r){e.removeAttribute(a)}else{e.setAttribute(a,!0===r?"":r)}})}function E(e){var t={};if(e&&e.attributes&&0<e.attributes.length){for(var a=e.attributes,r=a.length-1;0<=r;r--){var n=a[r].name,s=a[r].value;if("boolean"==typeof e[n]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+n+",")){s=null!==s?!0:!1}t[n]=s}}return t}function P(e,t){return e.getAttribute(t)}function I(e,t,a){e.setAttribute(t,a)}function L(e,t){e.removeAttribute(t)}function x(){t.body.focus();t.onselectstart=function(){return!1}}function A(){t.onselectstart=function(){return!0}}function D(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),a={};["bottom","height","left","right","top","width"].forEach(function(e){if(t[e]!==void 0){a[e]=t[e]}});if(!a.height){a.height=parseFloat(d(e,"height"))}if(!a.width){a.width=parseFloat(d(e,"width"))}return a}}function w(a){var r;if(a.getBoundingClientRect&&a.parentNode){r=a.getBoundingClientRect()}if(!r){return{left:0,top:0}}var n=t.documentElement,i=t.body,s=n.clientLeft||i.clientLeft||0,o=e.pageXOffset||i.scrollLeft,l=r.left+o-s,d=n.clientTop||i.clientTop||0,p=e.pageYOffset||i.scrollTop,u=r.top+p-d;return{left:Math.round(l),top:Math.round(u)}}function O(e,t){var a={},r=w(e),n=e.offsetWidth,i=e.offsetHeight,s=r.top,o=r.left,l=t.pageY,d=t.pageX;if(t.changedTouches){d=t.changedTouches[0].pageX;l=t.changedTouches[0].pageY}a.y=Math.max(0,Math.min(1,(s-l+i)/i));a.x=Math.max(0,Math.min(1,(d-o)/n));return a}function R(e){return o(e)&&3===e.nodeType}function U(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function M(e){if("function"==typeof e){e=e()}return(Array.isArray(e)?e:[e]).map(function(e){if("function"==typeof e){e=e()}if(g(e)||R(e)){return e}if("string"==typeof e&&/\S/.test(e)){return t.createTextNode(e)}}).filter(function(e){return e})}function N(e,t){M(t).forEach(function(t){return e.appendChild(t)});return e}function B(e,t){return N(U(e),t)}function j(e){if(e.button===void 0&&e.buttons===void 0){return!0}if(0===e.button&&e.buttons===void 0){return!0}if("mouseup"===e.type&&0===e.button&&0===e.buttons){return!0}if(0!==e.button||1!==e.buttons){return!1}return!0}var St=h("querySelector"),$=h("querySelectorAll"),kt=Object.freeze({isReal:m,isEl:g,isInFrame:y,createEl:_,textContent:f,prependTo:b,hasClass:T,addClass:v,removeClass:S,toggleClass:k,setAttributes:C,getAttributes:E,getAttribute:P,setAttribute:I,removeAttribute:L,blockTextSelection:x,unblockTextSelection:A,getBoundingClientRect:D,findPosition:w,getPointerPosition:O,isTextNode:R,emptyEl:U,normalizeContent:M,appendContent:N,insertContent:B,isSingleLeftClick:j,$:St,$$:$}),Ct=!1,Et,Pt=function(){if(!m()||!1===Et.options.autoSetup){return}var a=Array.prototype.slice.call(t.getElementsByTagName("video")),r=Array.prototype.slice.call(t.getElementsByTagName("audio")),n=Array.prototype.slice.call(t.getElementsByTagName("video-js")),s=a.concat(r,n);if(s&&0<s.length){for(var o=0,l=s.length,e;o<l;o++){e=s[o];if(e&&e.getAttribute){if(e.player===void 0){var d=e.getAttribute("data-setup");if(null!==d){Et(e)}}}else{F(1);break}}}else if(!Ct){F(1)}};function F(t,a){if(a){Et=a}e.setTimeout(Pt,t)}function H(){Ct=!0;e.removeEventListener("load",H)}if(m()){if("complete"===t.readyState){H()}else{e.addEventListener("load",H)}}var It=function(e){var a=t.createElement("style");a.className=e;return a},Lt=function(e,t){if(e.styleSheet){e.styleSheet.cssText=t}else{e.textContent=t}},xt=new WeakMap,At=3;function q(){return At++}function V(e,t){if(!xt.has(e)){return}var a=xt.get(e);if(0===a.handlers[t].length){delete a.handlers[t];if(e.removeEventListener){e.removeEventListener(t,a.dispatcher,!1)}else if(e.detachEvent){e.detachEvent("on"+t,a.dispatcher)}}if(0>=Object.getOwnPropertyNames(a.handlers).length){delete a.handlers;delete a.dispatcher;delete a.disabled}if(0===Object.getOwnPropertyNames(a).length){xt["delete"](e)}}function W(e,t,a,r){a.forEach(function(a){e(t,a,r)})}function z(a){function r(){return!0}function n(){return!1}if(!a||!a.isPropagationStopped){var i=a||e.event;a={};for(var s in i){if("layerX"!=s&&"layerY"!=s&&"keyLocation"!=s&&"webkitMovementX"!=s&&"webkitMovementY"!=s){if(!("returnValue"==s&&i.preventDefault)){a[s]=i[s]}}}if(!a.target){a.target=a.srcElement||t}if(!a.relatedTarget){a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement}a.preventDefault=function(){if(i.preventDefault){i.preventDefault()}a.returnValue=!1;i.returnValue=!1;a.defaultPrevented=!0};a.defaultPrevented=!1;a.stopPropagation=function(){if(i.stopPropagation){i.stopPropagation()}a.cancelBubble=!0;i.cancelBubble=!0;a.isPropagationStopped=r};a.isPropagationStopped=n;a.stopImmediatePropagation=function(){if(i.stopImmediatePropagation){i.stopImmediatePropagation()}a.isImmediatePropagationStopped=r;a.stopPropagation()};a.isImmediatePropagationStopped=n;if(null!==a.clientX&&a.clientX!==void 0){var o=t.documentElement,l=t.body;a.pageX=a.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0);a.pageY=a.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}a.which=a.charCode||a.keyCode;if(null!==a.button&&a.button!==void 0){a.button=1&a.button?0:4&a.button?1:2&a.button?2:0}}return a}var Dt=!1;(function(){try{var t=Object.defineProperty({},"passive",{get:function(){Dt=!0}});e.addEventListener("test",null,t);e.removeEventListener("test",null,t)}catch(t){}})();var wt=["touchstart","touchmove"];function G(e,t,a){if(Array.isArray(t)){return W(G,e,t,a)}if(!xt.has(e)){xt.set(e,{})}var r=xt.get(e);if(!r.handlers){r.handlers={}}if(!r.handlers[t]){r.handlers[t]=[]}if(!a.guid){a.guid=q()}r.handlers[t].push(a);if(!r.dispatcher){r.disabled=!1;r.dispatcher=function(t,a){if(r.disabled){return}t=z(t);var i=r.handlers[t.type];if(i){for(var s=i.slice(0),o=0,l=s.length;o<l;o++){if(t.isImmediatePropagationStopped()){break}else{try{s[o].call(e,t,a)}catch(t){ft.error(t)}}}}}}if(1===r.handlers[t].length){if(e.addEventListener){var n=!1;if(Dt&&-1<wt.indexOf(t)){n={passive:!0}}e.addEventListener(t,r.dispatcher,n)}else if(e.attachEvent){e.attachEvent("on"+t,r.dispatcher)}}}function K(e,a,r){if(!xt.has(e)){return}var i=xt.get(e);if(!i.handlers){return}if(Array.isArray(a)){return W(K,e,a,r)}var s=function(e,a){i.handlers[a]=[];V(e,a)};if(a===void 0){for(var o in i.handlers){if(Object.prototype.hasOwnProperty.call(i.handlers||{},o)){s(e,o)}}return}var t=i.handlers[a];if(!t){return}if(!r){s(e,a);return}if(r.guid){for(var l=0;l<t.length;l++){if(t[l].guid===r.guid){t.splice(l--,1)}}}V(e,a)}function Y(e,t,a){var r=xt.has(e)?xt.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t){t={type:t,target:e}}else if(!t.target){t.target=e}t=z(t);if(r.dispatcher){r.dispatcher.call(e,t,a)}if(n&&!t.isPropagationStopped()&&!0===t.bubbles){Y.call(null,n,t,a)}else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){if(!xt.has(t.target)){xt.set(t.target,{})}var i=xt.get(t.target);if(t.target[t.type]){i.disabled=!0;if("function"==typeof t.target[t.type]){t.target[t.type]()}i.disabled=!1}}return!t.defaultPrevented}function X(e,t,a){if(Array.isArray(t)){return W(X,e,t,a)}var r=function r(){K(e,t,r);a.apply(this,arguments)};r.guid=a.guid=a.guid||q();G(e,t,r)}function Q(e,t,a){var r=function r(){K(e,t,r);a.apply(this,arguments)};r.guid=a.guid=a.guid||q();G(e,t,r)}var Ot=Object.freeze({fixEvent:z,on:G,off:K,trigger:Y,one:X,any:Q}),Rt=30,Ut=function(e,t,a){if(!t.guid){t.guid=q()}var r=t.bind(e);r.guid=a?a+"_"+t.guid:t.guid;return r},Mt=function(t,a){var r=e.performance.now(),n=function(){var n=e.performance.now();if(n-r>=a){t.apply(void 0,arguments);r=n}};return n},Nt=function(t,a,r,n){if(void 0===n){n=e}var i,s=function(){n.clearTimeout(i);i=null},o=function(){var e=this,s=arguments,o=function(){i=null;o=null;if(!r){t.apply(e,s)}};if(!i&&r){t.apply(e,s)}n.clearTimeout(i);i=n.setTimeout(o,a)};o.cancel=s;return o},Bt=function(){};Bt.prototype.allowedEvents_={};Bt.prototype.on=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};G(this,e,t);this.addEventListener=a};Bt.prototype.addEventListener=Bt.prototype.on;Bt.prototype.off=function(e,t){K(this,e,t)};Bt.prototype.removeEventListener=Bt.prototype.off;Bt.prototype.one=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};X(this,e,t);this.addEventListener=a};Bt.prototype.any=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};Q(this,e,t);this.addEventListener=a};Bt.prototype.trigger=function(e){var t=e.type||e;if("string"==typeof e){e={type:t}}e=z(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}Y(this,e)};Bt.prototype.dispatchEvent=Bt.prototype.trigger;var jt;Bt.prototype.queueTrigger=function(t){var a=this;if(!jt){jt=new Map}var r=t.type||t,n=jt.get(this);if(!n){n=new Map;jt.set(this,n)}var i=n.get(r);n["delete"](r);e.clearTimeout(i);var s=e.setTimeout(function(){if(0===n.size){n=null;jt["delete"](a)}a.trigger(t)},0);n.set(r,s)};var Ft=function(e){return e instanceof Bt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Ht=function(e,t){if(Ft(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}},qt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Vt=function(e){if(!e.nodeName&&!Ft(e)){throw new Error("Invalid target; must be a DOM node or evented object.")}},Wt=function(e){if(!qt(e)){throw new Error("Invalid event type; must be a non-empty string or array.")}},zt=function(e){if("function"!=typeof e){throw new Error("Invalid listener; must be a function.")}},Gt=function(e,t){var a=3>t.length||t[0]===e||t[0]===e.eventBusEl_,r,n,i;if(a){r=e.eventBusEl_;if(3<=t.length){t.shift()}n=t[0];i=t[1]}else{r=t[0];n=t[1];i=t[2]}Vt(r);Wt(n);zt(i);i=Ut(e,i);return{isTargetingSelf:a,target:r,type:n,listener:i}},$t=function(e,t,a,r){Vt(e);if(e.nodeName){Ot[t](e,a,r)}else{e[t](a,r)}},Kt={on:function(){for(var e=this,t=arguments.length,a=Array(t),r=0;r<t;r++){a[r]=arguments[r]}var n=Gt(this,a),i=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;$t(s,"on",o,l);if(!i){var d=function(){return e.off(s,o,l)};d.guid=l.guid;var p=function(){return e.off("dispose",d)};p.guid=l.guid;$t(this,"on","dispose",d);$t(s,"on","dispose",p)}},one:function(){for(var e=this,t=arguments.length,a=Array(t),r=0;r<t;r++){a[r]=arguments[r]}var n=Gt(this,a),i=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;if(i){$t(s,"one",o,l)}else{var d=function t(){e.off(s,o,t);for(var a=arguments.length,r=Array(a),n=0;n<a;n++){r[n]=arguments[n]}l.apply(null,r)};d.guid=l.guid;$t(s,"one",o,d)}},any:function(){for(var e=this,t=arguments.length,a=Array(t),r=0;r<t;r++){a[r]=arguments[r]}var n=Gt(this,a),i=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;if(i){$t(s,"any",o,l)}else{var d=function t(){e.off(s,o,t);for(var a=arguments.length,r=Array(a),n=0;n<a;n++){r[n]=arguments[n]}l.apply(null,r)};d.guid=l.guid;$t(s,"any",o,d)}},off:function(e,t,a){if(!e||qt(e)){K(this.eventBusEl_,e,t)}else{var r=e,n=t;Vt(r);Wt(n);zt(a);a=Ut(this,a);this.off("dispose",a);if(r.nodeName){K(r,n,a);K(r,"dispose",a)}else if(Ft(r)){r.off(n,a);r.off("dispose",a)}}},trigger:function(e,t){return Y(this.eventBusEl_,e,t)}};function J(t,a){if(void 0===a){a={}}var r=a,n=r.eventBusKey;if(n){if(!t[n].nodeName){throw new Error("The eventBusKey \""+n+"\" does not refer to an element.")}t.eventBusEl_=t[n]}else{t.eventBusEl_=_("span",{className:"vjs-event-bus"})}s(t,Kt);if(t.eventedCallbacks){t.eventedCallbacks.forEach(function(e){e()})}t.on("dispose",function(){t.off();e.setTimeout(function(){t.eventBusEl_=null},0)});return t}var Yt={state:{},setState:function(e){var t=this;if("function"==typeof e){e=e()}var a;r(e,function(e,r){if(t.state[r]!==e){a=a||{};a[r]={from:t.state[r],to:e}}t.state[r]=e});if(a&&Ft(this)){this.trigger({changes:a,type:"statechanged"})}return a}};function Z(e,t){s(e,Yt);e.state=s({},e.state,t);if("function"==typeof e.handleStateChanged&&Ft(e)){e.on("statechanged",e.handleStateChanged)}return e}var Xt=function(e){if("string"!=typeof e){return e}return e.replace(/./,function(e){return e.toLowerCase()})},Qt=function(e){if("string"!=typeof e){return e}return e.replace(/./,function(e){return e.toUpperCase()})},Jt=function(e,t){return Qt(e)===Qt(t)};function ee(){for(var e={},t=arguments.length,a=Array(t),n=0;n<t;n++){a[n]=arguments[n]}a.forEach(function(t){if(!t){return}r(t,function(t,a){if(!l(t)){e[a]=t;return}if(!l(e[a])){e[a]={}}e[a]=ee(e[a],t)})});return e}var Zt=function(){function t(e,t,a){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.parentComponent_=null;this.options_=ee({},this.options_);t=this.options_=ee(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){var r=e&&e.id&&e.id()||"no_player";this.id_=r+"_component_"+q()}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(!1!==t.createEl){this.el_=this.createEl()}if(!1!==t.evented){J(this,{eventBusKey:this.el_?"el_":null})}Z(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};this.setTimeoutIds_=new Set;this.setIntervalIds_=new Set;this.rafIds_=new Set;this.clearingTimersOnDispose_=!1;if(!1!==t.initChildren){this.initChildren()}this.ready(a);if(!1!==t.reportTouchActivity){this.enableTouchActivity()}}var a=t.prototype;a.dispose=function(){this.trigger({type:"dispose",bubbles:!1});if(this.children_){for(var e=this.children_.length-1;0<=e;e--){if(this.children_[e].dispose){this.children_[e].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_)}if(xt.has(this.el_)){xt["delete"](this.el_)}this.el_=null}this.player_=null};a.player=function(){return this.player_};a.options=function(e){if(!e){return this.options_}this.options_=ee(this.options_,e);return this.options_};a.el=function(){return this.el_};a.createEl=function(e,t,a){return _(e,t,a)};a.localize=function(e,t,a){if(void 0===a){a=e}var r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),i=n&&n[r],s=r&&r.split("-")[0],o=n&&n[s],l=a;if(i&&i[e]){l=i[e]}else if(o&&o[e]){l=o[e]}if(t){l=l.replace(/\{(\d+)\}/g,function(e,a){var r=t[a-1],n=r;if("undefined"==typeof r){n=e}return n})}return l};a.contentEl=function(){return this.contentEl_||this.el_};a.id=function(){return this.id_};a.name=function(){return this.name_};a.children=function(){return this.children_};a.getChildById=function(e){return this.childIndex_[e]};a.getChild=function(e){if(!e){return}return this.childNameIndex_[e]};a.addChild=function(e,a,r){if(void 0===a){a={}}if(void 0===r){r=this.children_.length}var n,i;if("string"==typeof e){i=Qt(e);var s=a.componentClass||i;a.name=i;var o=t.getComponent(s);if(!o){throw new Error("Component "+s+" does not exist")}if("function"!=typeof o){return null}n=new o(this.player_||this,a)}else{n=e}if(n.parentComponent_){n.parentComponent_.removeChild(n)}this.children_.splice(r,0,n);n.parentComponent_=this;if("function"==typeof n.id){this.childIndex_[n.id()]=n}i=i||n.name&&Qt(n.name());if(i){this.childNameIndex_[i]=n;this.childNameIndex_[Xt(i)]=n}if("function"==typeof n.el&&n.el()){var l=this.contentEl().children,d=l[r]||null;this.contentEl().insertBefore(n.el(),d)}return n};a.removeChild=function(e){if("string"==typeof e){e=this.getChild(e)}if(!e||!this.children_){return}for(var t=!1,a=this.children_.length-1;0<=a;a--){if(this.children_[a]===e){t=!0;this.children_.splice(a,1);break}}if(!t){return}e.parentComponent_=null;this.childIndex_[e.id()]=null;this.childNameIndex_[Qt(e.name())]=null;this.childNameIndex_[Xt(e.name())]=null;var r=e.el();if(r&&r.parentNode===this.contentEl()){this.contentEl().removeChild(e.el())}};a.initChildren=function(){var e=this,a=this.options_.children;if(a){var r=this.options_,n=function(t){var a=t.name,n=t.opts;if(r[a]!==void 0){n=r[a]}if(!1===n){return}if(!0===n){n={}}n.playerOptions=e.options_.playerOptions;var i=e.addChild(a,n);if(i){e[a]=i}},i,s=t.getComponent("Tech");if(Array.isArray(a)){i=a}else{i=Object.keys(a)}i.concat(Object.keys(this.options_).filter(function(e){return!i.some(function(t){if("string"==typeof t){return e===t}return e===t.name})})).map(function(t){var r,n;if("string"==typeof t){r=t;n=a[r]||e.options_[r]||{}}else{r=t.name;n=t}return{name:r,opts:n}}).filter(function(e){var a=t.getComponent(e.opts.componentClass||Qt(e.name));return a&&!s.isTech(a)}).forEach(n)}};a.buildCSSClass=function(){return""};a.ready=function(e,t){if(void 0===t){t=!1}if(!e){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(e);return}if(t){e.call(this)}else{this.setTimeout(e,1)}};a.triggerReady=function(){this.isReady_=!0;this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[];if(e&&0<e.length){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)};a.$=function(e,t){return St(e,t||this.contentEl())};a.$$=function(e,t){return $(e,t||this.contentEl())};a.hasClass=function(e){return T(this.el_,e)};a.addClass=function(e){v(this.el_,e)};a.removeClass=function(e){S(this.el_,e)};a.toggleClass=function(e,t){k(this.el_,e,t)};a.show=function(){this.removeClass("vjs-hidden")};a.hide=function(){this.addClass("vjs-hidden")};a.lockShowing=function(){this.addClass("vjs-lock-showing")};a.unlockShowing=function(){this.removeClass("vjs-lock-showing")};a.getAttribute=function(e){return P(this.el_,e)};a.setAttribute=function(e,t){I(this.el_,e,t)};a.removeAttribute=function(e){L(this.el_,e)};a.width=function(e,t){return this.dimension("width",e,t)};a.height=function(e,t){return this.dimension("height",e,t)};a.dimensions=function(e,t){this.width(e,!0);this.height(t)};a.dimension=function(e,t,a){if(t!==void 0){if(null===t||t!==t){t=0}if(-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")){this.el_.style[e]=t}else if("auto"===t){this.el_.style[e]=""}else{this.el_.style[e]=t+"px"}if(!a){this.trigger("componentresize")}return}if(!this.el_){return 0}var r=this.el_.style[e],n=r.indexOf("px");if(-1!==n){return parseInt(r.slice(0,n),10)}return parseInt(this.el_["offset"+Qt(e)],10)};a.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e){throw new Error("currentDimension only accepts width or height value")}t=d(this.el_,e);t=parseFloat(t);if(0===t||isNaN(t)){var a="offset"+Qt(e);t=this.el_[a]}return t};a.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}};a.currentWidth=function(){return this.currentDimension("width")};a.currentHeight=function(){return this.currentDimension("height")};a.focus=function(){this.el_.focus()};a.blur=function(){this.el_.blur()};a.handleKeyDown=function(e){if(this.player_){e.stopPropagation();this.player_.handleKeyDown(e)}};a.handleKeyPress=function(e){this.handleKeyDown(e)};a.emitTapEvents=function(){var t=0,a=null,r;this.on("touchstart",function(n){if(1===n.touches.length){a={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY};t=e.performance.now();r=!0}});this.on("touchmove",function(e){if(1<e.touches.length){r=!1}else if(a){var t=e.touches[0].pageX-a.pageX,n=e.touches[0].pageY-a.pageY,i=Math.sqrt(t*t+n*n);if(i>10){r=!1}}});var n=function(){r=!1};this.on("touchleave",n);this.on("touchcancel",n);this.on("touchend",function(n){a=null;if(!0===r){var i=e.performance.now()-t;if(i<200){n.preventDefault();this.trigger("tap")}}})};a.enableTouchActivity=function(){if(!this.player()||!this.player().reportUserActivity){return}var e=Ut(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e();this.clearInterval(t);t=this.setInterval(e,250)});var a=function(){e();this.clearInterval(t)};this.on("touchmove",e);this.on("touchend",a);this.on("touchcancel",a)};a.setTimeout=function(t,a){var r=this,n;t=Ut(this,t);this.clearTimersOnDispose_();n=e.setTimeout(function(){if(r.setTimeoutIds_.has(n)){r.setTimeoutIds_["delete"](n)}t()},a);this.setTimeoutIds_.add(n);return n};a.clearTimeout=function(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_["delete"](t);e.clearTimeout(t)}return t};a.setInterval=function(t,a){t=Ut(this,t);this.clearTimersOnDispose_();var r=e.setInterval(t,a);this.setIntervalIds_.add(r);return r};a.clearInterval=function(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_["delete"](t);e.clearInterval(t)}return t};a.requestAnimationFrame=function(t){var a=this;if(!this.supportsRaf_){return this.setTimeout(t,1e3/60)}this.clearTimersOnDispose_();var r;t=Ut(this,t);r=e.requestAnimationFrame(function(){if(a.rafIds_.has(r)){a.rafIds_["delete"](r)}t()});this.rafIds_.add(r);return r};a.cancelAnimationFrame=function(t){if(!this.supportsRaf_){return this.clearTimeout(t)}if(this.rafIds_.has(t)){this.rafIds_["delete"](t);e.cancelAnimationFrame(t)}return t};a.clearTimersOnDispose_=function(){var e=this;if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=!0;this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var a=t[0],r=t[1];e[a].forEach(e[r],e)});e.clearingTimersOnDispose_=!1})};t.registerComponent=function(e,a){if("string"!=typeof e||!e){throw new Error("Illegal component name, \""+e+"\"; must be a non-empty string.")}var r=t.getComponent("Tech"),n=r&&r.isTech(a),i=t===a||t.prototype.isPrototypeOf(a.prototype);if(n||!i){var s;if(n){s="techs must be registered using Tech.registerTech()"}else{s="must be a Component subclass"}throw new Error("Illegal component, \""+e+"\"; "+s+".")}e=Qt(e);if(!t.components_){t.components_={}}var o=t.getComponent("Player");if("Player"===e&&o&&o.players){var l=o.players,d=Object.keys(l);if(l&&0<d.length&&d.map(function(e){return l[e]}).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}t.components_[e]=a;t.components_[Xt(e)]=a;return a};t.getComponent=function(e){if(!e||!t.components_){return}return t.components_[e]};return t}();Zt.prototype.supportsRaf_="function"==typeof e.requestAnimationFrame&&"function"==typeof e.cancelAnimationFrame;Zt.registerComponent("Component",Zt);function te(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function ae(e,t){ae=Object.setPrototypeOf||function(e,t){e.__proto__=t;return e};return ae(e,t)}function re(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(t){return!1}}function ne(){if(re()){ne=Reflect.construct}else{ne=function(e,t,r){var n=[null];n.push.apply(n,t);var a=Function.bind.apply(e,n),i=new a;if(r)ae(i,r.prototype);return i}}return ne.apply(null,arguments)}function ie(e){if(void 0===e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}var ea=e.navigator&&e.navigator.userAgent||"",ta=/AppleWebKit\/([\d.]+)/i.exec(ea),aa=ta?parseFloat(ta.pop()):null,ra=/iPad/i.test(ea),na=/iPhone/i.test(ea)&&!ra,ia=/iPod/i.test(ea),sa=na||ra||ia,oa=function(){var e=ea.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}(),la=/Android/i.test(ea),da=function(){var e=ea.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}var t=e[1]&&parseFloat(e[1]),a=e[2]&&parseFloat(e[2]);if(t&&a){return parseFloat(e[1]+"."+e[2])}else if(t){return t}return null}(),pa=la&&5>da&&537>aa,ua=/Firefox/i.test(ea),ca=/Edge/i.test(ea),ma=!ca&&(/Chrome/i.test(ea)||/CriOS/i.test(ea)),ga=function(){var e=ea.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}(),ya=function(){var e=/MSIE\s(\d+)\.\d/.exec(ea),t=e&&parseFloat(e[1]);return"7.6.5"}(),ha=/Safari/i.test(ea)&&!ma&&!la&&!ca,_a=(ha||sa)&&!ma,fa=/Windows/i.test(ea),ba=m()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch),Ta=Object.freeze({IS_IPAD:ra,IS_IPHONE:na,IS_IPOD:ia,IS_IOS:sa,IOS_VERSION:oa,IS_ANDROID:la,ANDROID_VERSION:da,IS_NATIVE_ANDROID:pa,IS_FIREFOX:ua,IS_EDGE:ca,IS_CHROME:ma,CHROME_VERSION:ga,IE_VERSION:ya,IS_SAFARI:ha,IS_ANY_SAFARI:_a,IS_WINDOWS:fa,TOUCH_ENABLED:ba});function se(e,t,a){if("number"!=typeof t||0>t||t>a){throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+a+").")}}function oe(e,t,a,r){se(e,r,a.length-1);return a[r][t]}function le(e){if(e===void 0||0===e.length){return{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}}return{length:e.length,start:oe.bind(null,"start",0,e),end:oe.bind(null,"end",1,e)}}function de(e,t){if(Array.isArray(e)){return le(e)}else if(e===void 0||t===void 0){return le()}return le([[e,t]])}function pe(e,t){var a=0,r,n;if(!t){return 0}if(!e||!e.length){e=de(0,0)}for(var s=0;s<e.length;s++){r=e.start(s);n=e.end(s);if(n>t){n=t}a+=n-r}return a/t}for(var va={prefixed:!0},Sa=[["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"]],ka=Sa[0],Ca,Ea=0;Ea<Sa.length;Ea++){if(Sa[Ea][1]in t){Ca=Sa[Ea];break}}if(Ca){for(var Pa=0;Pa<Ca.length;Pa++){va[ka[Pa]]=Ca[Pa]}va.prefixed=Ca[0]!==ka[0]}function ue(e){if(e instanceof ue){return e}if("number"==typeof e){this.code=e}else if("string"==typeof e){this.message=e}else if(o(e)){if("number"==typeof e.code){this.code=e.code}s(this,e)}if(!this.message){this.message=ue.defaultMessages[this.code]||""}}ue.prototype.code=0;ue.prototype.message="";ue.prototype.status=null;ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ue.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 Ia=0;Ia<ue.errorTypes.length;Ia++){ue[ue.errorTypes[Ia]]=Ia;ue.prototype[ue.errorTypes[Ia]]=Ia}var La=function(e,t){var a,r=null;try{a=JSON.parse(e,t)}catch(e){r=e}return[r,a]};function ce(e){return e!==void 0&&null!==e&&"function"==typeof e.then}function me(e){if(ce(e)){e.then(null,function(){})}}var xa=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,a){if(e[a]){t[a]=e[a]}return 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}})});return t},Aa={textTracksToJson:function(e){var t=e.$$("track"),a=Array.prototype.map.call(t,function(e){return e.track}),r=Array.prototype.map.call(t,function(e){var t=xa(e.track);if(e.src){t.src=e.src}return t});return r.concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===a.indexOf(e)}).map(xa))},jsonToTextTracks:function(e,t){e.forEach(function(e){var a=t.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(function(e){return a.addCue(e)})}});return t.textTracks()},trackToJson_:xa};function ge(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Da=ge(function(e,t){function a(e){if(e&&"object"===_typeof(e)){var t=e.which||e.keyCode||e.charCode;if(t)e=t}if("number"==typeof e)return o[e];var a=e+"",i=r[a.toLowerCase()];if(i)return i;var i=n[a.toLowerCase()];if(i)return i;if(1===a.length)return a.charCodeAt(0)}a.isEventKey=function(e,t){if(e&&"object"===_typeof(e)){var a=e.which||e.keyCode||e.charCode;if(null===a||a===void 0){return!1}if("string"==typeof t){var i=r[t.toLowerCase()];if(i){return i===a}var i=n[t.toLowerCase()];if(i){return i===a}}else if("number"==typeof t){return t===a}return!1}};t=e.exports=a;var r=t.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},n=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":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;123>s;s++){r[String.fromCharCode(s)]=s-32}for(var s=48;58>s;s++){r[s-48]=s}for(s=1;13>s;s++){r["f"+s]=s+111}for(s=0;10>s;s++){r["numpad "+s]=s+96}var o=t.names=t.title={};for(s in r){o[r[s]]=s}for(var l in n){r[l]=n[l]}}),wa=Da.code,Oa=Da.codes,Ra=Da.aliases,Ua=Da.names,Ma=Da.title,Na="vjs-modal-dialog",Ba=function(a){te(r,a);function r(e,t){var r=a.call(this,e,t)||this;r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1;r.closeable(!r.options_.uncloseable);r.content(r.options_.content);r.contentEl_=_("div",{className:Na+"-content"},{role:"document"});r.descEl_=_("p",{className:Na+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")});f(r.descEl_,r.description());r.el_.appendChild(r.descEl_);r.el_.appendChild(r.contentEl_);return r}var n=r.prototype;n.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})};n.dispose=function(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;a.prototype.dispose.call(this)};n.buildCSSClass=function(){return Na+" vjs-hidden "+a.prototype.buildCSSClass.call(this)};n.label=function(){return this.localize(this.options_.label||"Modal Window")};n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e};n.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen");this.opened_=!0;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown);this.hadControls_=e.controls();e.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=!0}};n.opened=function(e){if("boolean"==typeof e){this[e?"open":"close"]()}return this.opened_};n.close=function(){if(!this.opened_){return}var e=this.player();this.trigger("beforemodalclose");this.opened_=!1;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown);if(this.hadControls_){e.controls(!0)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}};n.closeable=function e(t){if("boolean"==typeof t){var e=this.closeable_=!!t,a=this.getChild("closeButton");if(e&&!a){var r=this.contentEl_;this.contentEl_=this.el_;a=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=r;this.on(a,"close",this.close)}if(!e&&a){this.off(a,"close",this.close);this.removeChild(a);a.dispose()}}return this.closeable_};n.fill=function(){this.fillWith(this.content())};n.fillWith=function(e){var t=this.contentEl(),a=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;a.removeChild(t);this.empty();B(t,e);this.trigger("modalfill");if(r){a.insertBefore(t,r)}else{a.appendChild(t)}var n=this.getChild("closeButton");if(n){a.appendChild(n.el_)}};n.empty=function(){this.trigger("beforemodalempty");U(this.contentEl());this.trigger("modalempty")};n.content=function(e){if("undefined"!=typeof e){this.content_=e}return this.content_};n.conditionalFocus_=function(){var e=t.activeElement,a=this.player_.el_;this.previouslyActiveEl_=null;if(a.contains(e)||a===e){this.previouslyActiveEl_=e;this.focus()}};n.conditionalBlur_=function(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}};n.handleKeyDown=function(e){e.stopPropagation();if(Da.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!Da.isEventKey(e,"Tab")){return}for(var a=this.focusableEls_(),r=this.el_.querySelector(":focus"),n,s=0;s<a.length;s++){if(r===a[s]){n=s;break}}if(t.activeElement===this.el_){n=0}if(e.shiftKey&&0===n){a[a.length-1].focus();e.preventDefault()}else if(!e.shiftKey&&n===a.length-1){a[0].focus();e.preventDefault()}};n.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,function(t){return(t instanceof e.HTMLAnchorElement||t instanceof e.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof e.HTMLInputElement||t instanceof e.HTMLSelectElement||t instanceof e.HTMLTextAreaElement||t instanceof e.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof e.HTMLIFrameElement||t instanceof e.HTMLObjectElement||t instanceof e.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")})};return r}(Zt);Ba.prototype.options_={pauseOnOpen:!0,temporary:!0};Zt.registerComponent("ModalDialog",Ba);var ja=function(e){te(t,e);function t(t){var a;if(void 0===t){t=[]}a=e.call(this)||this;a.tracks_=[];Object.defineProperty(ie(a),"length",{get:function(){return this.tracks_.length}});for(var r=0;r<t.length;r++){a.addTrack(t[r])}return a}var a=t.prototype;a.addTrack=function(e){var t=this.tracks_.length;if(!(""+t in this)){Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}})}if(-1===this.tracks_.indexOf(e)){this.tracks_.push(e);this.trigger({track:e,type:"addtrack",target:this})}};a.removeTrack=function(e){for(var t,a=0,r=this.length;a<r;a++){if(this[a]===e){t=this[a];if(t.off){t.off()}this.tracks_.splice(a,1);break}}if(!t){return}this.trigger({track:t,type:"removetrack",target:this})};a.getTrackById=function(e){for(var t=null,a=0,r=this.length,n;a<r;a++){n=this[a];if(n.id===e){t=n;break}}return t};return t}(Bt);ja.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var Fa in ja.prototype.allowedEvents_){ja.prototype["on"+Fa]=null}var Ha=function(e,t){for(var a=0;a<e.length;a++){if(!Object.keys(e[a]).length||t.id===e[a].id){continue}e[a].enabled=!1}},qa=function(e){te(t,e);function t(t){var a;if(void 0===t){t=[]}for(var r=t.length-1;0<=r;r--){if(t[r].enabled){Ha(t,t[r]);break}}a=e.call(this,t)||this;a.changing_=!1;return a}var a=t.prototype;a.addTrack=function(t){var a=this;if(t.enabled){Ha(this,t)}e.prototype.addTrack.call(this,t);if(!t.addEventListener){return}t.enabledChange_=function(){if(a.changing_){return}a.changing_=!0;Ha(a,t);a.changing_=!1;a.trigger("change")};t.addEventListener("enabledchange",t.enabledChange_)};a.removeTrack=function(t){e.prototype.removeTrack.call(this,t);if(t.removeEventListener&&t.enabledChange_){t.removeEventListener("enabledchange",t.enabledChange_);t.enabledChange_=null}};return t}(ja),Va=function(e,t){for(var a=0;a<e.length;a++){if(!Object.keys(e[a]).length||t.id===e[a].id){continue}e[a].selected=!1}},Wa=function(e){te(t,e);function t(t){var a;if(void 0===t){t=[]}for(var r=t.length-1;0<=r;r--){if(t[r].selected){Va(t,t[r]);break}}a=e.call(this,t)||this;a.changing_=!1;Object.defineProperty(ie(a),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++){if(this[e].selected){return e}}return-1},set:function(){}});return a}var a=t.prototype;a.addTrack=function(t){var a=this;if(t.selected){Va(this,t)}e.prototype.addTrack.call(this,t);if(!t.addEventListener){return}t.selectedChange_=function(){if(a.changing_){return}a.changing_=!0;Va(a,t);a.changing_=!1;a.trigger("change")};t.addEventListener("selectedchange",t.selectedChange_)};a.removeTrack=function(t){e.prototype.removeTrack.call(this,t);if(t.removeEventListener&&t.selectedChange_){t.removeEventListener("selectedchange",t.selectedChange_);t.selectedChange_=null}};return t}(ja),za=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.addTrack=function(t){var a=this;e.prototype.addTrack.call(this,t);if(!this.queueChange_){this.queueChange_=function(){return a.queueTrigger("change")}}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=function(){return a.trigger("selectedlanguagechange")}}t.addEventListener("modechange",this.queueChange_);if(-1===["metadata","chapters"].indexOf(t.kind)){t.addEventListener("modechange",this.triggerSelectedlanguagechange_)}};a.removeTrack=function(t){e.prototype.removeTrack.call(this,t);if(t.removeEventListener){if(this.queueChange_){t.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){t.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}};return t}(ja),Ga=function(){function e(e){if(void 0===e){e=[]}this.trackElements_=[];Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,a=e.length;t<a;t++){this.addTrackElement_(e[t])}}var t=e.prototype;t.addTrackElement_=function(e){var t=this.trackElements_.length;if(!(""+t in this)){Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}})}if(-1===this.trackElements_.indexOf(e)){this.trackElements_.push(e)}};t.getTrackElementByTrack_=function(e){for(var t,a=0,r=this.trackElements_.length;a<r;a++){if(e===this.trackElements_[a].track){t=this.trackElements_[a];break}}return t};t.removeTrackElement_=function(e){for(var t=0,a=this.trackElements_.length;t<a;t++){if(e===this.trackElements_[t]){if(this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off){this.trackElements_[t].track.off()}if("function"==typeof this.trackElements_[t].off){this.trackElements_[t].off()}this.trackElements_.splice(t,1);break}}};return e}(),$a=function(){function e(t){e.prototype.setCues_.call(this,t);Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;t.setCues_=function(e){var t=this.length||0,a=0,r=e.length;this.cues_=e;this.length_=e.length;var n=function(e){if(!(""+e in this)){Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})}};if(t<r){a=t;for(;a<r;a++){n.call(this,a)}}};t.getCueById=function(e){for(var t=null,a=0,r=this.length,n;a<r;a++){n=this[a];if(n.id===e){t=n;break}}return t};return e}(),Ka={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Ya={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Xa={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Qa={disabled:"disabled",hidden:"hidden",showing:"showing"},Ja=function(e){te(t,e);function t(t){var a;if(void 0===t){t={}}a=e.call(this)||this;var r={id:t.id||"vjs_track_"+q(),kind:t.kind||"",label:t.label||"",language:t.language||""},n=function(e){Object.defineProperty(ie(a),e,{get:function(){return r[e]},set:function(){}})};for(var i in r){n(i)}return a}return t}(Bt),Za=function(r){var n=["protocol","hostname","port","pathname","search","hash","host"],s=t.createElement("a");s.href=r;var o=""===s.host&&"file:"!==s.protocol,l;if(o){l=t.createElement("div");l.innerHTML="<a href=\""+r+"\"></a>";s=l.firstChild;l.setAttribute("style","display:none; position:absolute;");t.body.appendChild(l)}for(var d={},p=0;p<n.length;p++){d[n[p]]=s[n[p]]}if("http:"===d.protocol){d.host=d.host.replace(/:80$/,"")}if("https:"===d.protocol){d.host=d.host.replace(/:443$/,"")}if(!d.protocol){d.protocol=e.location.protocol}if(o){t.body.removeChild(l)}return d},er=function(e){if(!e.match(/^https?:\/\//)){var a=t.createElement("div");a.innerHTML="<a href=\""+e+"\">x</a>";e=a.firstChild.href}return e},tr=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,a=t.exec(e);if(a){return a.pop().toLowerCase()}}return""},ar=function(t){var a=e.location,r=Za(t),n=":"===r.protocol?a.protocol:r.protocol,i=n+r.host!==a.protocol+a.host;return i},rr=Object.freeze({parseUrl:Za,getAbsoluteURL:er,getFileExtension:tr,isCrossOrigin:ar}),nr=function(e){var t=ir.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},ir=Object.prototype.toString;var sr=Array.prototype.slice,or=Object.prototype.toString,lr=function(e){var t=this;if("function"!=typeof t||or.call(t)!=="[object Function]"){throw new TypeError("Function.prototype.bind called on incompatible "+t)}for(var a=sr.call(arguments,1),r,n=function(){if(this instanceof r){var n=t.apply(this,a.concat(sr.call(arguments)));if(Object(n)===n){return n}return this}else{return t.apply(e,a.concat(sr.call(arguments)))}},s=Math.max(0,t.length-a.length),o=[],l=0;l<s;l++){o.push("$"+l)}r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(n);if(t.prototype){var d=function(){};d.prototype=t.prototype;r.prototype=new d;d.prototype=null}return r},dr=Function.prototype.bind||lr,pr=Object.prototype.toString,ur=function(e){var t=pr.call(e),a="[object Arguments]"===t;if(!a){a="[object Array]"!==t&&null!==e&&"object"===_typeof(e)&&"number"==typeof e.length&&0<=e.length&&"[object Function]"===pr.call(e.callee)}return a},cr;if(!Object.keys){var mr=Object.prototype.hasOwnProperty,gr=Object.prototype.toString,yr=ur,hr=Object.prototype.propertyIsEnumerable,_r=!hr.call({toString:null},"toString"),fr=hr.call(function(){},"prototype"),br=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Tr=function(e){var t=e.constructor;return t&&t.prototype===e},vr={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Sr=function(){if("undefined"==typeof window){return!1}for(var e in window){try{if(!vr["$"+e]&&mr.call(window,e)&&null!==window[e]&&"object"===_typeof(window[e])){try{Tr(window[e])}catch(t){return!0}}}catch(t){return!0}}return!1}(),kr=function(e){if("undefined"==typeof window||!Sr){return Tr(e)}try{return Tr(e)}catch(t){return!1}};cr=function(e){var t=null!==e&&"object"===_typeof(e),a="[object Function]"===gr.call(e),r=yr(e),n=t&&"[object String]"===gr.call(e),s=[];if(!t&&!a&&!r){throw new TypeError("Object.keys called on a non-object")}if(n&&0<e.length&&!mr.call(e,0)){for(var o=0;o<e.length;++o){s.push(o+"")}}if(r&&0<e.length){for(var l=0;l<e.length;++l){s.push(l+"")}}else{for(var d in e){if(!(fr&&a&&"prototype"==d)&&mr.call(e,d)){s.push(d+"")}}}if(_r){for(var p=kr(e),u=0;u<br.length;++u){if(!(p&&"constructor"===br[u])&&mr.call(e,br[u])){s.push(br[u])}}}return s}}var Cr=cr,Er=Array.prototype.slice,Pr=Object.keys,Ir=Pr?function(e){return Pr(e)}:Cr,Lr=Object.keys;Ir.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);if(!e){Object.keys=function(e){if(ur(e)){return Lr(Er.call(e))}return Lr(e)}}}else{Object.keys=Ir}return Object.keys||Ir};var xr="function"==typeof Symbol&&"symbol"===_typeof(Symbol("foo")),Ar=Object.prototype.toString,Dr=Array.prototype.concat,wr=Object.defineProperty,Or=function(e){return"function"==typeof e&&"[object Function]"===Ar.call(e)},Rr=wr&&function(){var e={};try{wr(e,"x",{enumerable:!1,value:e});for(var t in e){return!1}return e.x===e}catch(t){return!1}}(),Ur=function(e,t,a,r){if(t in e&&(!Or(r)||!r())){return}if(Rr){wr(e,t,{configurable:!0,enumerable:!1,value:a,writable:!0})}else{e[t]=a}},Mr=function(e,t){var a=2<arguments.length?arguments[2]:{},r=Ir(t);if(xr){r=Dr.call(r,Object.getOwnPropertySymbols(t))}for(var n=0;n<r.length;n+=1){Ur(e,r[n],t[r[n]],a[r[n]])}};Mr.supportsDescriptors=!!Rr;var Nr=Mr,Br,jr=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},Fr="function"==typeof Symbol&&"symbol"===_typeof(Symbol.iterator),Hr=Object.getPrototypeOf||function(e){return e.__proto__},qr="undefined"==typeof Uint8Array?Br:Hr(Uint8Array),Vr={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?Br:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?Br:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":Fr?Hr([][Symbol.iterator]()):Br,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":Br,"$ %AsyncFunction%":Br,"$ %AsyncFunctionPrototype%":Br,"$ %AsyncGenerator%":Br,"$ %AsyncGeneratorFunction%":Br,"$ %AsyncGeneratorPrototype%":Br,"$ %AsyncIteratorPrototype%":Br,"$ %Atomics%":"undefined"==typeof Atomics?Br:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?Br:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?Br:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?Br:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?Br:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?Br:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?Br:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":Br,"$ %GeneratorFunction%":Br,"$ %GeneratorPrototype%":Br,"$ %Int8Array%":"undefined"==typeof Int8Array?Br:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?Br:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?Br:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?Br:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?Br:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?Br:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":Fr?Hr(Hr([][Symbol.iterator]())):Br,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?Br:Map,"$ %MapIteratorPrototype%":"undefined"==typeof Map||!Fr?Br:Hr(new Map()[Symbol.iterator]()),"$ %MapPrototype%":"undefined"==typeof Map?Br:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?Br:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?Br:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?Br:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?Br:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?Br:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?Br:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?Br:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?Br:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?Br:Set,"$ %SetIteratorPrototype%":"undefined"==typeof Set||!Fr?Br:Hr(new Set()[Symbol.iterator]()),"$ %SetPrototype%":"undefined"==typeof Set?Br:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Br:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?Br:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":Fr?Hr(""[Symbol.iterator]()):Br,"$ %StringPrototype%":String.prototype,"$ %Symbol%":Fr?Symbol:Br,"$ %SymbolPrototype%":Fr?Symbol.prototype:Br,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":jr,"$ %TypedArray%":qr,"$ %TypedArrayPrototype%":qr?qr.prototype:Br,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?Br:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?Br:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Br:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?Br:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?Br:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?Br:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?Br:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?Br:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?Br:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?Br:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?Br:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?Br:WeakSet.prototype},Wr=function(e,t){if(1<arguments.length&&"boolean"!=typeof t){throw new TypeError("\"allowMissing\" argument must be a boolean")}var a="$ "+e;if(!(a in Vr)){throw new SyntaxError("intrinsic "+e+" does not exist!")}if("undefined"==typeof Vr[a]&&!t){throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!")}return Vr[a]},zr=dr.call(Function.call,Object.prototype.hasOwnProperty),Gr=Wr("%TypeError%"),$r=Wr("%SyntaxError%"),Kr={"Property Descriptor":function(e,t){if("Object"!==e.Type(t)){return!1}var a={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t){if(zr(t,r)&&!a[r]){return!1}}var n=zr(t,"[[Value]]"),i=zr(t,"[[Get]]")||zr(t,"[[Set]]");if(n&&i){throw new Gr("Property Descriptors may not be both accessor and data descriptors")}return!0}},Yr=function(e,t,a,r){var n=Kr[t];if("function"!=typeof n){throw new $r("unknown record type: "+t)}if(!n(e,r)){throw new Gr(a+" must be a "+t)}console.log(n(e,r),r)},Xr=Number.isNaN||function(e){return e!==e},Qr=Number.isNaN||function(e){return e!==e},Jr=Number.isFinite||function(e){return"number"==typeof e&&!Qr(e)&&e!==1/0&&e!==-Infinity},Zr=function(e){return 0<=e?1:-1},en=function(e,t){var a=e%t;return Math.floor(0<=a?a:a+t)},tn=Function.prototype.toString,an=/^\s*class\b/,rn=function(e){try{var t=tn.call(e);return an.test(t)}catch(t){return!1}},nn=function(e){try{if(rn(e)){return!1}tn.call(e);return!0}catch(t){return!1}},sn=Object.prototype.toString,on="function"==typeof Symbol&&"symbol"===_typeof(Symbol.toStringTag),ln=function(e){if(!e){return!1}if("function"!=typeof e&&"object"!==_typeof(e)){return!1}if("function"==typeof e&&!e.prototype){return!0}if(on){return nn(e)}if(rn(e)){return!1}var t=sn.call(e);return t==="[object Function]"||t==="[object GeneratorFunction]"},dn=function(e){return null===e||"function"!=typeof e&&"object"!==_typeof(e)},pn=Object.prototype.toString,un={"[[DefaultValue]]":function(e){var t;if(1<arguments.length){t=arguments[1]}else{t="[object Date]"===pn.call(e)?String:Number}if(t===String||t===Number){var a=t===String?["toString","valueOf"]:["valueOf","toString"],r,n;for(n=0;n<a.length;++n){if(ln(e[a[n]])){r=e[a[n]]();if(dn(r)){return r}}}throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")}},cn=Wr("%Object%"),mn=Wr("%TypeError%"),gn=Wr("%String%"),yn={ToPrimitive:function(e){if(dn(e)){return e}if(1<arguments.length){return un["[[DefaultValue]]"](e,arguments[1])}return un["[[DefaultValue]]"](e)},ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);if(Xr(t)){return 0}if(0===t||!Jr(t)){return t}return Zr(t)*Math.floor(Math.abs(t))},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(Xr(t)||0===t||!Jr(t)){return 0}var a=Zr(t)*Math.floor(Math.abs(t));return en(a,65536)},ToString:function(e){return gn(e)},ToObject:function(e){this.CheckObjectCoercible(e);return cn(e)},CheckObjectCoercible:function(e,t){if(null==e){throw new mn(t||"Cannot call method on "+e)}return e},IsCallable:ln,SameValue:function(e,t){if(e===t){if(0===e){return 1/e==1/t}return!0}return Xr(e)&&Xr(t)},Type:function(e){if(null===e){return"Null"}if("undefined"==typeof e){return"Undefined"}if("function"==typeof e||"object"===_typeof(e)){return"Object"}if("number"==typeof e){return"Number"}if("boolean"==typeof e){return"Boolean"}if("string"==typeof e){return"String"}},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e)){return!1}var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var a in e){if(zr(e,a)&&!t[a]){return!1}}var r=zr(e,"[[Value]]"),n=zr(e,"[[Get]]")||zr(e,"[[Set]]");if(r&&n){throw new mn("Property Descriptors may not be both accessor and data descriptors")}return!0},IsAccessorDescriptor:function(e){if("undefined"==typeof e){return!1}Yr(this,"Property Descriptor","Desc",e);if(!zr(e,"[[Get]]")&&!zr(e,"[[Set]]")){return!1}return!0},IsDataDescriptor:function(e){if("undefined"==typeof e){return!1}Yr(this,"Property Descriptor","Desc",e);if(!zr(e,"[[Value]]")&&!zr(e,"[[Writable]]")){return!1}return!0},IsGenericDescriptor:function(e){if("undefined"==typeof e){return!1}Yr(this,"Property Descriptor","Desc",e);if(!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e)){return!0}return!1},FromPropertyDescriptor:function(e){if("undefined"==typeof e){return e}Yr(this,"Property Descriptor","Desc",e);if(this.IsDataDescriptor(e)){return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]}}else if(this.IsAccessorDescriptor(e)){return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]}}else{throw new mn("FromPropertyDescriptor must be called with a fully populated Property Descriptor")}},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e)){throw new mn("ToPropertyDescriptor requires an object")}var t={};if(zr(e,"enumerable")){t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)}if(zr(e,"configurable")){t["[[Configurable]]"]=this.ToBoolean(e.configurable)}if(zr(e,"value")){t["[[Value]]"]=e.value}if(zr(e,"writable")){t["[[Writable]]"]=this.ToBoolean(e.writable)}if(zr(e,"get")){var a=e.get;if("undefined"!=typeof a&&!this.IsCallable(a)){throw new TypeError("getter must be a function")}t["[[Get]]"]=a}if(zr(e,"set")){var r=e.set;if("undefined"!=typeof r&&!this.IsCallable(r)){throw new mn("setter must be a function")}t["[[Set]]"]=r}if((zr(t,"[[Get]]")||zr(t,"[[Set]]"))&&(zr(t,"[[Value]]")||zr(t,"[[Writable]]"))){throw new mn("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute")}return t}},hn=dr.call(Function.call,String.prototype.replace),_n=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,fn=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,bn=function(){var e=yn.ToString(yn.CheckObjectCoercible(this));return hn(hn(e,_n,""),fn,"")},Tn="\u200B",vn=function(){if(String.prototype.trim&&Tn.trim()===Tn){return String.prototype.trim}return bn},Sn=dr.call(Function.call,vn());Nr(Sn,{getPolyfill:vn,implementation:bn,shim:function(){var e=vn();Nr(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}});return e}});var kn=Sn,Cn=Object.prototype.toString,En=Object.prototype.hasOwnProperty,Pn=function(e,t,a){for(var r=0,n=e.length;r<n;r++){if(En.call(e,r)){if(null==a){t(e[r],r,e)}else{t.call(a,e[r],r,e)}}}},In=function(e,t,a){for(var r=0,n=e.length;r<n;r++){if(null==a){t(e.charAt(r),r,e)}else{t.call(a,e.charAt(r),r,e)}}},Ln=function(e,t,a){for(var r in e){if(En.call(e,r)){if(null==a){t(e[r],r,e)}else{t.call(a,e[r],r,e)}}}},xn=function(e,t,a){if(!ln(t)){throw new TypeError("iterator must be a function")}var r;if(3<=arguments.length){r=a}if("[object Array]"===Cn.call(e)){Pn(e,t,r)}else if("string"==typeof e){In(e,t,r)}else{Ln(e,t,r)}},An=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Dn=function(e){if(!e)return{};var t={};xn(kn(e).split("\n"),function(e){var a=e.indexOf(":"),r=kn(e.slice(0,a)).toLowerCase(),n=kn(e.slice(a+1));if("undefined"==typeof t[r]){t[r]=n}else if(An(t[r])){t[r].push(n)}else{t[r]=[t[r],n]}});return t},wn=Object.prototype.hasOwnProperty;function ye(){for(var e={},t=0,a;t<arguments.length;t++){a=arguments[t];for(var r in a){if(wn.call(a,r)){e[r]=a[r]}}}return e}var On=be;be.XMLHttpRequest=e.XMLHttpRequest||function(){};be.XDomainRequest="withCredentials"in new be.XMLHttpRequest?be.XMLHttpRequest:e.XDomainRequest;he(["get","put","post","patch","head","delete"],function(e){be["delete"===e?"del":e]=function(t,a,r){a=fe(t,a,r);a.method=e.toUpperCase();return Te(a)}});function he(e,t){for(var a=0;a<e.length;a++){t(e[a])}}function _e(e){for(var t in e){if(e.hasOwnProperty(t))return!1}return!0}function fe(e,t,a){var r=e;if(nr(t)){a=t;if("string"==typeof e){r={uri:e}}}else{r=ye(t,{uri:e})}r.callback=a;return r}function be(e,t,a){t=fe(e,t,a);return Te(t)}function Te(e){if("undefined"==typeof e.callback){throw new Error("callback argument missing")}var i=!1,s=function(t,a,r){if(!i){i=!0;e.callback(t,a,r)}};function t(){if(4===o.readyState){setTimeout(n,0)}}function a(){var e;if(o.response){e=o.response}else{e=o.responseText||ve(o)}if(y){try{e=JSON.parse(e)}catch(t){}}return e}function r(e){clearTimeout(h);if(!(e instanceof Error)){e=new Error(""+(e||"Unknown XMLHttpRequest Error"))}e.statusCode=0;return s(e,_)}function n(){if(d)return;var t;clearTimeout(h);if(e.useXDR&&o.status===void 0){t=200}else{t=1223===o.status?204:o.status}var r=_,n=null;if(0!==t){r={body:a(),statusCode:t,method:u,headers:{},url:p,rawRequest:o};if(o.getAllResponseHeaders){r.headers=Dn(o.getAllResponseHeaders())}}else{n=new Error("Internal XMLHttpRequest Error")}return s(n,r,r.body)}var o=e.xhr||null;if(!o){if(e.cors||e.useXDR){o=new be.XDomainRequest}else{o=new be.XMLHttpRequest}}var l,d,p=o.url=e.uri||e.url,u=o.method=e.method||"GET",c=e.body||e.data,m=o.headers=e.headers||{},g=!!e.sync,y=!1,h,_={body:void 0,headers:{},statusCode:0,method:u,url:p,rawRequest:o};if("json"in e&&!1!==e.json){y=!0;m.accept||m.Accept||(m.Accept="application/json");if("GET"!==u&&"HEAD"!==u){m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json");c=JSON.stringify(!0===e.json?c:e.json)}}o.onreadystatechange=t;o.onload=n;o.onerror=r;o.onprogress=function(){};o.onabort=function(){d=!0};o.ontimeout=r;o.open(u,p,!g,e.username,e.password);if(!g){o.withCredentials=!!e.withCredentials}if(!g&&0<e.timeout){h=setTimeout(function(){if(d)return;d=!0;o.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT";r(t)},e.timeout)}if(o.setRequestHeader){for(l in m){if(m.hasOwnProperty(l)){o.setRequestHeader(l,m[l])}}}else if(e.headers&&!_e(e.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in e){o.responseType=e.responseType}if("beforeSend"in e&&"function"==typeof e.beforeSend){e.beforeSend(o)}o.send(c||null);return o}function ve(e){if("document"===e.responseType){return e.responseXML}var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t){return e.responseXML}return null}var Rn=function(t,a){var r=new e.WebVTT.Parser(e,e.vttjs,e.WebVTT.StringDecoder()),n=[];r.oncue=function(e){a.addCue(e)};r.onparsingerror=function(e){n.push(e)};r.onflush=function(){a.trigger({type:"loadeddata",target:a})};r.parse(t);if(0<n.length){if(e.console&&e.console.groupCollapsed){e.console.groupCollapsed("Text Track parsing errors for "+a.src)}n.forEach(function(e){return ft.error(e)});if(e.console&&e.console.groupEnd){e.console.groupEnd()}}r.flush()},Un=function(t,a){var r={uri:t},n=ar(t);if(n){r.cors=n}On(r,Ut(this,function(t,r,n){if(t){return ft.error(t,r)}a.loaded_=!0;if("function"!=typeof e.WebVTT){if(a.tech_){a.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"===e.type){ft.error("vttjs failed to load, stopping trying to process "+a.src);return}return Rn(n,a)})}}else{Rn(n,a)}}))},Mn=function(t){te(a,t);function a(e){var a;if(void 0===e){e={}}if(!e.tech){throw new Error("A tech was not provided.")}var r=ee(e,{kind:Xa[e.kind]||"subtitles",language:e.language||e.srclang||""}),n=Qa[r.mode]||"disabled",i=r["default"];if("metadata"===r.kind||"chapters"===r.kind){n="hidden"}a=t.call(this,r)||this;a.tech_=r.tech;a.cues_=[];a.activeCues_=[];var s=new $a(a.cues_),o=new $a(a.activeCues_),d=!1,p=Ut(ie(a),function(){this.activeCues=this.activeCues;if(d){this.trigger("cuechange");d=!1}});if("disabled"!==n){a.tech_.ready(function(){a.tech_.on("timeupdate",p)},!0)}Object.defineProperties(ie(a),{default:{get:function(){return i},set:function(){}},mode:{get:function(){return n},set:function(e){var t=this;if(!Qa[e]){return}n=e;if("disabled"!==n){this.tech_.ready(function(){t.tech_.on("timeupdate",p)},!0)}else{this.tech_.off("timeupdate",p)}this.trigger("modechange")}},cues:{get:function(){if(!this.loaded_){return null}return s},set:function(){}},activeCues:{get:function(){if(!this.loaded_){return null}if(0===this.cues.length){return o}for(var e=this.tech_.currentTime(),t=[],a=0,r=this.cues.length,n;a<r;a++){n=this.cues[a];if(n.startTime<=e&&n.endTime>=e){t.push(n)}else if(n.startTime===n.endTime&&n.startTime<=e&&n.startTime+.5>=e){t.push(n)}}d=!1;if(t.length!==this.activeCues_.length){d=!0}else{for(var s=0;s<t.length;s++){if(-1===this.activeCues_.indexOf(t[s])){d=!0}}}this.activeCues_=t;o.setCues_(this.activeCues_);return o},set:function(){}}});if(r.src){a.src=r.src;Un(r.src,ie(a))}else{a.loaded_=!0}return a}var r=a.prototype;r.addCue=function(t){var a=t;if(e.vttjs&&!(t instanceof e.vttjs.VTTCue)){a=new e.vttjs.VTTCue(t.startTime,t.endTime,t.text);for(var r in t){if(!(r in a)){a[r]=t[r]}}a.id=t.id;a.originalCue_=t}for(var n=this.tech_.textTracks(),s=0;s<n.length;s++){if(n[s]!==this){n[s].removeCue(a)}}this.cues_.push(a);this.cues.setCues_(this.cues_)};r.removeCue=function(e){var t=this.cues_.length;while(t--){var a=this.cues_[t];if(a===e||a.originalCue_&&a.originalCue_===e){this.cues_.splice(t,1);this.cues.setCues_(this.cues_);break}}};return a}(Ja);Mn.prototype.allowedEvents_={cuechange:"cuechange"};var Nn=function(e){te(t,e);function t(t){var a;if(void 0===t){t={}}var r=ee(t,{kind:Ya[t.kind]||""});a=e.call(this,r)||this;var n=!1;Object.defineProperty(ie(a),"enabled",{get:function(){return n},set:function(e){if("boolean"!=typeof e||e===n){return}n=e;this.trigger("enabledchange")}});if(r.enabled){a.enabled=r.enabled}a.loaded_=!0;return a}return t}(Ja),Bn=function(e){te(t,e);function t(t){var a;if(void 0===t){t={}}var r=ee(t,{kind:Ka[t.kind]||""});a=e.call(this,r)||this;var n=!1;Object.defineProperty(ie(a),"selected",{get:function(){return n},set:function(e){if("boolean"!=typeof e||e===n){return}n=e;this.trigger("selectedchange")}});if(r.selected){a.selected=r.selected}return a}return t}(Ja),jn=0,Fn=2,Hn=function(e){te(t,e);function t(t){var a;if(void 0===t){t={}}a=e.call(this)||this;var r,n=new Mn(t);a.kind=n.kind;a.src=n.src;a.srclang=n.language;a.label=n.label;a["default"]=n["default"];Object.defineProperties(ie(a),{readyState:{get:function(){return r}},track:{get:function(){return n}}});r=jn;n.addEventListener("loadeddata",function(){r=Fn;a.trigger({type:"load",target:ie(a)})});return a}return t}(Bt);Hn.prototype.allowedEvents_={load:"load"};Hn.NONE=jn;Hn.LOADING=1;Hn.LOADED=Fn;Hn.ERROR=3;var qn={audio:{ListClass:qa,TrackClass:Nn,capitalName:"Audio"},video:{ListClass:Wa,TrackClass:Bn,capitalName:"Video"},text:{ListClass:za,TrackClass:Mn,capitalName:"Text"}};Object.keys(qn).forEach(function(e){qn[e].getterName=e+"Tracks";qn[e].privateName=e+"Tracks_"});var Vn={remoteText:{ListClass:za,TrackClass:Mn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Ga,TrackClass:Hn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Wn=ee(qn,Vn);Vn.names=Object.keys(Vn);qn.names=Object.keys(qn);Wn.names=[].concat(Vn.names).concat(qn.names);var zn=Object.create||function(){function e(){}return function(t){if(1!==arguments.length){throw new Error("Object.create shim only accepts one parameter.")}e.prototype=t;return new e}}();function Se(e,t){this.name="ParsingError";this.code=e.code;this.message=t||e.message}Se.prototype=zn(Error.prototype);Se.prototype.constructor=Se;Se.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function ke(e){function t(e,t,a,r){return 3600*(0|e)+60*(0|t)+(0|a)+(0|r)/1e3}var a=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);if(!a){return null}if(a[3]){return t(a[1],a[2],a[3].replace(":",""),a[4])}else if(59<a[1]){return t(a[1],a[2],0,a[4])}else{return t(0,a[1],a[2],a[4])}}function Ce(){this.values=zn(null)}Ce.prototype={set:function(e,t){if(!this.get(e)&&""!==t){this.values[e]=t}},get:function(e,t,a){if(a){return this.has(e)?this.values[e]:t[a]}return this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var a=0;a<r.length;++a){if(t===r[a]){this.set(e,t);break}}},integer:function(e,t){if(/^-?\d+$/.test(t)){this.set(e,parseInt(t,10))}},percent:function(e,t){var a;if(a=t.match(/^([\d]{1,3})(\.[\d]*)?%$/)){t=parseFloat(t);if(0<=t&&100>=t){this.set(e,t);return!0}}return!1}};function Ee(e,t,a,r){var n=r?e.split(r):[e];for(var s in n){if("string"!=typeof n[s]){continue}var i=n[s].split(a);if(2!==i.length){continue}var o=i[0],l=i[1];t(o,l)}}function Pe(e,t,a){var s=e;function r(){var t=ke(e);if(null===t){throw new Se(Se.Errors.BadTimeStamp,"Malformed timestamp: "+s)}e=e.replace(/^[^\sa-zA-Z-]+/,"");return t}function n(e,t){var r=new Ce;Ee(e,function(e,t){switch(e){case"region":for(var n=a.length-1;0<=n;n--){if(a[n].id===t){r.set(e,a[n].region);break}}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),o=s[0];r.integer(e,o);r.percent(e,o)?r.set("snapToLines",!1):null;r.alt(e,o,["auto"]);if(2===s.length){r.alt("lineAlign",s[1],["start","middle","end"])}break;case"position":s=t.split(",");r.percent(e,s[0]);if(2===s.length){r.alt("positionAlign",s[1],["start","middle","end"])}break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"]);break;}},/:/,/\s/);t.region=r.get("region",null);t.vertical=r.get("vertical","");t.line=r.get("line","auto");t.lineAlign=r.get("lineAlign","start");t.snapToLines=r.get("snapToLines",!0);t.size=r.get("size",100);t.align=r.get("align","middle");t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align);t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}function i(){e=e.replace(/^\s+/,"")}i();t.startTime=r();i();if("-->"!==e.substr(0,3)){throw new Se(Se.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s)}e=e.substr(3);i();t.endTime=r();i();n(e,t)}var Gn={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"\u200E","&rlm;":"\u200F","&nbsp;":"\xA0"},$n={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Kn={v:"title",lang:"lang"},Yn={rt:"ruby"};function Ie(e,a){function r(){if(!a){return null}function e(e){a=a.substr(e.length);return e}var t=a.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function n(t){return Gn[t]}function i(e){while(y=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)){e=e.replace(y[0],n)}return e}function s(e,t){return!Yn[t.localName]||Yn[t.localName]===e.localName}function o(t,a){var r=$n[t];if(!r){return null}var n=e.document.createElement(r);n.localName=r;var i=Kn[t];if(i&&a){n[i]=a.trim()}return n}var l=e.document.createElement("div"),d=l,p,u=[];while(null!==(p=r())){if("<"===p[0]){if("/"===p[1]){if(u.length&&u[u.length-1]===p.substr(2).replace(">","")){u.pop();d=d.parentNode}continue}var c=ke(p.substr(1,p.length-2)),g;if(c){g=e.document.createProcessingInstruction("timestamp",c);d.appendChild(g);continue}var y=p.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y){continue}g=o(y[1],y[3]);if(!g){continue}if(!s(d,g)){continue}if(y[2]){g.className=y[2].substr(1).replace("."," ")}u.push(y[1]);d.appendChild(g);d=g;continue}d.appendChild(e.document.createTextNode(i(p)))}return l}var Xn=[[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 Le(e){for(var t=0,a;t<Xn.length;t++){a=Xn[t];if(e>=a[0]&&e<=a[1]){return!0}}return!1}function xe(e){var r=[],n="",s;if(!e||!e.childNodes){return"ltr"}function t(e,t){for(var a=t.childNodes.length-1;0<=a;a--){e.push(t.childNodes[a])}}function a(e){if(!e||!e.length){return null}var r=e.pop(),n=r.textContent||r.innerText;if(n){var i=n.match(/^.*(\n|\r)/);if(i){e.length=0;return i[0]}return n}if("ruby"===r.tagName){return a(e)}if(r.childNodes){t(e,r);return a(e)}}t(r,e);while(n=a(r)){for(var o=0;o<n.length;o++){s=n.charCodeAt(o);if(Le(s)){return"rtl"}}}return"ltr"}function Ae(e){if("number"==typeof e.line&&(e.snapToLines||0<=e.line&&100>=e.line)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}for(var t=e.track,a=t.textTrackList,r=0,n=0;n<a.length&&a[n]!==t;n++){if("showing"===a[n].mode){r++}}return-1*++r}function De(){}De.prototype.applyStyles=function(e,t){t=t||this.div;for(var a in e){if(e.hasOwnProperty(a)){t.style[a]=e[a]}}};De.prototype.formatStyle=function(e,t){return 0===e?0:e+t};function we(e,t,a){De.call(this);this.cue=t;this.cueDiv=Ie(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv);this.div=e.document.createElement("div");r={direction:xe(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:a.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(r);this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":n=t.position;break;case"middle":n=t.position-t.size/2;break;case"end":n=t.position-t.size;break;}if(""===t.vertical){this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")})}else{this.applyStyles({top:this.formatStyle(n,"%"),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")})}}we.prototype=zn(De.prototype);we.prototype.constructor=we;function Oe(e){var t,a,r,n;if(e.div){a=e.div.offsetHeight;r=e.div.offsetWidth;n=e.div.offsetTop;var i=(i=e.div.childNodes)&&(i=i[0])&&i.getClientRects&&i.getClientRects();e=e.div.getBoundingClientRect();t=i?Math.max(i[0]&&i[0].height||0,e.height/i.length):0}this.left=e.left;this.right=e.right;this.top=e.top||n;this.height=e.height||a;this.bottom=e.bottom||n+(e.height||a);this.width=e.width||r;this.lineHeight=t!==void 0?t:e.lineHeight}Oe.prototype.move=function(e,t){t=t!==void 0?t:this.lineHeight;switch(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;break;}};Oe.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top};Oe.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++){if(this.overlaps(e[t])){return!0}}return!1};Oe.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};Oe.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;}};Oe.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),a=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top));return t*a/(this.height*this.width)};Oe.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}};Oe.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,a=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var n={left:e.left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||a};return n};function Re(e,t,a,r){function n(e,t){for(var n,s=new Oe(e),o=1,l=0;l<t.length;l++){while(e.overlapsOppositeAxis(a,t[l])||e.within(a)&&e.overlapsAny(r)){e.move(t[l])}if(e.within(a)){return e}var d=e.intersectPercentage(a);if(o>d){n=new Oe(e);o=d}e=new Oe(s)}return n||s}var i=new Oe(t),s=t.cue,o=Ae(s),l=[];if(s.snapToLines){var d;switch(s.vertical){case"":l=["+y","-y"];d="height";break;case"rl":l=["+x","-x"];d="width";break;case"lr":l=["-x","+x"];d="width";break;}var p=i.lineHeight,u=p*Math.round(o),c=a[d]+p,m=l[0];if(Math.abs(u)>c){u=0>u?-1:1;u*=Math.ceil(c/p)*p}if(0>o){u+=""===s.vertical?a.height:a.width;l=l.reverse()}i.move(m,u)}else{var g=100*(i.lineHeight/a.height);switch(s.lineAlign){case"middle":o-=g/2;break;case"end":o-=g;break;}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break;}l=["+y","-x","+x","-y"];i=new Oe(t)}var y=n(i,l);t.move(y.toCSSCompatValues(a))}function Ue(){}Ue.StringDecoder=function(){return{decode:function(e){if(!e){return""}if("string"!=typeof e){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};Ue.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return Ie(e,t)};Ue.processCues=function(e,t,a){if(!e||!t||!a){return null}while(a.firstChild){a.removeChild(a.firstChild)}var n=e.document.createElement("div");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%";a.appendChild(n);function r(e){for(var t=0;t<e.length;t++){if(e[t].hasBeenReset||!e[t].displayState){return!0}}return!1}if(!r(t)){for(var s=0;s<t.length;s++){n.appendChild(t[s].displayState)}return}var o=[],l=Oe.getSimpleBoxPosition(n),d=Math.round(100*(l.height*.05))/100,p={font:d+"px "+"sans-serif"};(function(){for(var a,r,s=0;s<t.length;s++){r=t[s];a=new we(e,r,p);n.appendChild(a.div);Re(e,a,l,o);r.displayState=a.div;o.push(Oe.getSimpleBoxPosition(a))}})()};Ue.Parser=function(e,t,a){if(!a){a=t;t={}}if(!t){t={}}this.window=e;this.vttjs=t;this.state="INITIAL";this.buffer="";this.decoder=a||new TextDecoder("utf8");this.regionList=[]};Ue.Parser.prototype={reportOrThrowError:function(t){if(t instanceof Se){this.onparsingerror&&this.onparsingerror(t)}else{throw t}},parse:function(e){var i=this;if(e){i.buffer+=i.decoder.decode(e,{stream:!0})}function t(){var e=i.buffer,t=0;while(t<e.length&&"\r"!==e[t]&&"\n"!==e[t]){++t}var a=e.substr(0,t);if("\r"===e[t]){++t}if("\n"===e[t]){++t}i.buffer=e.substr(t);return a}function a(e){var t=new Ce;Ee(e,function(e,a){switch(e){case"id":t.set(e,a);break;case"width":t.percent(e,a);break;case"lines":t.integer(e,a);break;case"regionanchor":case"viewportanchor":var r=a.split(",");if(2!==r.length){break}var n=new Ce;n.percent("x",r[0]);n.percent("y",r[1]);if(!n.has("x")||!n.has("y")){break}t.set(e+"X",n.get("x"));t.set(e+"Y",n.get("y"));break;case"scroll":t.alt(e,a,["up"]);break;}},/=/,/\s/);if(t.has("id")){var a=new(i.vttjs.VTTRegion||i.window.VTTRegion);a.width=t.get("width",100);a.lines=t.get("lines",3);a.regionAnchorX=t.get("regionanchorX",0);a.regionAnchorY=t.get("regionanchorY",100);a.viewportAnchorX=t.get("viewportanchorX",0);a.viewportAnchorY=t.get("viewportanchorY",100);a.scroll=t.get("scroll","");i.onregion&&i.onregion(a);i.regionList.push({id:t.get("id"),region:a})}}function r(e){var t=new Ce;Ee(e,function(e,a){switch(e){case"MPEGT":t.integer(e+"S",a);break;case"LOCA":t.set(e+"L",ke(a));break;}},/[^\d]:/,/,/);i.ontimestampmap&&i.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}function n(e){if(e.match(/X-TIMESTAMP-MAP/)){Ee(e,function(e,t){switch(e){case"X-TIMESTAMP-MAP":r(t);break;}},/=/)}else{Ee(e,function(e,t){switch(e){case"Region":a(t);break;}},/:/)}}try{var s;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer)){return this}s=t();var o=s.match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0]){throw new Se(Se.Errors.BadSignature)}i.state="HEADER"}var l=!1;while(i.buffer){if(!/\r\n|\n/.test(i.buffer)){return this}if(!l){s=t()}else{l=!1}switch(i.state){case"HEADER":if(/:/.test(s)){n(s)}else if(!s){i.state="ID"}continue;case"NOTE":if(!s){i.state="ID"}continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){i.state="NOTE";break}if(!s){continue}i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");i.state="CUE";if(-1===s.indexOf("-->")){i.cue.id=s;continue}case"CUE":try{Pe(s,i.cue,i.regionList)}catch(t){i.reportOrThrowError(t);i.cue=null;i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var d=-1!==s.indexOf("-->");if(!s||d&&(l=!0)){i.oncue&&i.oncue(i.cue);i.cue=null;i.state="ID";continue}if(i.cue.text){i.cue.text+="\n"}i.cue.text+=s;continue;case"BADCUE":if(!s){i.state="ID"}continue;}}}catch(t){i.reportOrThrowError(t);if("CUETEXT"===i.state&&i.cue&&i.oncue){i.oncue(i.cue)}i.cue=null;i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||"HEADER"===t.state){t.buffer+="\n\n";t.parse()}if("INITIAL"===t.state){throw new Se(Se.Errors.BadSignature)}}catch(a){t.reportOrThrowError(a)}t.onflush&&t.onflush();return this}};var Qn={"":1,lr:1,rl:1},Jn={start:1,middle:1,end:1,left:1,right:1};function Me(e){if("string"!=typeof e){return!1}var t=Qn[e.toLowerCase()];return t?e.toLowerCase():!1}function Ne(e){if("string"!=typeof e){return!1}var t=Jn[e.toLowerCase()];return t?e.toLowerCase():!1}function Be(e,t,a){this.hasBeenReset=!1;var r="",n=!1,i=e,s=t,o=a,l=null,d="",p=!0,u="auto",c="start",m=50,g="middle",y=50,h="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return n},set:function(e){n=!!e}},startTime:{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e){throw new TypeError("Start time must be set to a number.")}i=e;this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e){throw new TypeError("End time must be set to a number.")}s=e;this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e;this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e;this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var t=Me(e);if(!1===t){throw new SyntaxError("An invalid or illegal string was specified.")}d=t;this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e;this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e&&e!=="auto"){throw new SyntaxError("An invalid number or illegal string was specified.")}u=e;this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return c},set:function(e){var t=Ne(e);if(!t){throw new SyntaxError("An invalid or illegal string was specified.")}c=t;this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return m},set:function(e){if(0>e||100<e){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=Ne(e);if(!t){throw new SyntaxError("An invalid or illegal string was specified.")}g=t;this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return y},set:function(e){if(0>e||100<e){throw new Error("Size must be between 0 and 100.")}y=e;this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return h},set:function(e){var t=Ne(e);if(!t){throw new SyntaxError("An invalid or illegal string was specified.")}h=t;this.hasBeenReset=!0}}});this.displayState=void 0}Be.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Zn={"":!0,up:!0};function je(e){if("string"!=typeof e){return!1}var t=Zn[e.toLowerCase()];return t?e.toLowerCase():!1}function Fe(e){return"number"==typeof e&&0<=e&&100>=e}var ei=function(){var e=100,t=3,a=0,r=100,n=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Fe(t)){throw new Error("Width must be between 0 and 100.")}e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e){throw new TypeError("Lines must be set to a number.")}t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!Fe(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}r=e}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!Fe(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}a=e}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!Fe(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}i=e}},viewportAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!Fe(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}n=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=je(e);if(!1===t){throw new SyntaxError("An invalid or illegal string was specified.")}s=t}}})},ti=ge(function(t){var a=t.exports={WebVTT:Ue,VTTCue:Be,VTTRegion:ei};e.vttjs=a;e.WebVTT=a.WebVTT;var r=a.VTTCue,n=a.VTTRegion,i=e.VTTCue,s=e.VTTRegion;a.shim=function(){e.VTTCue=r;e.VTTRegion=n};a.restore=function(){e.VTTCue=i;e.VTTRegion=s};if(!e.VTTCue){a.shim()}}),ai=ti.WebVTT,ri=ti.VTTCue,ni=ti.VTTRegion;function He(e,t,a,r,n){if(void 0===n){n={}}var i=e.textTracks();n.kind=t;if(a){n.label=a}if(r){n.language=r}n.tech=e;var s=new Wn.text.TrackClass(n);i.addTrack(s);return s}var ii=function(a){te(r,a);function r(e,t){var r;if(void 0===e){e={}}if(void 0===t){t=function(){}}e.reportTouchActivity=!1;r=a.call(this,null,e,t)||this;r.hasStarted_=!1;r.on("playing",function(){this.hasStarted_=!0});r.on("loadstart",function(){this.hasStarted_=!1});Wn.names.forEach(function(t){var a=Wn[t];if(e&&e[a.getterName]){r[a.privateName]=e[a.getterName]}});if(!r.featuresProgressEvents){r.manualProgressOn()}if(!r.featuresTimeupdateEvents){r.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(t){if(!1===e["native"+t+"Tracks"]){r["featuresNative"+t+"Tracks"]=!1}});if(!1===e.nativeCaptions||!1===e.nativeTextTracks){r.featuresNativeTextTracks=!1}else if(!0===e.nativeCaptions||!0===e.nativeTextTracks){r.featuresNativeTextTracks=!0}if(!r.featuresNativeTextTracks){r.emulateTextTracks()}r.autoRemoteTextTracks_=new Wn.text.ListClass;r.initTrackListeners();if(!e.nativeControlsForTouch){r.emitTapEvents()}if(r.constructor){r.name_=r.constructor.name||"Unknown Tech"}return r}var n=r.prototype;n.triggerSourceset=function(e){var t=this;if(!this.isReady_){this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)})}this.trigger({src:e,type:"sourceset"})};n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange);this.manualProgress=!0;this.one("ready",this.trackProgress)};n.manualProgressOff=function(){this.manualProgress=!1;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};n.trackProgress=function(){this.stopTrackingProgress();this.progressInterval=this.setInterval(Ut(this,function(){var e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(1===e){this.stopTrackingProgress()}}),500)};n.onDurationChange=function(){this.duration_=this.duration()};n.buffered=function(){return de(0,0)};n.bufferedPercent=function(){return pe(this.buffered(),this.duration_)};n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)};n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};n.trackCurrentTime=function(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)};n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})};n.dispose=function(){this.clearTracks(qn.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}a.prototype.dispose.call(this)};n.clearTracks=function(e){var t=this;e=[].concat(e);e.forEach(function(e){var a=t[e+"Tracks"]()||[],r=a.length;while(r--){var n=a[r];if("text"===e){t.removeRemoteTextTrack(n)}a.removeTrack(n)}})};n.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var a=e[t];this.removeRemoteTextTrack(a)}};n.reset=function(){};n.error=function(e){if(e!==void 0){this.error_=new ue(e);this.trigger("error")}return this.error_};n.played=function(){if(this.hasStarted_){return de(0,0)}return de()};n.setCurrentTime=function(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}};n.initTrackListeners=function(){var e=this;qn.names.forEach(function(t){var a=qn[t],r=function(){e.trigger(t+"trackchange")},n=e[a.getterName]();n.addEventListener("removetrack",r);n.addEventListener("addtrack",r);e.on("dispose",function(){n.removeEventListener("removetrack",r);n.removeEventListener("addtrack",r)})})};n.addWebVttScript_=function(){var a=this;if(e.WebVTT){return}if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&l(ti)&&0<Object.keys(ti).length){this.trigger("vttjsloaded");return}var r=t.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";r.onload=function(){a.trigger("vttjsloaded")};r.onerror=function(){a.trigger("vttjserror")};this.on("dispose",function(){r.onload=null;r.onerror=null});e.WebVTT=!0;this.el().parentNode.appendChild(r)}else{this.ready(this.addWebVttScript_)}};n.emulateTextTracks=function(){var e=this,t=this.textTracks(),a=this.remoteTextTracks(),r=function(a){return t.addTrack(a.track)},n=function(a){return t.removeTrack(a.track)};a.on("addtrack",r);a.on("removetrack",n);this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},o=function(){s();for(var e=0,a;e<t.length;e++){a=t[e];a.removeEventListener("cuechange",s);if("showing"===a.mode){a.addEventListener("cuechange",s)}}};o();t.addEventListener("change",o);t.addEventListener("addtrack",o);t.addEventListener("removetrack",o);this.on("dispose",function(){a.off("addtrack",r);a.off("removetrack",n);t.removeEventListener("change",o);t.removeEventListener("addtrack",o);t.removeEventListener("removetrack",o);for(var e=0,l;e<t.length;e++){l=t[e];l.removeEventListener("cuechange",s)}})};n.addTextTrack=function(e,t,a){if(!e){throw new Error("TextTrack kind is required but was not provided")}return He(this,e,t,a)};n.createRemoteTextTrack=function(e){var t=ee(e,{tech:this});return new Vn.remoteTextEl.TrackClass(t)};n.addRemoteTextTrack=function(e,t){var a=this;if(void 0===e){e={}}var r=this.createRemoteTextTrack(e);if(!0!==t&&!1!==t){ft.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_(r);this.remoteTextTracks().addTrack(r.track);if(!0!==t){this.ready(function(){return a.autoRemoteTextTracks_.addTrack(r.track)})}return r};n.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t);this.remoteTextTracks().removeTrack(e);this.autoRemoteTextTracks_.removeTrack(e)};n.getVideoPlaybackQuality=function(){return{}};n.requestPictureInPicture=function(){var t=this.options_.Promise||e.Promise;if(t){return t.reject()}};n.setPoster=function(){};n.playsinline=function(){};n.setPlaysinline=function(){};n.overrideNativeAudioTracks=function(){};n.overrideNativeVideoTracks=function(){};n.canPlayType=function(){return""};r.canPlayType=function(){return""};r.canPlaySource=function(e){return r.canPlayType(e.type)};r.isTech=function(e){return e.prototype instanceof r||e instanceof r||e===r};r.registerTech=function(e,t){if(!r.techs_){r.techs_={}}if(!r.isTech(t)){throw new Error("Tech "+e+" must be a Tech")}if(!r.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!r.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}e=Qt(e);r.techs_[e]=t;r.techs_[Xt(e)]=t;if("Tech"!==e){r.defaultTechOrder_.push(e)}return t};r.getTech=function(t){if(!t){return}if(r.techs_&&r.techs_[t]){return r.techs_[t]}t=Qt(t);if(e&&e.videojs&&e.videojs[t]){ft.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");return e.videojs[t]}};return r}(Zt);Wn.names.forEach(function(e){var t=Wn[e];ii.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});ii.prototype.featuresVolumeControl=!0;ii.prototype.featuresMuteControl=!0;ii.prototype.featuresFullscreenResize=!1;ii.prototype.featuresPlaybackRate=!1;ii.prototype.featuresProgressEvents=!1;ii.prototype.featuresSourceset=!1;ii.prototype.featuresTimeupdateEvents=!1;ii.prototype.featuresNativeTextTracks=!1;ii.withSourceHandlers=function(e){e.registerSourceHandler=function(t,a){var r=e.sourceHandlers;if(!r){r=e.sourceHandlers=[]}if(a===void 0){a=r.length}r.splice(a,0,t)};e.canPlayType=function(t){for(var a=e.sourceHandlers||[],r,n=0;n<a.length;n++){r=a[n].canPlayType(t);if(r){return r}}return""};e.selectSourceHandler=function(t,a){for(var r=e.sourceHandlers||[],n,s=0;s<r.length;s++){n=r[s].canHandleSource(t,a);if(n){return r[s]}}return null};e.canPlaySource=function(t,a){var r=e.selectSourceHandler(t,a);if(r){return r.canHandleSource(t,a)}return""};["seekable","seeking","duration"].forEach(function(e){var t=this[e];if("function"!=typeof t){return}this[e]=function(){if(this.sourceHandler_&&this.sourceHandler_[e]){return this.sourceHandler_[e].apply(this.sourceHandler_,arguments)}return t.apply(this,arguments)}},e.prototype);e.prototype.setSource=function(t){var a=e.selectSourceHandler(t,this.options_);if(!a){if(e.nativeSourceHandler){a=e.nativeSourceHandler}else{ft.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler);if(a!==e.nativeSourceHandler){this.currentSource_=t}this.sourceHandler_=a.handleSource(t,this,this.options_);this.one("dispose",this.disposeSourceHandler)};e.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(["audio","video"]);this.currentSource_=null}this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose()}this.sourceHandler_=null}}};Zt.registerComponent("Tech",ii);ii.registerTech("Tech",ii);ii.defaultTechOrder_=[];var si={},oi={},li={};function qe(e,t,a){e.setTimeout(function(){return Qe(t,si[t.type],a,e)},1)}function Ve(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}function We(e,t,a){return e.reduceRight($e(a),t[a]())}function ze(e,t,a,r){return t[a](e.reduce($e(a),r))}function Ge(e,t,a,r){if(void 0===r){r=null}var n="call"+Qt(a),i=e.reduce($e(n),r),s=i===li,o=s?null:t[a](i);Ke(e,a,o,s);return o}var di={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1,volume:1},pi={setCurrentTime:1,setVolume:1},ui={play:1,pause:1};function $e(e){return function(t,a){if(t===li){return li}if(a[e]){return a[e](t)}return t}}function Ke(e,t,a,r){for(var n=e.length-1,s;0<=n;n--){s=e[n];if(s[t]){s[t](r,a)}}}function Ye(e){oi[e.id()]=null}function Xe(e,t){var a=oi[e.id()],r=null;if(a===void 0||null===a){r=t(e);oi[e.id()]=[[t,r]];return r}for(var n=0;n<a.length;n++){var s=a[n],o=s[0],l=s[1];if(o!==t){continue}r=l}if(null===r){r=t(e);a.push([t,r])}return r}function Qe(e,t,a,r,n,i){if(void 0===e){e={}}if(void 0===t){t=[]}if(void 0===n){n=[]}if(void 0===i){i=!1}var o=t,l=o[0],d=o.slice(1);if("string"==typeof l){Qe(e,si[l],a,r,n,i)}else if(l){var p=Xe(r,l);if(!p.setSource){n.push(p);return Qe(e,d,a,r,n,i)}p.setSource(s({},e),function(t,s){if(t){return Qe(e,d,a,r,n,i)}n.push(p);Qe(s,e.type===s.type?d:si[s.type],a,r,n,i)})}else if(d.length){Qe(e,d,a,r,n,i)}else if(i){a(e,n)}else{Qe(e,si["*"],a,r,n,!0)}}var ci={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},mi=function(e){if(void 0===e){e=""}var t=tr(e),a=ci[t.toLowerCase()];return a||""},gi=function(e,t){if(!t){return""}if(e.cache_.source.src===t&&e.cache_.source.type){return e.cache_.source.type}var a=e.cache_.sources.filter(function(e){return e.src===t});if(a.length){return a[0].type}for(var r=e.$$("source"),n=0,o;n<r.length;n++){o=r[n];if(o.type&&o.src&&o.src===t){return o.type}}return mi(t)},yi=function e(t){if(Array.isArray(t)){var a=[];t.forEach(function(t){t=e(t);if(Array.isArray(t)){a=a.concat(t)}else if(o(t)){a.push(t)}});t=a}else if("string"==typeof t&&t.trim()){t=[Je({src:t})]}else if(o(t)&&"string"==typeof t.src&&t.src&&t.src.trim()){t=[Je(t)]}else{t=[]}return t};function Je(e){if(!e.type){var t=mi(e.src);if(t){e.type=t}}return e}var hi=function(e){te(t,e);function t(t,a,r){var n,s=ee({createEl:!1},a);n=e.call(this,t,s,r)||this;if(!a.playerOptions.sources||0===a.playerOptions.sources.length){for(var o=0,l=a.playerOptions.techOrder;o<l.length;o++){var d=Qt(l[o]),p=ii.getTech(d);if(!d){p=Zt.getComponent(d)}if(p&&p.isSupported()){t.loadTech_(d);break}}}else{t.src(a.playerOptions.sources)}return n}return t}(Zt);Zt.registerComponent("MediaLoader",hi);var fi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.emitTapEvents();r.enable();return r}var a=t.prototype;a.createEl=function(t,a,r){if(void 0===t){t="div"}if(void 0===a){a={}}if(void 0===r){r={}}a=s({innerHTML:"<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>",className:this.buildCSSClass(),tabIndex:0},a);if("button"===t){ft.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead.")}r=s({role:"button"},r);this.tabIndex_=a.tabIndex;var n=e.prototype.createEl.call(this,t,a,r);this.createControlTextEl(n);return n};a.dispose=function(){this.controlTextEl_=null;e.prototype.dispose.call(this)};a.createControlTextEl=function(e){this.controlTextEl_=_("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_};a.controlText=function(e,t){if(void 0===t){t=this.el()}if(e===void 0){return this.controlText_||"Need Text"}var a=this.localize(e);this.controlText_=e;f(this.controlTextEl_,a);if(!this.nonIconControl){t.setAttribute("title",a)}};a.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)};a.enable=function(){if(!this.enabled_){this.enabled_=!0;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if("undefined"!=typeof this.tabIndex_){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick);this.on("keydown",this.handleKeyDown)}};a.disable=function(){this.enabled_=!1;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if("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)};a.handleClick=function(){};a.handleKeyDown=function(t){if(Da.isEventKey(t,"Space")||Da.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{e.prototype.handleKeyDown.call(this,t)}};return t}(Zt);Zt.registerComponent("ClickableComponent",fi);var bi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.update();t.on("posterchange",Ut(ie(r),r.update));return r}var a=t.prototype;a.dispose=function(){this.player().off("posterchange",this.update);e.prototype.dispose.call(this)};a.createEl=function(){var e=_("div",{className:"vjs-poster",tabIndex:-1});return e};a.update=function(){var e=this.player().poster();this.setSrc(e);if(e){this.show()}else{this.hide()}};a.setSrc=function(e){var t="";if(e){t="url(\""+e+"\")"}this.el_.style.backgroundImage=t};a.handleClick=function(){if(!this.player_.controls()){return}if(this.player_.tech(!0)){this.player_.tech(!0).focus()}if(this.player_.paused()){me(this.player_.play())}else{this.player_.pause()}};return t}(fi);Zt.registerComponent("PosterImage",bi);var Ti="#ccc",vi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:"\"Andale Mono\", \"Lucida Console\", monospace",monospaceSerif:"\"Courier New\", monospace",proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:"\"Comic Sans MS\", Impact, fantasy",script:"\"Monotype Corsiva\", cursive",smallcaps:"\"Andale Mono\", \"Lucida Console\", monospace, sans-serif"};function Ze(e,t){var a;if(4===e.length){a=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(7===e.length){a=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(a.slice(0,2),16)+","+parseInt(a.slice(2,4),16)+","+parseInt(a.slice(4,6),16)+","+t+")"}function et(e,t,a){try{e.style[t]=a}catch(t){}}var Si=function(t){te(a,t);function a(a,r,n){var i=t.call(this,a,r,n)||this;var s=Ut(ie(i),i.updateDisplay);a.on("loadstart",Ut(ie(i),i.toggleDisplay));a.on("texttrackchange",s);a.on("loadedmetadata",Ut(ie(i),i.preselectTrack));a.ready(Ut(ie(i),function(){if(a.tech_&&a.tech_.featuresNativeTextTracks){this.hide();return}a.on("fullscreenchange",s);a.on("playerresize",s);e.addEventListener("orientationchange",s);a.on("dispose",function(){return e.removeEventListener("orientationchange",s)});for(var t=this.options_.playerOptions.tracks||[],r=0;r<t.length;r++){this.player_.addRemoteTextTrack(t[r],!0)}this.preselectTrack()}));return i}var r=a.prototype;r.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,r,n,s,o=0,l;o<t.length;o++){l=t[o];if(a&&a.enabled&&a.language&&a.language===l.language&&l.kind in e){if(l.kind===a.kind){s=l}else if(!s){s=l}}else if(a&&!a.enabled){s=null;r=null;n=null}else if(l["default"]){if("descriptions"===l.kind&&!r){r=l}else if(l.kind in e&&!n){n=l}}}if(s){s.mode="showing"}else if(n){n.mode="showing"}else if(r){r.mode="showing"}};r.toggleDisplay=function(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide()}else{this.show()}};r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})};r.clearDisplay=function(){if("function"==typeof e.WebVTT){e.WebVTT.processCues(e,[],this.el_)}};r.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(t){for(var a=[],r=0,n;r<e.length;++r){n=e[r];if("showing"!==n.mode){continue}a.push(n)}this.updateForTrack(a);return}var s=null,o=null,l=e.length;while(l--){var d=e[l];if("showing"===d.mode){if("descriptions"===d.kind){s=d}else{o=d}}}if(o){if("off"!==this.getAttribute("aria-live")){this.setAttribute("aria-live","off")}this.updateForTrack(o)}else if(s){if("assertive"!==this.getAttribute("aria-live")){this.setAttribute("aria-live","assertive")}this.updateForTrack(s)}};r.updateDisplayState=function(t){var a=this.player_.textTrackSettings.getValues(),r=t.activeCues,n=r.length;while(n--){var s=r[n];if(!s){continue}var o=s.displayState;if(a.color){o.firstChild.style.color=a.color}if(a.textOpacity){et(o.firstChild,"color",Ze(a.color||"#fff",a.textOpacity))}if(a.backgroundColor){o.firstChild.style.backgroundColor=a.backgroundColor}if(a.backgroundOpacity){et(o.firstChild,"backgroundColor",Ze(a.backgroundColor||"#000",a.backgroundOpacity))}if(a.windowColor){if(a.windowOpacity){et(o,"backgroundColor",Ze(a.windowColor,a.windowOpacity))}else{o.style.backgroundColor=a.windowColor}}if(a.edgeStyle){if("dropshadow"===a.edgeStyle){o.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222"}else if("raised"===a.edgeStyle){o.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222"}else if("depressed"===a.edgeStyle){o.firstChild.style.textShadow="1px 1px "+Ti+", 0 1px "+Ti+", -1px -1px "+"#222"+", 0 -1px "+"#222"}else if("uniform"===a.edgeStyle){o.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222"}}if(a.fontPercent&&1!==a.fontPercent){var l=e.parseFloat(o.style.fontSize);o.style.fontSize=l*a.fontPercent+"px";o.style.height="auto";o.style.top="auto";o.style.bottom="2px"}if(a.fontFamily&&"default"!==a.fontFamily){if("small-caps"===a.fontFamily){o.firstChild.style.fontVariant="small-caps"}else{o.firstChild.style.fontFamily=vi[a.fontFamily]}}}};r.updateForTrack=function(t){if(!Array.isArray(t)){t=[t]}if("function"!=typeof e.WebVTT||t.every(function(e){return!e.activeCues})){return}for(var a=[],r=0,n;r<t.length;++r){n=t[r];for(var s=0;s<n.activeCues.length;++s){a.push(n.activeCues[s])}}e.WebVTT.processCues(e,a,this.el_);for(var o=0,l;o<t.length;++o){l=t[o];for(var d=0,p;d<l.activeCues.length;++d){p=l.activeCues[d].displayState;v(p,"vjs-text-track-cue");v(p,"vjs-text-track-cue-"+(l.language?l.language:o))}if(this.player_.textTrackSettings){this.updateDisplayState(l)}}};return a}(Zt);Zt.registerComponent("TextTrackDisplay",Si);var ki=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){var t=this.player_.isAudio(),a=this.localize(t?"Audio Player":"Video Player"),r=_("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[a])}),n=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});n.appendChild(r);return n};return t}(Zt);Zt.registerComponent("LoadingSpinner",ki);var Ci=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(e,t,a){if(void 0===t){t={}}if(void 0===a){a={}}e="button";t=s({innerHTML:"<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>",className:this.buildCSSClass()},t);a=s({type:"button"},a);var r=Zt.prototype.createEl.call(this,e,t,a);this.createControlTextEl(r);return r};a.addChild=function(e,t){if(void 0===t){t={}}var a=this.constructor.name;ft.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead.");return Zt.prototype.addChild.call(this,e,t)};a.enable=function(){e.prototype.enable.call(this);this.el_.removeAttribute("disabled")};a.disable=function(){e.prototype.disable.call(this);this.el_.setAttribute("disabled","disabled")};a.handleKeyDown=function(t){if(Da.isEventKey(t,"Space")||Da.isEventKey(t,"Enter")){t.stopPropagation();return}e.prototype.handleKeyDown.call(this,t)};return t}(fi);Zt.registerComponent("Button",Ci);var Ei=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.mouseused_=!1;r.on("mousedown",r.handleMouseDown);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-big-play-button"};a.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){me(t);if(this.player_.tech(!0)){this.player_.tech(!0).focus()}return}var a=this.player_.getChild("controlBar"),r=a&&a.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}var n=function(){return r.focus()};if(ce(t)){t.then(n,function(){})}else{this.setTimeout(n,1)}};a.handleKeyDown=function(t){this.mouseused_=!1;e.prototype.handleKeyDown.call(this,t)};a.handleMouseDown=function(){this.mouseused_=!0};return t}(Ci);Ei.prototype.controlText_="Play Video";Zt.registerComponent("BigPlayButton",Ei);var Pi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.controlText(a&&a.controlText||r.localize("Close"));return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)};a.handleClick=function(){this.trigger({type:"close",bubbles:!1})};a.handleKeyDown=function(t){if(Da.isEventKey(t,"Esc")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{e.prototype.handleKeyDown.call(this,t)}};return t}(Ci);Zt.registerComponent("CloseButton",Pi);var Ii=function(e){te(t,e);function t(t,a){var r;if(void 0===a){a={}}r=e.call(this,t,a)||this;a.replay=a.replay===void 0||a.replay;r.on(t,"play",r.handlePlay);r.on(t,"pause",r.handlePause);if(a.replay){r.on(t,"ended",r.handleEnded)}return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)};a.handleClick=function(){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};a.handleSeeked=function(e){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(e)}else{this.handlePlay(e)}};a.handlePlay=function(){this.removeClass("vjs-ended");this.removeClass("vjs-paused");this.addClass("vjs-playing");this.controlText("Pause")};a.handlePause=function(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.controlText("Play")};a.handleEnded=function(){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.controlText("Replay");this.one(this.player_,"seeked",this.handleSeeked)};return t}(Ci);Ii.prototype.controlText_="Play";Zt.registerComponent("PlayToggle",Ii);var Li=function(e,t){e=0>e?0:e;var a=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),i=Math.floor(t/60%60),o=Math.floor(t/3600);if(isNaN(e)||e===1/0){n=r=a="-"}n=0<n||0<o?n+":":"";r=((n||10<=i)&&10>r?"0"+r:r)+":";a=10>a?"0"+a:a;return n+r+a},xi=Li;function tt(e,t){if(void 0===t){t=e}return xi(e,t)}var Ai=function(e){te(a,e);function a(t,a){var r=e.call(this,t,a)||this;r.throttledUpdateContent=Mt(Ut(ie(r),r.updateContent),Rt);r.on(t,"timeupdate",r.throttledUpdateContent);return r}var r=a.prototype;r.createEl=function(){var t=this.buildCSSClass(),a=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>"});this.contentEl_=_("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"});this.updateTextNode_();a.appendChild(this.contentEl_);return a};r.dispose=function(){this.contentEl_=null;this.textNode_=null;e.prototype.dispose.call(this)};r.updateTextNode_=function(){if(!this.contentEl_){return}while(this.contentEl_.firstChild){this.contentEl_.removeChild(this.contentEl_.firstChild)}this.textNode_=t.createTextNode(this.formattedTime_||this.formatTime_(0));this.contentEl_.appendChild(this.textNode_)};r.formatTime_=function(e){return tt(e)};r.updateFormattedTime_=function(e){var t=this.formatTime_(e);if(t===this.formattedTime_){return}this.formattedTime_=t;this.requestAnimationFrame(this.updateTextNode_)};r.updateContent=function(){};return a}(Zt);Ai.prototype.labelText_="Time";Ai.prototype.controlText_="Time";Zt.registerComponent("TimeDisplay",Ai);var Di=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.on(t,"ended",r.handleEnded);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-current-time"};a.updateContent=function(){var e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(e)};a.handleEnded=function(){if(!this.player_.duration()){return}this.updateFormattedTime_(this.player_.duration())};return t}(Ai);Di.prototype.labelText_="Current Time";Di.prototype.controlText_="Current Time";Zt.registerComponent("CurrentTimeDisplay",Di);var wi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.on(t,"durationchange",r.updateContent);r.on(t,"loadstart",r.updateContent);r.on(t,"loadedmetadata",r.throttledUpdateContent);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-duration"};a.updateContent=function(){var e=this.player_.duration();if(this.duration_!==e){this.duration_=e;this.updateFormattedTime_(e)}};return t}(Ai);wi.prototype.labelText_="Duration";wi.prototype.controlText_="Duration";Zt.registerComponent("DurationDisplay",wi);var Oi=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})};return t}(Zt);Zt.registerComponent("TimeDivider",Oi);var Ri=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.on(t,"durationchange",r.throttledUpdateContent);r.on(t,"ended",r.handleEnded);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-remaining-time"};a.createEl=function(){var t=e.prototype.createEl.call(this);t.insertBefore(_("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return t};a.updateContent=function(){if("number"!=typeof this.player_.duration()){return}if(this.player_.remainingTimeDisplay){this.updateFormattedTime_(this.player_.remainingTimeDisplay())}else{this.updateFormattedTime_(this.player_.remainingTime())}};a.handleEnded=function(){if(!this.player_.duration()){return}this.updateFormattedTime_(0)};return t}(Ai);Ri.prototype.labelText_="Remaining Time";Ri.prototype.controlText_="Remaining Time";Zt.registerComponent("RemainingTimeDisplay",Ri);var Ui=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.updateShowing();r.on(r.player(),"durationchange",r.updateShowing);return r}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});this.contentEl_=_("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_);return t};a.dispose=function(){this.contentEl_=null;e.prototype.dispose.call(this)};a.updateShowing=function(){if(this.player().duration()===1/0){this.show()}else{this.hide()}};return t}(Zt);Zt.registerComponent("LiveDisplay",Ui);var Mi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.updateLiveEdgeStatus();if(r.player_.liveTracker){r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatus)}return r}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});this.textEl_=_("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"});t.appendChild(this.textEl_);return t};a.updateLiveEdgeStatus=function(){if(!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")}else{this.setAttribute("aria-disabled",!1);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}};a.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()};a.dispose=function(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus)}this.textEl_=null;e.prototype.dispose.call(this)};return t}(Ci);Mi.prototype.controlText_="Seek to live, currently playing live";Zt.registerComponent("SeekToLive",Mi);var Ni=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.bar=r.getChild(r.options_.barName);r.vertical(!!r.options_.vertical);r.enable();return r}var a=t.prototype;a.enabled=function(){return this.enabled_};a.enable=function(){if(this.enabled()){return}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);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=!0};a.disable=function(){if(!this.enabled()){return}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");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=!1};a.createEl=function(t,a,r){if(void 0===a){a={}}if(void 0===r){r={}}a.className=a.className+" vjs-slider";a=s({tabIndex:0},a);r=s({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r);return e.prototype.createEl.call(this,t,a,r)};a.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;if("mousedown"===e.type){e.preventDefault()}if("touchstart"===e.type&&!ma){e.preventDefault()}x();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)};a.handleMouseMove=function(){};a.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;A();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()};a.update=function(){if(!this.el_){return}var e=this.getPercent(),t=this.bar;if(!t){return}if("number"!=typeof e||e!==e||0>e||e===1/0){e=0}var a=(100*e).toFixed(2)+"%",r=t.el().style,n=this.vertical()?"height":"width";if(r[n]!==a){r[n]=a}return e};a.calculateDistance=function(e){var t=O(this.el_,e);if(this.vertical()){return t.y}return t.x};a.handleKeyDown=function(t){if(Da.isEventKey(t,"Left")||Da.isEventKey(t,"Down")){t.preventDefault();t.stopPropagation();this.stepBack()}else if(Da.isEventKey(t,"Right")||Da.isEventKey(t,"Up")){t.preventDefault();t.stopPropagation();this.stepForward()}else{e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(e){e.stopPropagation();e.preventDefault()};a.vertical=function(e){if(e===void 0){return this.vertical_||!1}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}};return t}(Zt);Zt.registerComponent("Slider",Ni);var Bi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.partEls_=[];r.on(t,"progress",r.update);return r}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:"<span class=\"vjs-control-text\"><span>"+this.localize("Loaded")+"</span>: <span class=\"vjs-control-text-loaded-percentage\">0%</span></span>"})};a.dispose=function(){this.partEls_=null;e.prototype.dispose.call(this)};a.update=function(){var e=this.player_.liveTracker,t=this.player_.buffered(),a=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),n=this.partEls_,s=this.$(".vjs-control-text-loaded-percentage"),o=function(e,t,a){var r=e/t||0;r=100*(1<=r?1:r);if(a){r=r.toFixed(2)}return r+"%"};this.el_.style.width=o(r,a);f(s,o(r,a,!0));for(var l=0;l<t.length;l++){var d=t.start(l),p=t.end(l),u=n[l];if(!u){u=this.el_.appendChild(_());n[l]=u}u.style.left=o(d,r);u.style.width=o(p-d,r)}for(var c=n.length;c>t.length;c--){this.el_.removeChild(n[c-1])}n.length=t.length};return t}(Zt);Zt.registerComponent("LoadProgressBar",Bi);var ji=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.update=Mt(Ut(ie(r),r.update),Rt);return r}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})};a.update=function(e,t,a){var r=D(this.el_),n=D(this.player_.el()),i=e.width*t;if(!n||!r){return}var s=e.left-n.left+i,o=e.width-i+(n.right-e.right),l=r.width/2;if(s<l){l+=l-s}else if(o<l){l=o}if(0>l){l=0}else if(l>r.width){l=r.width}this.el_.style.right="-"+l+"px";this.write(a)};a.write=function(e){f(this.el_,e)};a.updateTime=function(e,t,a,r){var n=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var i,s=n.player_.duration();if(n.player_.liveTracker&&n.player_.liveTracker.isLive()){var o=n.player_.liveTracker.liveWindow(),l=o-t*o;i=(1>l?"":"-")+tt(l,o)}else{i=tt(a,s)}n.update(e,t,i);if(r){r()}})};return t}(Zt);Zt.registerComponent("TimeTooltip",ji);var Fi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.update=Mt(Ut(ie(r),r.update),Rt);return r}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})};a.update=function(e,t){var a=this.getChild("timeTooltip");if(!a){return}var r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,t,r)};return t}(Zt);Fi.prototype.options_={children:[]};if(!sa&&!la){Fi.prototype.options_.children.push("timeTooltip")}Zt.registerComponent("PlayProgressBar",Fi);var Hi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.update=Mt(Ut(ie(r),r.update),Rt);return r}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})};a.update=function(e,t){var a=this,r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,function(){a.el_.style.left=e.width*t+"px"})};return t}(Zt);Hi.prototype.options_={children:["timeTooltip"]};Zt.registerComponent("MouseTimeDisplay",Hi);var qi=12,Vi=30,Wi=function(e){te(a,e);function a(t,a){var r=e.call(this,t,a)||this;r.setEventHandlers_();return r}var r=a.prototype;r.setEventHandlers_=function(){this.update=Mt(Ut(this,this.update),Vi);this.on(this.player_,"timeupdate",this.update);this.on(this.player_,"ended",this.handleEnded);this.on(this.player_,"durationchange",this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.on(this.player_,["playing"],this.enableInterval_);this.on(this.player_,["ended","pause","waiting"],this.disableInterval_);if("hidden"in t&&"visibilityState"in t){this.on(t,"visibilitychange",this.toggleVisibility_)}};r.toggleVisibility_=function(a){if(t.hidden){this.disableInterval_(a)}else{this.enableInterval_();this.requestAnimationFrame(this.update)}};r.enableInterval_=function(){var e=this;this.clearInterval(this.updateInterval);this.updateInterval=this.setInterval(function(){e.requestAnimationFrame(e.update)},Vi)};r.disableInterval_=function(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&"ended"!==t.type){return}this.clearInterval(this.updateInterval)};r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})};r.update_=function(e,t){var a=this.player_.liveTracker,r=this.player_.duration();if(a&&a.isLive()){r=this.player_.liveTracker.liveCurrentTime()}this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2));this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[tt(e,r),tt(r,r)],"{1} of {2}"));if(this.bar){this.bar.update(D(this.el_),t)}};r.update=function(){if(null===this.el().offsetParent){return}var t=e.prototype.update.call(this);this.update_(this.getCurrentTime_(),t);return t};r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()};r.handleEnded=function(){this.update_(this.player_.duration(),1)};r.getPercent=function(){var e=this.getCurrentTime_(),t,a=this.player_.liveTracker;if(a&&a.isLive()){t=(e-a.seekableStart())/a.liveWindow();if(a.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return 1<=t?1:t||0};r.handleMouseDown=function(t){if(!j(t)){return}t.stopPropagation();this.player_.scrubbing(!0);this.videoWasPlaying=!this.player_.paused();this.player_.pause();e.prototype.handleMouseDown.call(this,t)};r.handleMouseMove=function(e){if(!j(e)){return}var t,a=this.calculateDistance(e),r=this.player_.liveTracker;if(!r||!r.isLive()){t=a*this.player_.duration();if(t===this.player_.duration()){t=t-.1}}else{var n=r.seekableStart(),i=r.liveCurrentTime();t=n+a*r.liveWindow();if(t>=i){t=i}if(t<=n){t=n+.1}if(t===1/0){return}}this.player_.currentTime(t)};r.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.show()};r.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.hide()};r.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t);if(t){t.stopPropagation()}this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});if(this.videoWasPlaying){me(this.player_.play())}};r.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)};r.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)};r.handleAction=function(){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};r.handleKeyDown=function(t){if(Da.isEventKey(t,"Space")||Da.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.handleAction(t)}else if(Da.isEventKey(t,"Home")){t.preventDefault();t.stopPropagation();this.player_.currentTime(0)}else if(Da.isEventKey(t,"End")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.duration())}else if(/^[0-9]$/.test(Da(t))){t.preventDefault();t.stopPropagation();var a=10*(Da.codes[Da(t)]-Da.codes[0])/100;this.player_.currentTime(this.player_.duration()*a)}else if(Da.isEventKey(t,"PgDn")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()-5*qi)}else if(Da.isEventKey(t,"PgUp")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()+5*qi)}else{e.prototype.handleKeyDown.call(this,t)}};return a}(Ni);Wi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!sa&&!la){Wi.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}Zt.registerComponent("SeekBar",Wi);var zi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.handleMouseMove=Mt(Ut(ie(r),r.handleMouseMove),Rt);r.throttledHandleMouseSeek=Mt(Ut(ie(r),r.handleMouseSeek),Rt);r.enable();return r}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})};a.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var a=t.getChild("mouseTimeDisplay"),r=t.el(),n=D(r),i=O(r,e).x;if(1<i){i=1}else if(0>i){i=0}if(a){a.update(n,i)}}};a.handleMouseSeek=function(e){var t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}};a.enabled=function(){return this.enabled_};a.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()});if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDown);this.off(this.el_,"mousemove",this.handleMouseMove);this.handleMouseUp();this.addClass("disabled");this.enabled_=!1};a.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()});if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDown);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=!0};a.handleMouseDown=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUp);this.on(t,"touchend",this.handleMouseUp)};a.handleMouseUp=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseUp(e)}this.off(t,"mousemove",this.throttledHandleMouseSeek);this.off(t,"touchmove",this.throttledHandleMouseSeek);this.off(t,"mouseup",this.handleMouseUp);this.off(t,"touchend",this.handleMouseUp)};return t}(Zt);zi.prototype.options_={children:["seekBar"]};Zt.registerComponent("ProgressControl",zi);var Gi=function(e){te(a,e);function a(a,r){var n=e.call(this,a,r)||this;n.on(a,["enterpictureinpicture","leavepictureinpicture"],n.handlePictureInPictureChange);if(!t.pictureInPictureEnabled){n.disable()}return n}var r=a.prototype;r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)};r.handlePictureInPictureChange=function(){if(this.player_.isInPictureInPicture()){this.controlText("Exit Picture-in-Picture")}else{this.controlText("Picture-in-Picture")}};r.handleClick=function(){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}};return a}(Ci);Gi.prototype.controlText_="Picture-in-Picture";Zt.registerComponent("PictureInPictureToggle",Gi);var $i=function(e){te(a,e);function a(a,r){var n=e.call(this,a,r)||this;n.on(a,"fullscreenchange",n.handleFullscreenChange);if(!1===t[a.fsApi_.fullscreenEnabled]){n.disable()}return n}var r=a.prototype;r.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)};r.handleFullscreenChange=function(){if(this.player_.isFullscreen()){this.controlText("Non-Fullscreen")}else{this.controlText("Fullscreen")}};r.handleClick=function(){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}};return a}(Ci);$i.prototype.controlText_="Fullscreen";Zt.registerComponent("FullscreenToggle",$i);var Ki=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},Yi=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:"<span class=\"vjs-control-text\"></span>"})};return t}(Zt);Zt.registerComponent("VolumeLevel",Yi);var Xi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.on("slideractive",r.updateLastVolume_);r.on(t,"volumechange",r.updateARIAAttributes);t.ready(function(){return r.updateARIAAttributes()});return r}var a=t.prototype;a.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"})};a.handleMouseDown=function(t){if(!j(t)){return}e.prototype.handleMouseDown.call(this,t)};a.handleMouseMove=function(e){if(!j(e)){return}this.checkMuted();this.player_.volume(this.calculateDistance(e))};a.checkMuted=function(){if(this.player_.muted()){this.player_.muted(!1)}};a.getPercent=function(){if(this.player_.muted()){return 0}return this.player_.volume()};a.stepForward=function(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)};a.stepBack=function(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)};a.updateARIAAttributes=function(){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e);this.el_.setAttribute("aria-valuetext",e+"%")};a.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())};a.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){if(0===e.player_.volume()){e.player_.lastVolume_(t)}})};return t}(Ni);Xi.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};Xi.prototype.playerEvent="volumechange";Zt.registerComponent("VolumeBar",Xi);var Qi=function(e){te(t,e);function t(t,a){var r;if(void 0===a){a={}}a.vertical=a.vertical||!1;if("undefined"==typeof a.volumeBar||l(a.volumeBar)){a.volumeBar=a.volumeBar||{};a.volumeBar.vertical=a.vertical}r=e.call(this,t,a)||this;Ki(ie(r),t);r.throttledHandleMouseMove=Mt(Ut(ie(r),r.handleMouseMove),Rt);r.on("mousedown",r.handleMouseDown);r.on("touchstart",r.handleMouseDown);r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active");r.addClass("vjs-slider-active");r.trigger("slideractive")});r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active");r.removeClass("vjs-slider-active");r.trigger("sliderinactive")});return r}var a=t.prototype;a.createEl=function(){var t="vjs-volume-horizontal";if(this.options_.vertical){t="vjs-volume-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})};a.handleMouseDown=function(){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove);this.on(e,"touchmove",this.throttledHandleMouseMove);this.on(e,"mouseup",this.handleMouseUp);this.on(e,"touchend",this.handleMouseUp)};a.handleMouseUp=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove);this.off(e,"touchmove",this.throttledHandleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchend",this.handleMouseUp)};a.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)};return t}(Zt);Qi.prototype.options_={children:["volumeBar"]};Zt.registerComponent("VolumeControl",Qi);var Ji=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},Zi=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;Ji(ie(r),t);r.on(t,["loadstart","volumechange"],r.update);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)};a.handleClick=function(){var e=this.player_.volume(),t=this.player_.lastVolume_();if(0===e){var a=.1>t?.1:t;this.player_.volume(a);this.player_.muted(!1)}else{this.player_.muted(this.player_.muted()?!1:!0)}};a.update=function(){this.updateIcon_();this.updateControlText_()};a.updateIcon_=function(){var e=this.player_.volume(),t=3;if(sa&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(0===e||this.player_.muted()){t=0}else if(.33>e){t=1}else if(.67>e){t=2}for(var a=0;4>a;a++){S(this.el_,"vjs-vol-"+a)}v(this.el_,"vjs-vol-"+t)};a.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}};return t}(Ci);Zi.prototype.controlText_="Mute";Zt.registerComponent("MuteToggle",Zi);var es=function(e){te(a,e);function a(t,a){var r;if(void 0===a){a={}}if("undefined"!=typeof a.inline){a.inline=a.inline}else{a.inline=!0}if("undefined"==typeof a.volumeControl||l(a.volumeControl)){a.volumeControl=a.volumeControl||{};a.volumeControl.vertical=!a.inline}r=e.call(this,t,a)||this;r.on(t,["loadstart"],r.volumePanelState_);r.on(r.muteToggle,"keyup",r.handleKeyPress);r.on(r.volumeControl,"keyup",r.handleVolumeControlKeyUp);r.on("keydown",r.handleKeyPress);r.on("mouseover",r.handleMouseOver);r.on("mouseout",r.handleMouseOut);r.on(r.volumeControl,["slideractive"],r.sliderActive_);r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_);return r}var r=a.prototype;r.sliderActive_=function(){this.addClass("vjs-slider-active")};r.sliderInactive_=function(){this.removeClass("vjs-slider-active")};r.volumePanelState_=function(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}};r.createEl=function(){var t="vjs-volume-panel-horizontal";if(!this.options_.inline){t="vjs-volume-panel-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})};r.dispose=function(){this.handleMouseOut();e.prototype.dispose.call(this)};r.handleVolumeControlKeyUp=function(e){if(Da.isEventKey(e,"Esc")){this.muteToggle.focus()}};r.handleMouseOver=function(){this.addClass("vjs-hover");G(t,"keyup",Ut(this,this.handleKeyPress))};r.handleMouseOut=function(){this.removeClass("vjs-hover");K(t,"keyup",Ut(this,this.handleKeyPress))};r.handleKeyPress=function(e){if(Da.isEventKey(e,"Esc")){this.handleMouseOut()}};return a}(Zt);es.prototype.options_={children:["muteToggle","volumeControl"]};Zt.registerComponent("VolumePanel",es);var ts=function(e){te(a,e);function a(t,a){var r=e.call(this,t,a)||this;if(a){r.menuButton_=a.menuButton}r.focusedChild_=-1;r.on("keydown",r.handleKeyDown);r.boundHandleBlur_=Ut(ie(r),r.handleBlur);r.boundHandleTapClick_=Ut(ie(r),r.handleTapClick);return r}var r=a.prototype;r.addEventListenerForItem=function(e){if(!(e instanceof Zt)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)};r.removeEventListenerForItem=function(e){if(!(e instanceof Zt)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)};r.removeChild=function(t){if("string"==typeof t){t=this.getChild(t)}this.removeEventListenerForItem(t);e.prototype.removeChild.call(this,t)};r.addItem=function(e){var t=this.addChild(e);if(t){this.addEventListenerForItem(t)}};r.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=_(t,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var a=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});a.appendChild(this.contentEl_);G(a,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return a};r.dispose=function(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;e.prototype.dispose.call(this)};r.handleBlur=function(e){var a=e.relatedTarget||t.activeElement;if(!this.children().some(function(e){return e.el()===a})){var r=this.menuButton_;if(r&&r.buttonPressed_&&a!==r.el().firstChild){r.unpressButton()}}};r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t)){return}var a=t.filter(function(t){return t.el()===e.target})[0];if(!a){return}if("CaptionSettingsMenuItem"!==a.name()){this.menuButton_.focus()}}};r.handleKeyDown=function(e){if(Da.isEventKey(e,"Left")||Da.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(Da.isEventKey(e,"Right")||Da.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}};r.stepForward=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_+1}this.focus(e)};r.stepBack=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_-1}this.focus(e)};r.focus=function(e){if(void 0===e){e=0}var t=this.children().slice(),a=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);if(a){t.shift()}if(0<t.length){if(0>e){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}};return a}(Zt);Zt.registerComponent("Menu",ts);var as=function(e){te(a,e);function a(a,r){var n;if(void 0===r){r={}}n=e.call(this,a,r)||this;n.menuButton_=new Ci(a,r);n.menuButton_.controlText(n.controlText_);n.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Ci.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+i;n.menuButton_.removeClass("vjs-control");n.addChild(n.menuButton_);n.update();n.enabled_=!0;n.on(n.menuButton_,"tap",n.handleClick);n.on(n.menuButton_,"click",n.handleClick);n.on(n.menuButton_,"keydown",n.handleKeyDown);n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover");n.menu.show();G(t,"keyup",Ut(ie(n),n.handleMenuKeyUp))});n.on("mouseleave",n.handleMouseLeave);n.on("keydown",n.handleSubmenuKeyDown);return n}var r=a.prototype;r.update=function(){var e=this.createMenu();if(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");if(this.items&&this.items.length<=this.hideThreshold_){this.hide()}else{this.show()}};r.createMenu=function(){var e=new ts(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var t=_("li",{className:"vjs-menu-title",innerHTML:Qt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var a=new Zt(this.player_,{el:t});e.addItem(a)}this.items=this.createItems();if(this.items){for(var r=0;r<this.items.length;r++){e.addItem(this.items[r])}}return e};r.createItems=function(){};r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})};r.buildWrapperCSSClass=function(){var t="vjs-menu-button";if(!0===this.options_.inline){t+="-inline"}else{t+="-popup"}var a=Ci.prototype.buildCSSClass();return"vjs-menu-button "+t+" "+a+" "+e.prototype.buildCSSClass.call(this)};r.buildCSSClass=function(){var t="vjs-menu-button";if(!0===this.options_.inline){t+="-inline"}else{t+="-popup"}return"vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)};r.controlText=function(e,t){if(void 0===t){t=this.menuButton_.el()}return this.menuButton_.controlText(e,t)};r.dispose=function(){this.handleMouseLeave();e.prototype.dispose.call(this)};r.handleClick=function(){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}};r.handleMouseLeave=function(){this.removeClass("vjs-hover");K(t,"keyup",Ut(this,this.handleMenuKeyUp))};r.focus=function(){this.menuButton_.focus()};r.blur=function(){this.menuButton_.blur()};r.handleKeyDown=function(e){if(Da.isEventKey(e,"Esc")||Da.isEventKey(e,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Da.isEventKey(e,"Tab")){e.preventDefault();this.menuButton_.focus()}}else if(Da.isEventKey(e,"Up")||Da.isEventKey(e,"Down")){if(!this.buttonPressed_){e.preventDefault();this.pressButton()}}};r.handleMenuKeyUp=function(e){if(Da.isEventKey(e,"Esc")||Da.isEventKey(e,"Tab")){this.removeClass("vjs-hover")}};r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)};r.handleSubmenuKeyDown=function(e){if(Da.isEventKey(e,"Esc")||Da.isEventKey(e,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Da.isEventKey(e,"Tab")){e.preventDefault();this.menuButton_.focus()}}};r.pressButton=function(){if(this.enabled_){this.buttonPressed_=!0;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(sa&&y()){return}this.menu.focus()}};r.unpressButton=function(){if(this.enabled_){this.buttonPressed_=!1;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute("aria-expanded","false")}};r.disable=function(){this.unpressButton();this.enabled_=!1;this.addClass("vjs-disabled");this.menuButton_.disable()};r.enable=function(){this.enabled_=!0;this.removeClass("vjs-disabled");this.menuButton_.enable()};return a}(Zt);Zt.registerComponent("MenuButton",as);var rs=function(e){te(t,e);function t(t,a){var r,n=a.tracks;r=e.call(this,t,a)||this;if(1>=r.items.length){r.hide()}if(!n){return ie(r)}var i=Ut(ie(r),r.update);n.addEventListener("removetrack",i);n.addEventListener("addtrack",i);r.player_.on("ready",i);r.player_.on("dispose",function(){n.removeEventListener("removetrack",i);n.removeEventListener("addtrack",i)});return r}return t}(as);Zt.registerComponent("TrackButton",rs);var ns=["Tab","Esc","Up","Down","Right","Left"],is=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.selectable=a.selectable;r.isSelected_=a.selected||!1;r.multiSelectable=a.multiSelectable;r.selected(r.isSelected_);if(r.selectable){if(r.multiSelectable){r.el_.setAttribute("role","menuitemcheckbox")}else{r.el_.setAttribute("role","menuitemradio")}}else{r.el_.setAttribute("role","menuitem")}return r}var a=t.prototype;a.createEl=function(t,a,r){this.nonIconControl=!0;return e.prototype.createEl.call(this,"li",s({className:"vjs-menu-item",innerHTML:"<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label)+"</span>",tabIndex:-1},a),r)};a.handleKeyDown=function(t){if(!ns.some(function(e){return Da.isEventKey(t,e)})){e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(){this.selected(!0)};a.selected=function(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=!0}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=!1}}};return t}(fi);Zt.registerComponent("MenuItem",is);var ss=function(a){te(r,a);function r(r,n){var i,s=n.track,o=r.textTracks();n.label=s.label||s.language||"Unknown";n.selected="showing"===s.mode;i=a.call(this,r,n)||this;i.track=s;i.kinds=(n.kinds||[n.kind||i.track.kind]).filter(Boolean);var l=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++){t[a]=arguments[a]}i.handleTracksChange.apply(ie(i),t)},d=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++){t[a]=arguments[a]}i.handleSelectedLanguageChange.apply(ie(i),t)};r.on(["loadstart","texttrackchange"],l);o.addEventListener("change",l);o.addEventListener("selectedlanguagechange",d);i.on("dispose",function(){r.off(["loadstart","texttrackchange"],l);o.removeEventListener("change",l);o.removeEventListener("selectedlanguagechange",d)});if(o.onchange===void 0){var p;i.on(["tap","click"],function(){if("object"!==_typeof(e.Event)){try{p=new e.Event("change")}catch(e){}}if(!p){p=t.createEvent("Event");p.initEvent("change",!0,!0)}o.dispatchEvent(p)})}i.handleTracksChange();return i}var n=r.prototype;n.handleClick=function(e){var t=this.track,r=this.player_.textTracks();a.prototype.handleClick.call(this,e);if(!r){return}for(var n=0,s;n<r.length;n++){s=r[n];if(-1===this.kinds.indexOf(s.kind)){continue}if(s===t){if("showing"!==s.mode){s.mode="showing"}}else if("disabled"!==s.mode){s.mode="disabled"}}};n.handleTracksChange=function(){var e="showing"===this.track.mode;if(e!==this.isSelected_){this.selected(e)}};n.handleSelectedLanguageChange=function(){if("showing"===this.track.mode){var e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind){return}this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}};n.dispose=function(){this.track=null;a.prototype.dispose.call(this)};return r}(is);Zt.registerComponent("TextTrackMenuItem",ss);var os=function(e){te(t,e);function t(t,a){a.track={player:t,kind:a.kind,kinds:a.kinds,default:!1,mode:"disabled"};if(!a.kinds){a.kinds=[a.kind]}if(a.label){a.track.label=a.label}else{a.track.label=a.kinds.join(" and ")+" off"}a.selectable=!0;a.multiSelectable=!1;return e.call(this,t,a)||this}var a=t.prototype;a.handleTracksChange=function(){for(var e=this.player().textTracks(),t=!0,a=0,r=e.length,n;a<r;a++){n=e[a];if(-1<this.options_.kinds.indexOf(n.kind)&&"showing"===n.mode){t=!1;break}}if(t!==this.isSelected_){this.selected(t)}};a.handleSelectedLanguageChange=function(){for(var e=this.player().textTracks(),t=!0,a=0,r=e.length,n;a<r;a++){n=e[a];if(-1<["captions","descriptions","subtitles"].indexOf(n.kind)&&"showing"===n.mode){t=!1;break}}if(t){this.player_.cache_.selectedLanguage={enabled:!1}}};return t}(ss);Zt.registerComponent("OffTextTrackMenuItem",os);var ls=function(e){te(t,e);function t(t,a){if(void 0===a){a={}}a.tracks=t.textTracks();return e.call(this,t,a)||this}var a=t.prototype;a.createItems=function(e,t){if(void 0===e){e=[]}if(void 0===t){t=ss}var a;if(this.label_){a=this.label_+" off"}e.push(new os(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a}));this.hideThreshold_+=1;var r=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(var n=0,s;n<r.length;n++){s=r[n];if(-1<this.kinds_.indexOf(s.kind)){var o=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass("vjs-"+s.kind+"-menu-item");e.push(o)}}return e};return t}(rs);Zt.registerComponent("TextTrackButton",ls);var ds=function(e){te(t,e);function t(t,a){var r,n=a.track,i=a.cue,s=t.currentTime();a.selectable=!0;a.multiSelectable=!1;a.label=i.text;a.selected=i.startTime<=s&&s<i.endTime;r=e.call(this,t,a)||this;r.track=n;r.cue=i;n.addEventListener("cuechange",Ut(ie(r),r.update));return r}var a=t.prototype;a.handleClick=function(){e.prototype.handleClick.call(this);this.player_.currentTime(this.cue.startTime);this.update(this.cue.startTime)};a.update=function(){var e=this.cue,t=this.player_.currentTime();this.selected(e.startTime<=t&&t<e.endTime)};return t}(is);Zt.registerComponent("ChaptersTrackMenuItem",ds);var ps=function(e){te(t,e);function t(t,a,r){return e.call(this,t,a,r)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)};a.update=function(t){if(!this.track_||t&&("addtrack"===t.type||"removetrack"===t.type)){this.setTrack(this.findChaptersTrack())}e.prototype.update.call(this)};a.setTrack=function(e){if(this.track_===e){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.removeEventListener("load",this.updateHandler_)}this.track_=null}this.track_=e;if(this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(a){a.addEventListener("load",this.updateHandler_)}}};a.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1,a;0<=t;t--){a=e[t];if(a.kind===this.kind_){return a}}};a.getMenuCaption=function(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(Qt(this.kind_))};a.createMenu=function(){this.options_.title=this.getMenuCaption();return e.prototype.createMenu.call(this)};a.createItems=function(){var e=[];if(!this.track_){return e}var t=this.track_.cues;if(!t){return e}for(var a=0,r=t.length;a<r;a++){var n=t[a],s=new ds(this.player_,{track:this.track_,cue:n});e.push(s)}return e};return t}(ls);ps.prototype.kind_="chapters";ps.prototype.controlText_="Chapters";Zt.registerComponent("ChaptersButton",ps);var us=function(e){te(t,e);function t(t,a,r){var n=e.call(this,t,a,r)||this;var i=t.textTracks(),s=Ut(ie(n),n.handleTracksChange);i.addEventListener("change",s);n.on("dispose",function(){i.removeEventListener("change",s)});return n}var a=t.prototype;a.handleTracksChange=function(){for(var e=this.player().textTracks(),t=!1,a=0,r=e.length,n;a<r;a++){n=e[a];if(n.kind!==this.kind_&&"showing"===n.mode){t=!0;break}}if(t){this.disable()}else{this.enable()}};a.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)};return t}(ls);us.prototype.kind_="descriptions";us.prototype.controlText_="Descriptions";Zt.registerComponent("DescriptionsButton",us);var cs=function(e){te(t,e);function t(t,a,r){return e.call(this,t,a,r)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)};return t}(ls);cs.prototype.kind_="subtitles";cs.prototype.controlText_="Subtitles";Zt.registerComponent("SubtitlesButton",cs);var ms=function(e){te(t,e);function t(t,a){var r;a.track={player:t,kind:a.kind,label:a.kind+" settings",selectable:!1,default:!1,mode:"disabled"};a.selectable=!1;a.name="CaptionSettingsMenuItem";r=e.call(this,t,a)||this;r.addClass("vjs-texttrack-settings");r.controlText(", opens "+a.kind+" settings dialog");return r}var a=t.prototype;a.handleClick=function(){this.player().getChild("textTrackSettings").open()};return t}(ss);Zt.registerComponent("CaptionSettingsMenuItem",ms);var gs=function(e){te(t,e);function t(t,a,r){return e.call(this,t,a,r)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)};a.createItems=function(){var t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new ms(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return e.prototype.createItems.call(this,t)};return t}(ls);gs.prototype.kind_="captions";gs.prototype.controlText_="Captions";Zt.registerComponent("CaptionsButton",gs);var ys=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(t,a,r){var n="<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label);if("captions"===this.options_.track.kind){n+="\n        <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n        <span class=\"vjs-control-text\"> "+this.localize("Captions")+"</span>\n      "}n+="</span>";var i=e.prototype.createEl.call(this,t,s({innerHTML:n},a),r);return i};return t}(ss);Zt.registerComponent("SubsCapsMenuItem",ys);var hs=function(e){te(t,e);function t(t,a){var r;if(void 0===a){a={}}r=e.call(this,t,a)||this;r.label_="subtitles";if(-1<["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)){r.label_="captions"}r.menuButton_.controlText(Qt(r.label_));return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)};a.createItems=function(){var t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new ms(this.player_,{kind:this.label_}));this.hideThreshold_+=1}t=e.prototype.createItems.call(this,t,ys);return t};return t}(ls);hs.prototype.kinds_=["captions","subtitles"];hs.prototype.controlText_="Subtitles";Zt.registerComponent("SubsCapsButton",hs);var _s=function(e){te(t,e);function t(t,a){var r,n=a.track,i=t.audioTracks();a.label=n.label||n.language||"Unknown";a.selected=n.enabled;r=e.call(this,t,a)||this;r.track=n;r.addClass("vjs-"+n.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++){t[a]=arguments[a]}r.handleTracksChange.apply(ie(r),t)};i.addEventListener("change",s);r.on("dispose",function(){i.removeEventListener("change",s)});return r}var a=t.prototype;a.createEl=function(t,a,r){var n="<span class=\"vjs-menu-item-text\">"+this.localize(this.options_.label);if("main-desc"===this.options_.track.kind){n+="\n        <span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>\n        <span class=\"vjs-control-text\"> "+this.localize("Descriptions")+"</span>\n      "}n+="</span>";var i=e.prototype.createEl.call(this,t,s({innerHTML:n},a),r);return i};a.handleClick=function(t){var a=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var r=0,n;r<a.length;r++){n=a[r];n.enabled=n===this.track}};a.handleTracksChange=function(){this.selected(this.track.enabled)};return t}(is);Zt.registerComponent("AudioTrackMenuItem",_s);var fs=function(e){te(t,e);function t(t,a){if(void 0===a){a={}}a.tracks=t.audioTracks();return e.call(this,t,a)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)};a.createItems=function(e){if(void 0===e){e=[]}this.hideThreshold_=1;for(var t=this.player_.audioTracks(),a=0,r;a<t.length;a++){r=t[a];e.push(new _s(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e};return t}(rs);fs.prototype.controlText_="Audio Track";Zt.registerComponent("AudioTrackButton",fs);var bs=function(e){te(t,e);function t(t,a){var r,n=a.rate,i=parseFloat(n,10);a.label=n;a.selected=1===i;a.selectable=!0;a.multiSelectable=!1;r=e.call(this,t,a)||this;r.label=n;r.rate=i;r.on(t,"ratechange",r.update);return r}var a=t.prototype;a.handleClick=function(){e.prototype.handleClick.call(this);this.player().playbackRate(this.rate)};a.update=function(){this.selected(this.player().playbackRate()===this.rate)};return t}(is);bs.prototype.contentElType="button";Zt.registerComponent("PlaybackRateMenuItem",bs);var Ts=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.updateVisibility();r.updateLabel();r.on(t,"loadstart",r.updateVisibility);r.on(t,"ratechange",r.updateLabel);return r}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this);this.labelEl_=_("div",{className:"vjs-playback-rate-value",innerHTML:"1x"});t.appendChild(this.labelEl_);return t};a.dispose=function(){this.labelEl_=null;e.prototype.dispose.call(this)};a.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)};a.createMenu=function(){var e=new ts(this.player()),t=this.playbackRates();if(t){for(var a=t.length-1;0<=a;a--){e.addChild(new bs(this.player(),{rate:t[a]+"x"}))}}return e};a.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())};a.handleClick=function(){for(var e=this.player().playbackRate(),t=this.playbackRates(),a=t[0],r=0;r<t.length;r++){if(t[r]>e){a=t[r];break}}this.player().playbackRate(a)};a.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates};a.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length};a.updateVisibility=function(){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}};a.updateLabel=function(){if(this.playbackRateSupported()){this.labelEl_.innerHTML=this.player().playbackRate()+"x"}};return t}(as);Ts.prototype.controlText_="Playback Rate";Zt.registerComponent("PlaybackRateMenuButton",Ts);var vs=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)};a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})};return t}(Zt);Zt.registerComponent("Spacer",vs);var Ss=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)};a.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});t.innerHTML="\xA0";return t};return t}(vs);Zt.registerComponent("CustomControlSpacer",Ss);var ks=function(e){te(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})};return t}(Zt);ks.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};if("exitPictureInPicture"in t){ks.prototype.options_.children.splice(ks.prototype.options_.children.length-1,0,"pictureInPictureToggle")}Zt.registerComponent("ControlBar",ks);var Cs=function(e){te(t,e);function t(t,a){var r=e.call(this,t,a)||this;r.on(t,"error",r.open);return r}var a=t.prototype;a.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)};a.content=function(){var e=this.player().error();return e?this.localize(e.message):""};return t}(Ba);Cs.prototype.options_=ee(Ba.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});Zt.registerComponent("ErrorDisplay",Cs);var Es=["#000","Black"],Ps=["#00F","Blue"],Is=["#0FF","Cyan"],Ls=["#0F0","Green"],xs=["#F0F","Magenta"],As=["#F00","Red"],Ds=["#FFF","White"],ws=["#FF0","Yellow"],Os=["1","Opaque"],Rs=["0.5","Semi-Transparent"],Us=["0","Transparent"],Ms={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Es,Ds,As,Ls,Ps,ws,xs,Is]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Os,Rs,Us]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ds,Es,As,Ls,Ps,ws,xs,Is]},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:+e}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Os,Rs]},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:[Us,Rs,Os]}};Ms.windowColor.options=Ms.backgroundColor.options;function at(e,t){if(t){e=t(e)}if(e&&"none"!==e){return e}}function rt(e,t){var a=e.options[e.options.selectedIndex].value;return at(a,t)}function nt(e,t,a){if(!t){return}for(var r=0;r<e.options.length;r++){if(at(e.options[r].value,a)===t){e.selectedIndex=r;break}}}var Ns=function(t){te(a,t);function a(e,a){var n;a.temporary=!1;n=t.call(this,e,a)||this;n.updateDisplay=Ut(ie(n),n.updateDisplay);n.fill();n.hasBeenOpened_=n.hasBeenFilled_=!0;n.endDialog=_("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")});n.el().appendChild(n.endDialog);n.setDefaults();if(a.persistTextTrackSettings===void 0){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()});r(Ms,function(e){n.on(n.$(e.selector),"change",n.updateDisplay)});if(n.options_.persistTextTrackSettings){n.restoreSettings()}return n}var i=a.prototype;i.dispose=function(){this.endDialog=null;t.prototype.dispose.call(this)};i.createElSelect_=function(e,t,a){var r=this;if(void 0===t){t=""}if(void 0===a){a="label"}var n=Ms[e],i=n.id.replace("%s",this.id_),s=[t,i].join(" ").trim();return["<"+a+" id=\""+i+"\" class=\""+("label"===a?"vjs-label":"")+"\">",this.localize(n.label),"</"+a+">","<select aria-labelledby=\""+s+"\">"].concat(n.options.map(function(e){var t=i+"-"+e[1].replace(/\W+/g,"");return["<option id=\""+t+"\" value=\""+e[0]+"\" ","aria-labelledby=\""+s+" "+t+"\">",r.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 _("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})};i.createElFont_=function(){return _("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 _("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 t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"};i.getValues=function(){var e=this;return n(Ms,function(t,a,r){var n=rt(e.$(a.selector),a.parser);if(n!==void 0){t[r]=n}return t},{})};i.setValues=function(e){var t=this;r(Ms,function(a,r){nt(t.$(a.selector),e[r],a.parser)})};i.setDefaults=function(){var e=this;r(Ms,function(t){var a=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=a})};i.restoreSettings=function(){var t;try{t=JSON.parse(e.localStorage.getItem("vjs-text-track-settings"))}catch(e){ft.warn(e)}if(t){this.setValues(t)}};i.saveSettings=function(){if(!this.options_.persistTextTrackSettings){return}var t=this.getValues();try{if(Object.keys(t).length){e.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t))}else{e.localStorage.removeItem("vjs-text-track-settings")}}catch(e){ft.warn(e)}};i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}};i.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,a=e&&e.captionsButton;if(t){t.focus()}else if(a){a.focus()}};return a}(Ba);Zt.registerComponent("TextTrackSettings",Ns);var Bs=function(t){te(a,t);function a(a,r){var n,i=r.ResizeObserver||e.ResizeObserver;if(null===r.ResizeObserver){i=!1}var s=ee({createEl:!i,reportTouchActivity:!1},r);n=t.call(this,a,s)||this;n.ResizeObserver=r.ResizeObserver||e.ResizeObserver;n.loadListener_=null;n.resizeObserver_=null;n.debouncedHandler_=Nt(function(){n.resizeHandler()},100,!1,ie(n));if(i){n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_);n.resizeObserver_.observe(a.el())}else{n.loadListener_=function(){if(!n.el_||!n.el_.contentWindow){return}var e=n.debouncedHandler_,t=n.unloadListener_=function(){K(this,"resize",e);K(this,"unload",t);t=null};G(n.el_.contentWindow,"unload",t);G(n.el_.contentWindow,"resize",e)};n.one("load",n.loadListener_)}return n}var r=a.prototype;r.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})};r.resizeHandler=function(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")};r.dispose=function(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;t.prototype.dispose.call(this)};return a}(Zt);Zt.registerComponent("ResizeManager",Bs);var js=function(e){var t=Math.floor(e.length/2),a=[].concat(e).sort(function(e,t){return e-t});return 0!=e.length%2?a[t]:(a[t-1]+a[t])/2},Fs=function(e){te(a,e);function a(a,r){var n,i=ee({createEl:!1},r);n=e.call(this,a,i)||this;n.reset_();n.on(n.player_,"durationchange",n.handleDurationchange);if(ya&&"hidden"in t&&"visibilityState"in t){n.on(t,"visibilitychange",n.handleVisibilityChange)}return n}var r=a.prototype;r.handleVisibilityChange=function(){if(this.player_.duration()!==1/0){return}if(t.hidden){this.stopTracking()}else{this.startTracking()}};r.isBehind_=function(){if(!this.timeupdateSeen_){return!1}var e=this.liveCurrentTime(),t=this.player_.currentTime(),a=2*this.seekableIncrement_+.07;return e!==1/0&&e-a>=t};r.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(!e||!e.length){return}var t=this.seekableEnd();if(t!==this.lastSeekEnd_){if(this.lastSeekEnd_){this.seekableIncrementList_=this.seekableIncrementList_.slice(-11);this.seekableIncrementList_.push(Math.abs(t-this.lastSeekEnd_));if(3<this.seekableIncrementList_.length){this.seekableIncrement_=js(this.seekableIncrementList_)}}this.pastSeekEnd_=0;this.lastSeekEnd_=t;this.trigger("seekableendchange")}this.pastSeekEnd_=this.pastSeekEnd()+.03;if(this.isBehind_()!==this.behindLiveEdge()){this.behindLiveEdge_=this.isBehind_();this.trigger("liveedgechange")}};r.handleDurationchange=function(){if(this.player_.duration()===1/0){this.startTracking()}else{this.stopTracking()}};r.startTracking=function(){var e=this;if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLive_,30);this.trackLive_();this.on(this.player_,"play",this.trackLive_);this.on(this.player_,"pause",this.trackLive_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay);this.handleTimeupdate=function(){e.timeupdateSeen_=!0;e.handleTimeupdate=null};this.one(this.player_,"timeupdate",this.handleTimeupdate)}};r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)};r.reset_=function(){this.pastSeekEnd_=0;this.lastSeekEnd_=null;this.behindLiveEdge_=null;this.timeupdateSeen_=!1;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.seekableIncrement_=12;this.seekableIncrementList_=[];this.off(this.player_,"play",this.trackLive_);this.off(this.player_,"pause",this.trackLive_);this.off(this.player_,"play",this.handlePlay);this.off(this.player_,"timeupdate",this.seekToLiveEdge);if(this.handleTimeupdate){this.off(this.player_,"timeupdate",this.handleTimeupdate);this.handleTimeupdate=null}};r.stopTracking=function(){if(!this.isTracking()){return}this.reset_()};r.seekableEnd=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.end(a))}return t.length?t.sort()[t.length-1]:1/0};r.seekableStart=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.start(a))}return t.length?t.sort()[0]:0};r.liveWindow=function(){var e=this.liveCurrentTime();if(e===1/0){return 1/0}return e-this.seekableStart()};r.isLive=function(){return this.isTracking()};r.atLiveEdge=function(){return!this.behindLiveEdge()};r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()};r.pastSeekEnd=function(){return this.pastSeekEnd_};r.behindLiveEdge=function(){return this.behindLiveEdge_};r.isTracking=function(){return"number"==typeof this.trackingInterval_};r.seekToLiveEdge=function(){if(this.atLiveEdge()){return}this.player_.currentTime(this.liveCurrentTime());if(this.player_.paused()){this.player_.play()}};r.dispose=function(){this.stopTracking();e.prototype.dispose.call(this)};return a}(Zt);Zt.registerComponent("LiveTracker",Fs);var Hs=function(e){var t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return!0}var a=e.$$("source"),r=[],n="";if(!a.length){return!1}for(var s=0,o;s<a.length;s++){o=a[s].src;if(o&&-1===r.indexOf(o)){r.push(o)}}if(!r.length){return!1}if(1===r.length){n=r[0]}e.triggerSourceset(n);return!0},qs=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(a){var r=t.createElement(this.nodeName.toLowerCase());r.innerHTML=a;var n=t.createDocumentFragment();while(r.childNodes.length){n.appendChild(r.childNodes[0])}this.innerText="";e.Element.prototype.appendChild.call(this,n);return this.innerHTML}}),Vs=function(e,t){for(var a={},r=0;r<e.length;r++){a=Object.getOwnPropertyDescriptor(e[r],t);if(a&&a.set&&a.get){break}}a.enumerable=!0;a.configurable=!0;return a},Ws=function(t){return Vs([t.el(),e.HTMLMediaElement.prototype,e.Element.prototype,qs],"innerHTML")},zs=function(e){var t=e.el();if(t.resetSourceWatch_){return}var a={},r=Ws(e),n=function(a){return function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}var s=a.apply(t,n);Hs(e);return s}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){if(!t[e]){return}a[e]=t[e];t[e]=n(a[e])});Object.defineProperty(t,"innerHTML",ee(r,{set:n(r.set)}));t.resetSourceWatch_=function(){t.resetSourceWatch_=null;Object.keys(a).forEach(function(e){t[e]=a[e]});Object.defineProperty(t,"innerHTML",r)};e.one("sourceset",t.resetSourceWatch_)},Gs=Object.defineProperty({},"src",{get:function(){if(this.hasAttribute("src")){return er(e.Element.prototype.getAttribute.call(this,"src"))}return""},set:function(t){e.Element.prototype.setAttribute.call(this,"src",t);return t}}),$s=function(t){return Vs([t.el(),e.HTMLMediaElement.prototype,Gs],"src")},Ks=function(e){if(!e.featuresSourceset){return}var t=e.el();if(t.resetSourceset_){return}var a=$s(e),r=t.setAttribute,n=t.load;Object.defineProperty(t,"src",ee(a,{set:function(r){var n=a.set.call(t,r);e.triggerSourceset(t.src);return n}}));t.setAttribute=function(a,n){var i=r.call(t,a,n);if(/src/i.test(a)){e.triggerSourceset(t.src)}return i};t.load=function(){var a=n.call(t);if(!Hs(e)){e.triggerSourceset("");zs(e)}return a};if(t.currentSrc){e.triggerSourceset(t.currentSrc)}else if(!Hs(e)){zs(e)}t.resetSourceset_=function(){t.resetSourceset_=null;t.load=n;t.setAttribute=r;Object.defineProperty(t,"src",a);if(t.resetSourceWatch_){t.resetSourceWatch_()}}},Ys=function(a){te(r,a);function r(e,t){var r=a.call(this,e,t)||this;var n=e.source,s=!1;if(n&&(r.el_.currentSrc!==n.src||e.tag&&3===e.tag.initNetworkState_)){r.setSource(n)}else{r.handleLateInit_(r.el_)}if(e.enableSourceset){r.setupSourcesetHandling_()}if(r.el_.hasChildNodes()){var o=r.el_.childNodes,l=o.length,d=[];while(l--){var p=o[l],u=p.nodeName.toLowerCase();if("track"===u){if(!r.featuresNativeTextTracks){d.push(p)}else{r.remoteTextTrackEls().addTrackElement_(p);r.remoteTextTracks().addTrack(p.track);r.textTracks().addTrack(p.track);if(!s&&!r.el_.hasAttribute("crossorigin")&&ar(p.src)){s=!0}}}}for(var c=0;c<d.length;c++){r.el_.removeChild(d[c])}}r.proxyNativeTracks_();if(r.featuresNativeTextTracks&&s){ft.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.")}r.restoreMetadataTracksInIOSNativePlayer_();if((ba||na||pa)&&!0===e.nativeControlsForTouch){r.setControls(!0)}r.proxyWebkitFullscreen_();r.triggerReady();return r}var n=r.prototype;n.dispose=function(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}r.disposeMediaElement(this.el_);this.options_=null;a.prototype.dispose.call(this)};n.setupSourcesetHandling_=function(){Ks(this)};n.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t,a=function(){t=[];for(var a=0,r;a<e.length;a++){r=e[a];if("metadata"===r.kind){t.push({track:r,storedMode:r.mode})}}};a();e.addEventListener("change",a);this.on("dispose",function(){return e.removeEventListener("change",a)});var r=function a(){for(var r=0,n;r<t.length;r++){n=t[r];if("disabled"===n.track.mode&&n.track.mode!==n.storedMode){n.track.mode=n.storedMode}}e.removeEventListener("change",a)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",a);e.removeEventListener("change",r);e.addEventListener("change",r)});this.on("webkitendfullscreen",function(){e.removeEventListener("change",a);e.addEventListener("change",a);e.removeEventListener("change",r)})};n.overrideNative_=function(e,t){var a=this;if(t!==this["featuresNative"+e+"Tracks"]){return}var r=e.toLowerCase();if(this[r+"TracksListeners_"]){Object.keys(this[r+"TracksListeners_"]).forEach(function(e){var t=a.el()[r+"Tracks"];t.removeEventListener(e,a[r+"TracksListeners_"][e])})}this["featuresNative"+e+"Tracks"]=!t;this[r+"TracksListeners_"]=null;this.proxyNativeTracksForType_(r)};n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)};n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)};n.proxyNativeTracksForType_=function(e){var t=this,a=qn[e],r=this.el()[a.getterName],n=this[a.getterName]();if(!this["featuresNative"+a.capitalName+"Tracks"]||!r||!r.addEventListener){return}var i={change:function(){n.trigger({type:"change",target:n,currentTarget:n,srcElement:n})},addtrack:function(t){n.addTrack(t.track)},removetrack:function(t){n.removeTrack(t.track)}},s=function(){for(var e=[],t=0,a;t<n.length;t++){a=!1;for(var s=0;s<r.length;s++){if(r[s]===n[t]){a=!0;break}}if(!a){e.push(n[t])}}while(e.length){n.removeTrack(e.shift())}};this[a.getterName+"Listeners_"]=i;Object.keys(i).forEach(function(e){var a=i[e];r.addEventListener(e,a);t.on("dispose",function(){return r.removeEventListener(e,a)})});this.on("loadstart",s);this.on("dispose",function(){return t.off("loadstart",s)})};n.proxyNativeTracks_=function(){var e=this;qn.names.forEach(function(t){e.proxyNativeTracksForType_(t)})};n.createEl=function(){var e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){var a=e.cloneNode(!0);if(e.parentNode){e.parentNode.insertBefore(a,e)}r.disposeMediaElement(e);e=a}else{e=t.createElement("video");var n=this.options_.tag&&E(this.options_.tag),o=ee({},n);if(!ba||!0!==this.options_.nativeControlsForTouch){delete o.controls}C(e,s(o,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}if("undefined"!=typeof this.options_.preload){I(e,"preload",this.options_.preload)}for(var l=["loop","muted","playsinline","autoplay"],d=0;d<l.length;d++){var p=l[d],u=this.options_[p];if("undefined"!=typeof u){if(u){I(e,p,p)}else{L(e,p)}e[p]=u}}return e};n.handleLateInit_=function(e){if(0===e.networkState||3===e.networkState){return}if(0===e.readyState){var t=!1,a=function(){t=!0};this.on("loadstart",a);var r=function(){if(!t){this.trigger("loadstart")}};this.on("loadedmetadata",r);this.ready(function(){this.off("loadstart",a);this.off("loadedmetadata",r);if(!t){this.trigger("loadstart")}});return}var n=["loadstart","loadedmetadata"];if(2<=e.readyState){n.push("loadeddata")}if(3<=e.readyState){n.push("canplay")}if(4<=e.readyState){n.push("canplaythrough")}this.ready(function(){n.forEach(function(e){this.trigger(e)},this)})};n.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(t){ft(t,"Video is not ready. (Video.js)")}};n.duration=function(){var e=this;if(this.el_.duration===1/0&&la&&ma&&0===this.el_.currentTime){var t=function t(){if(0<e.el_.currentTime){if(e.el_.duration===1/0){e.trigger("durationchange")}e.off("timeupdate",t)}};this.on("timeupdate",t);return NaN}return this.el_.duration||NaN};n.width=function(){return this.el_.offsetWidth};n.height=function(){return this.el_.offsetHeight};n.proxyWebkitFullscreen_=function(){var e=this;if(!("webkitDisplayingFullscreen"in this.el_)){return}var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},a=function(){if("webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode){this.one("webkitendfullscreen",t);this.trigger("fullscreenchange",{isFullscreen:!0})}};this.on("webkitbeginfullscreen",a);this.on("dispose",function(){e.off("webkitbeginfullscreen",a);e.off("webkitendfullscreen",t)})};n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=e.navigator&&e.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t)){return!0}}return!1};n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA){this.el_.play();this.setTimeout(function(){e.pause();e.webkitEnterFullScreen()},0)}else{e.webkitEnterFullScreen()}};n.exitFullScreen=function(){this.el_.webkitExitFullScreen()};n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()};n.src=function(e){if(e===void 0){return this.el_.src}this.setSrc(e)};n.reset=function(){r.resetMediaElement(this.el_)};n.currentSrc=function(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc};n.setControls=function(e){this.el_.controls=!!e};n.addTextTrack=function(e,t,r){if(!this.featuresNativeTextTracks){return a.prototype.addTextTrack.call(this,e,t,r)}return this.el_.addTextTrack(e,t,r)};n.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks){return a.prototype.createRemoteTextTrack.call(this,e)}var r=t.createElement("track");if(e.kind){r.kind=e.kind}if(e.label){r.label=e.label}if(e.language||e.srclang){r.srclang=e.language||e.srclang}if(e["default"]){r["default"]=e["default"]}if(e.id){r.id=e.id}if(e.src){r.src=e.src}return r};n.addRemoteTextTrack=function(e,t){var r=a.prototype.addRemoteTextTrack.call(this,e,t);if(this.featuresNativeTextTracks){this.el().appendChild(r)}return r};n.removeRemoteTextTrack=function(e){a.prototype.removeRemoteTextTrack.call(this,e);if(this.featuresNativeTextTracks){var t=this.$$("track"),r=t.length;while(r--){if(e===t[r]||e===t[r].track){this.el().removeChild(t[r])}}}};n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality){return this.el().getVideoPlaybackQuality()}var t={};if("undefined"!=typeof this.el().webkitDroppedFrameCount&&"undefined"!=typeof this.el().webkitDecodedFrameCount){t.droppedVideoFrames=this.el().webkitDroppedFrameCount;t.totalVideoFrames=this.el().webkitDecodedFrameCount}if(e.performance&&"function"==typeof e.performance.now){t.creationTime=e.performance.now()}else if(e.performance&&e.performance.timing&&"number"==typeof e.performance.timing.navigationStart){t.creationTime=e.Date.now()-e.performance.timing.navigationStart}return t};return r}(ii);if(m()){Ys.TEST_VID=t.createElement("video");var Xs=t.createElement("track");Xs.kind="captions";Xs.srclang="en";Xs.label="English";Ys.TEST_VID.appendChild(Xs)}Ys.isSupported=function(){try{Ys.TEST_VID.volume=.5}catch(t){return!1}return!!(Ys.TEST_VID&&Ys.TEST_VID.canPlayType)};Ys.canPlayType=function(e){return Ys.TEST_VID.canPlayType(e)};Ys.canPlaySource=function(e){return Ys.canPlayType(e.type)};Ys.canControlVolume=function(){try{var e=Ys.TEST_VID.volume;Ys.TEST_VID.volume=e/2+.1;return e!==Ys.TEST_VID.volume}catch(t){return!1}};Ys.canMuteVolume=function(){try{var e=Ys.TEST_VID.muted;Ys.TEST_VID.muted=!e;if(Ys.TEST_VID.muted){I(Ys.TEST_VID,"muted","muted")}else{L(Ys.TEST_VID,"muted","muted")}return e!==Ys.TEST_VID.muted}catch(t){return!1}};Ys.canControlPlaybackRate=function(){if(la&&ma&&58>ga){return!1}try{var e=Ys.TEST_VID.playbackRate;Ys.TEST_VID.playbackRate=e/2+.1;return e!==Ys.TEST_VID.playbackRate}catch(t){return!1}};Ys.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0};Ys.supportsNativeTextTracks=function(){return _a||sa&&ma};Ys.supportsNativeVideoTracks=function(){return!!(Ys.TEST_VID&&Ys.TEST_VID.videoTracks)};Ys.supportsNativeAudioTracks=function(){return!!(Ys.TEST_VID&&Ys.TEST_VID.audioTracks)};Ys.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];Ys.prototype.featuresVolumeControl=Ys.canControlVolume();Ys.prototype.featuresMuteControl=Ys.canMuteVolume();Ys.prototype.featuresPlaybackRate=Ys.canControlPlaybackRate();Ys.prototype.featuresSourceset=Ys.canOverrideAttributes();Ys.prototype.movingMediaElementInDOM=!sa;Ys.prototype.featuresFullscreenResize=!0;Ys.prototype.featuresProgressEvents=!0;Ys.prototype.featuresTimeupdateEvents=!0;Ys.prototype.featuresNativeTextTracks=Ys.supportsNativeTextTracks();Ys.prototype.featuresNativeVideoTracks=Ys.supportsNativeVideoTracks();Ys.prototype.featuresNativeAudioTracks=Ys.supportsNativeAudioTracks();var Qs=Ys.TEST_VID&&Ys.TEST_VID.constructor.prototype.canPlayType,Js=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;Ys.patchCanPlayType=function(){if(4<=da&&!ua&&!ma){Ys.TEST_VID.constructor.prototype.canPlayType=function(e){if(e&&Js.test(e)){return"maybe"}return Qs.call(this,e)}}};Ys.unpatchCanPlayType=function(){var e=Ys.TEST_VID.constructor.prototype.canPlayType;Ys.TEST_VID.constructor.prototype.canPlayType=Qs;return e};Ys.patchCanPlayType();Ys.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};Ys.resetMediaElement=function(e){if(!e){return}var t=e.querySelectorAll("source"),a=t.length;while(a--){e.removeChild(t[a])}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Ys.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Ys.prototype["set"+Qt(e)]=function(t){this.el_[e]=t;if(t){this.el_.setAttribute(e,e)}else{this.el_.removeAttribute(e)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){Ys.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){Ys.prototype["set"+Qt(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){Ys.prototype[e]=function(){return this.el_[e]()}});ii.withSourceHandlers(Ys);Ys.nativeSourceHandler={};Ys.nativeSourceHandler.canPlayType=function(e){try{return Ys.TEST_VID.canPlayType(e)}catch(t){return""}};Ys.nativeSourceHandler.canHandleSource=function(e){if(e.type){return Ys.nativeSourceHandler.canPlayType(e.type)}else if(e.src){var t=tr(e.src);return Ys.nativeSourceHandler.canPlayType("video/"+t)}return""};Ys.nativeSourceHandler.handleSource=function(e,t){t.setSrc(e.src)};Ys.nativeSourceHandler.dispose=function(){};Ys.registerSourceHandler(Ys.nativeSourceHandler);ii.registerTech("Html5",Ys);var Zs=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],eo={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},to=["tiny","xsmall","small","medium","large","xlarge","huge"],ao={};to.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;ao[e]="vjs-layout-"+t});var ro={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},no=function(a){te(r,a);function r(e,t,n){var i;e.id=e.id||t.id||"vjs_video_"+q();t=s(r.getTagSettings(e),t);t.initChildren=!1;t.createEl=!1;t.evented=!1;t.reportTouchActivity=!1;if(!t.language){if("function"==typeof e.closest){var o=e.closest("[lang]");if(o&&o.getAttribute){t.language=o.getAttribute("lang")}}else{var l=e;while(l&&1===l.nodeType){if(E(l).hasOwnProperty("lang")){t.language=l.getAttribute("lang");break}l=l.parentNode}}}i=a.call(this,null,t,n)||this;i.boundDocumentFullscreenChange_=Ut(ie(i),i.documentFullscreenChange_);i.boundFullWindowOnEscKey_=Ut(ie(i),i.fullWindowOnEscKey);i.log=bt(i.id_);i.fsApi_=va;i.isPosterFromTech_=!1;i.queuedCallbacks_=[];i.isReady_=!1;i.hasStarted_=!1;i.userActive_=!1;if(!i.options_||!i.options_.techOrder||!i.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?")}i.tag=e;i.tagAttributes=e&&E(e);i.language(i.options_.language);if(t.languages){var d={};Object.getOwnPropertyNames(t.languages).forEach(function(e){d[e.toLowerCase()]=t.languages[e]});i.languages_=d}else{i.languages_=r.prototype.options_.languages}i.resetCache_();i.poster_=t.poster||"";i.controls_=!!t.controls;e.controls=!1;e.removeAttribute("controls");i.changingSrc_=!1;i.playCallbacks_=[];i.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){i.autoplay(!0)}else{i.autoplay(i.options_.autoplay)}if(t.plugins){Object.keys(t.plugins).forEach(function(e){if("function"!=typeof i[e]){throw new Error("plugin \""+e+"\" does not exist")}})}i.scrubbing_=!1;i.el_=i.createEl();J(ie(i),{eventBusKey:"el_"});if(i.fluid_){i.on("playerreset",i.updateStyleEl_)}var p=ee(i.options_);if(t.plugins){Object.keys(t.plugins).forEach(function(e){i[e](t.plugins[e])})}i.options_.playerOptions=p;i.middleware_=[];i.initChildren();i.isAudio("audio"===e.nodeName.toLowerCase());if(i.controls()){i.addClass("vjs-controls-enabled")}else{i.addClass("vjs-controls-disabled")}i.el_.setAttribute("role","region");if(i.isAudio()){i.el_.setAttribute("aria-label",i.localize("Audio Player"))}else{i.el_.setAttribute("aria-label",i.localize("Video Player"))}if(i.isAudio()){i.addClass("vjs-audio")}if(i.flexNotSupported_()){i.addClass("vjs-no-flex")}if(ba){i.addClass("vjs-touch-enabled")}if(!sa){i.addClass("vjs-workinghover")}r.players[i.id_]=ie(i);var u="7.6.5".split(".")[0];i.addClass("vjs-v"+u);i.userActive(!0);i.reportUserActivity();i.one("play",i.listenForUserActivity_);i.on("stageclick",i.handleStageClick_);i.on("keydown",i.handleKeyDown);i.breakpoints(i.options_.breakpoints);i.responsive(i.options_.responsive);return i}var n=r.prototype;n.dispose=function(){var e=this;this.trigger("dispose");this.off("dispose");K(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);K(t,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}r.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=!1;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}Ye(this);Wn.names.forEach(function(t){var a=Wn[t],r=e[a.getterName]();if(r&&r.off){r.off()}});a.prototype.dispose.call(this)};n.createEl=function(){var r=this.tag,n,s=this.playerElIngest_=r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();if(s){n=this.el_=r.parentNode}else if(!o){n=this.el_=a.prototype.createEl.call(this,"div")}var l=E(r);if(o){n=this.el_=r;r=this.tag=t.createElement("video");while(n.children.length){r.appendChild(n.firstChild)}if(!T(n,"video-js")){v(n,"video-js")}n.appendChild(r);s=this.playerElIngest_=n;Object.keys(n).forEach(function(e){r[e]=n[e]})}r.setAttribute("tabindex","-1");l.tabindex="-1";if(ya||ma&&fa){r.setAttribute("role","application");l.role="application"}r.removeAttribute("width");r.removeAttribute("height");if("width"in l){delete l.width}if("height"in l){delete l.height}Object.getOwnPropertyNames(l).forEach(function(e){if(!(o&&"class"===e)){n.setAttribute(e,l[e])}if(o){r.setAttribute(e,l[e])}});r.playerId=r.id;r.id+="_html5_api";r.className="vjs-tech";r.player=n.player=this;this.addClass("vjs-paused");if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=It("vjs-styles-dimensions");var d=St(".vjs-styles-defaults"),p=St("head");p.insertBefore(this.styleEl_,d?d.nextSibling:p.firstChild)}this.fill_=!1;this.fluid_=!1;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);for(var u=r.getElementsByTagName("a"),c=0,m;c<u.length;c++){m=u.item(c);v(m,"vjs-hidden");m.setAttribute("hidden","hidden")}r.initNetworkState_=r.networkState;if(r.parentNode&&!s){r.parentNode.insertBefore(n,r)}b(r,n);this.children_.unshift(r);this.el_.setAttribute("lang",this.language_);this.el_=n;return n};n.width=function(e){return this.dimension("width",e)};n.height=function(e){return this.dimension("height",e)};n.dimension=function(e,t){var a=e+"_";if(t===void 0){return this[a]||0}if(""===t){this[a]=void 0;this.updateStyleEl_();return}var r=parseFloat(t);if(isNaN(r)){ft.error("Improper value \""+t+"\" supplied for for "+e);return}this[a]=r;this.updateStyleEl_()};n.fluid=function(e){if(e===void 0){return!!this.fluid_}this.fluid_=!!e;if(Ft(this)){this.off("playerreset",this.updateStyleEl_)}if(e){this.addClass("vjs-fluid");this.fill(!1);Ht(function(){this.on("playerreset",this.updateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()};n.fill=function(e){if(e===void 0){return!!this.fill_}this.fill_=!!e;if(e){this.addClass("vjs-fill");this.fluid(!1)}else{this.removeClass("vjs-fill")}};n.aspectRatio=function(e){if(e===void 0){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(e)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=e;this.fluid(!0);this.updateStyleEl_()};n.updateStyleEl_=function(){if(!0===e.VIDEOJS_NO_DYNAMIC_STYLE){var t="number"==typeof this.width_?this.width_:this.options_.width,a="number"==typeof this.height_?this.height_:this.options_.height,r=this.tech_&&this.tech_.el();if(r){if(0<=t){r.width=t}if(0<=a){r.height=a}}return}var n,i,s,o;if(this.aspectRatio_!==void 0&&"auto"!==this.aspectRatio_){s=this.aspectRatio_}else if(0<this.videoWidth()){s=this.videoWidth()+":"+this.videoHeight()}else{s="16:9"}var l=s.split(":"),d=l[1]/l[0];if(this.width_!==void 0){n=this.width_}else if(this.height_!==void 0){n=this.height_/d}else{n=this.videoWidth()||300}if(this.height_!==void 0){i=this.height_}else{i=n*d}if(/^[^a-zA-Z]/.test(this.id())){o="dimensions-"+this.id()}else{o=this.id()+"-dimensions"}this.addClass(o);Lt(this.styleEl_,"\n      ."+o+" {\n        width: "+n+"px;\n        height: "+i+"px;\n      }\n\n      ."+o+".vjs-fluid {\n        padding-top: "+100*d+"%;\n      }\n    ")};n.loadTech_=function(e,t){var a=this;if(this.tech_){this.unloadTech_()}var r=Qt(e),n=e.charAt(0).toLowerCase()+e.slice(1);if("Html5"!==r&&this.tag){ii.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=r;this.isReady_=!1;var i="string"==typeof this.autoplay()?!1:this.autoplay(),o={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+n+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Wn.names.forEach(function(e){var t=Wn[e];o[t.getterName]=a[t.privateName]});s(o,this.options_[r]);s(o,this.options_[n]);s(o,this.options_[e.toLowerCase()]);if(this.tag){o.tag=this.tag}if(t&&t.src===this.cache_.src&&0<this.cache_.currentTime){o.startTime=this.cache_.currentTime}var l=ii.getTech(e);if(!l){throw new Error("No Tech named '"+r+"' exists! '"+r+"' should be registered using videojs.registerTech()'")}this.tech_=new l(o);this.tech_.ready(Ut(this,this.handleTechReady_),!0);Aa.jsonToTextTracks(this.textTracksJson_||[],this.tech_);Zs.forEach(function(e){a.on(a.tech_,e,a["handleTech"+Qt(e)+"_"])});Object.keys(eo).forEach(function(e){a.on(a.tech_,e,function(t){if(0===a.tech_.playbackRate()&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+eo[e]+"_"].bind(a),event:t});return}a["handleTech"+eo[e]+"_"](t)})});this.on(this.tech_,"loadstart",this.handleTechLoadStart_);this.on(this.tech_,"sourceset",this.handleTechSourceset_);this.on(this.tech_,"waiting",this.handleTechWaiting_);this.on(this.tech_,"ended",this.handleTechEnded_);this.on(this.tech_,"seeking",this.handleTechSeeking_);this.on(this.tech_,"play",this.handleTechPlay_);this.on(this.tech_,"firstplay",this.handleTechFirstPlay_);this.on(this.tech_,"pause",this.handleTechPause_);this.on(this.tech_,"durationchange",this.handleTechDurationChange_);this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_);this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_);this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_);this.on(this.tech_,"error",this.handleTechError_);this.on(this.tech_,"loadedmetadata",this.updateStyleEl_);this.on(this.tech_,"posterchange",this.handleTechPosterChange_);this.on(this.tech_,"textdata",this.handleTechTextData_);this.on(this.tech_,"ratechange",this.handleTechRateChange_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&("Html5"!==r||!this.tag)){b(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}};n.unloadTech_=function(){var e=this;Wn.names.forEach(function(t){var a=Wn[t];e[a.privateName]=e[a.getterName]()});this.textTracksJson_=Aa.textTracksToJson(this.tech_);this.isReady_=!1;this.tech_.dispose();this.tech_=!1;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=!1};n.tech=function(e){if(e===void 0){ft.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_};n.addTechControlsListeners_=function(){this.removeTechControlsListeners_();this.on(this.tech_,"mouseup",this.handleTechClick_);this.on(this.tech_,"dblclick",this.handleTechDoubleClick_);this.on(this.tech_,"touchstart",this.handleTechTouchStart_);this.on(this.tech_,"touchmove",this.handleTechTouchMove_);this.on(this.tech_,"touchend",this.handleTechTouchEnd_);this.on(this.tech_,"tap",this.handleTechTap_)};n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_);this.off(this.tech_,"touchstart",this.handleTechTouchStart_);this.off(this.tech_,"touchmove",this.handleTechTouchMove_);this.off(this.tech_,"touchend",this.handleTechTouchEnd_);this.off(this.tech_,"mouseup",this.handleTechClick_);this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)};n.handleTechReady_=function(){this.triggerReady();if(this.cache_.volume){this.techCall_("setVolume",this.cache_.volume)}this.handleTechPosterChange_();this.handleTechDurationChange_()};n.handleTechLoadStart_=function(){this.removeClass("vjs-ended");this.removeClass("vjs-seeking");this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger("loadstart");this.trigger("firstplay")}else{this.hasStarted(!1);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay())};n.manualAutoplay_=function(e){var t=this;if(!this.tech_||"string"!=typeof e){return}var a=function(){var e=t.muted();t.muted(!0);var a=function(){t.muted(e)};t.playTerminatedQueue_.push(a);var r=t.play();if(!ce(r)){return}return r["catch"](a)},r;if("any"===e&&!0!==this.muted()){r=this.play();if(ce(r)){r=r["catch"](a)}}else if("muted"===e&&!0!==this.muted()){r=a()}else{r=this.play()}if(!ce(r)){return}return r.then(function(){t.trigger({type:"autoplay-success",autoplay:e})})["catch"](function(){t.trigger({type:"autoplay-failure",autoplay:e})})};n.updateSourceCaches_=function(e){if(void 0===e){e=""}var t=e,a="";if("string"!=typeof t){t=e.src;a=e.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(t&&!a){a=gi(this,t)}this.cache_.source=ee({},e,{src:t,type:a});for(var r=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),n=[],s=this.$$("source"),o=[],l=0,d;l<s.length;l++){d=E(s[l]);n.push(d);if(d.src&&d.src===t){o.push(d.src)}}if(o.length&&!r.length){this.cache_.sources=n}else if(!r.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=t};n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var a=function(e){return t.updateSourceCaches_(e)},r=this.currentSource().src,n=e.src;if(r&&!/^blob:/.test(r)&&/^blob:/.test(n)){if(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==r){a=function(){}}}a(n);if(!e.src){this.tech_.any(["sourceset","loadstart"],function(a){if("sourceset"===a.type){return}var e=t.techGet("currentSrc");t.lastSource_.tech=e;t.updateSourceCaches_(e)})}}this.lastSource_={player:this.currentSource().src,tech:e.src};this.trigger({src:e.src,type:"sourceset"})};n.hasStarted=function(e){if(e===void 0){return this.hasStarted_}if(e===this.hasStarted_){return}this.hasStarted_=e;if(this.hasStarted_){this.addClass("vjs-has-started");this.trigger("firstplay")}else{this.removeClass("vjs-has-started")}};n.handleTechPlay_=function(){this.removeClass("vjs-ended");this.removeClass("vjs-paused");this.addClass("vjs-playing");this.hasStarted(!0);this.trigger("play")};n.handleTechRateChange_=function(){if(0<this.tech_.playbackRate()&&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")};n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting");this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function a(){if(t!==e.currentTime()){e.removeClass("vjs-waiting");e.off("timeupdate",a)}})};n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting");this.trigger("canplay")};n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")};n.handleTechPlaying_=function(){this.removeClass("vjs-waiting");this.trigger("playing")};n.handleTechSeeking_=function(){this.addClass("vjs-seeking");this.trigger("seeking")};n.handleTechSeeked_=function(){this.removeClass("vjs-seeking");this.removeClass("vjs-ended");this.trigger("seeked")};n.handleTechFirstPlay_=function(){if(this.options_.starttime){ft.warn("Passing the `starttime` option to the player will be deprecated in 6.0");this.currentTime(this.options_.starttime)}this.addClass("vjs-has-started");this.trigger("firstplay")};n.handleTechPause_=function(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.trigger("pause")};n.handleTechEnded_=function(){this.addClass("vjs-ended");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")};n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))};n.handleTechClick_=function(e){if(!j(e)){return}if(!this.controls_){return}if(this.paused()){me(this.play())}else{this.pause()}};n.handleTechDoubleClick_=function(e){if(!this.controls_){return}var t=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)});if(!t){if(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||!1!==this.options_.userActions.doubleClick){if(this.options_!==void 0&&this.options_.userActions!==void 0&&"function"==typeof this.options_.userActions.doubleClick){this.options_.userActions.doubleClick.call(this,e)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}};n.handleTechTap_=function(){this.userActive(!this.userActive())};n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()};n.handleTechTouchMove_=function(){if(this.userWasActive){this.reportUserActivity()}};n.handleTechTouchEnd_=function(e){e.preventDefault()};n.handleStageClick_=function(){this.reportUserActivity()};n.toggleFullscreenClass_=function(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}};n.documentFullscreenChange_=function(){var e=this.el(),a=t[this.fsApi_.fullscreenElement]===e;if(!a&&e.matches){a=e.matches(":"+this.fsApi_.fullscreen)}else if(!a&&e.msMatchesSelector){a=e.msMatchesSelector(":"+this.fsApi_.fullscreen)}this.isFullscreen(a);if(!1===this.isFullscreen()){K(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fsApi_.prefixed){this.trigger("fullscreenchange")}};n.handleTechFullscreenChange_=function(e,t){if(t){this.isFullscreen(t.isFullscreen)}this.trigger("fullscreenchange")};n.togglePictureInPictureClass_=function(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}};n.handleTechEnterPictureInPicture_=function(){this.isInPictureInPicture(!0)};n.handleTechLeavePictureInPicture_=function(){this.isInPictureInPicture(!1)};n.handleTechError_=function(){var e=this.tech_.error();this.error(e)};n.handleTechTextData_=function(){var e=null;if(1<arguments.length){e=arguments[1]}this.trigger("textdata",e)};n.getCache=function(){return this.cache_};n.resetCache_=function(){this.cache_={currentTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}};n.techCall_=function(e,t){this.ready(function(){if(e in pi){return ze(this.middleware_,this.tech_,e,t)}else if(e in ui){return Ge(this.middleware_,this.tech_,e,t)}try{if(this.tech_){this.tech_[e](t)}}catch(t){ft(t);throw t}},!0)};n.techGet_=function(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in di){return We(this.middleware_,this.tech_,t)}else if(t in ui){return Ge(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(a){if(this.tech_[t]===void 0){ft("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",a);throw a}if("TypeError"===a.name){ft("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",a);this.tech_.isReady_=!1;throw a}ft(a);throw a}};n.play=function(){var t=this,a=this.options_.Promise||e.Promise;if(a){return new a(function(e){t.play_(e)})}return this.play_()};n.play_=function(e){var t=this;if(void 0===e){e=me}this.playCallbacks_.push(e);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!a){this.waitToPlay_=function(){t.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!a&&(_a||sa)){this.load()}return}var r=this.techGet_("play");if(null===r){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(r)}};n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];e.forEach(function(e){e()})};n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];t.forEach(function(t){t(e)})};n.pause=function(){this.techCall_("pause")};n.paused=function(){return!1===this.techGet_("paused")?!1:!0};n.played=function(){return this.techGet_("played")||de(0,0)};n.scrubbing=function(e){if("undefined"==typeof e){return this.scrubbing_}this.scrubbing_=!!e;if(e){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}};n.currentTime=function(e){if("undefined"!=typeof e){if(0>e){e=0}this.techCall_("setCurrentTime",e);return}this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime};n.duration=function(e){if(e===void 0){return this.cache_.duration!==void 0?this.cache_.duration:NaN}e=parseFloat(e);if(0>e){e=1/0}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===1/0){this.addClass("vjs-live");if(this.options_.liveui&&this.player_.liveTracker){this.addClass("vjs-liveui")}}else{this.removeClass("vjs-live");this.removeClass("vjs-liveui")}if(!isNaN(e)){this.trigger("durationchange")}}};n.remainingTime=function(){return this.duration()-this.currentTime()};n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())};n.buffered=function e(){var e=this.techGet_("buffered");if(!e||!e.length){e=de(0,0)}return e};n.bufferedPercent=function(){return pe(this.buffered(),this.duration())};n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),a=e.end(e.length-1);if(a>t){a=t}return a};n.volume=function(e){var t;if(e!==void 0){t=Math.max(0,Math.min(1,parseFloat(e)));this.cache_.volume=t;this.techCall_("setVolume",t);if(0<t){this.lastVolume_(t)}return}t=parseFloat(this.techGet_("volume"));return isNaN(t)?1:t};n.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1};n.defaultMuted=function(e){if(e!==void 0){return this.techCall_("setDefaultMuted",e)}return this.techGet_("defaultMuted")||!1};n.lastVolume_=function(e){if(e!==void 0&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume};n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1};n.isFullscreen=function(e){if(e!==void 0){this.isFullscreen_=!!e;this.toggleFullscreenClass_();return}return!!this.isFullscreen_};n.requestFullscreen=function(e){var a;this.isFullscreen(!0);if(this.fsApi_.requestFullscreen){G(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);if(!this.fsApi_.prefixed){a=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(e!==void 0){a=e}}me(this.el_[this.fsApi_.requestFullscreen](a))}else if(this.tech_.supportsFullScreen()){this.techCall_("enterFullScreen")}else{this.enterFullWindow();this.trigger("fullscreenchange")}};n.exitFullscreen=function(){this.isFullscreen(!1);if(this.fsApi_.requestFullscreen){me(t[this.fsApi_.exitFullscreen]())}else if(this.tech_.supportsFullScreen()){this.techCall_("exitFullScreen")}else{this.exitFullWindow();this.trigger("fullscreenchange")}};n.enterFullWindow=function(){this.isFullWindow=!0;this.docOrigOverflow=t.documentElement.style.overflow;G(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow="hidden";v(t.body,"vjs-full-window");this.trigger("enterFullWindow")};n.fullWindowOnEscKey=function(e){if(Da.isEventKey(e,"Esc")){if(!0===this.isFullscreen()){this.exitFullscreen()}else{this.exitFullWindow()}}};n.exitFullWindow=function(){this.isFullWindow=!1;K(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow=this.docOrigOverflow;S(t.body,"vjs-full-window");this.trigger("exitFullWindow")};n.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_};n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in t){return this.techGet_("requestPictureInPicture")}};n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in t){return t.exitPictureInPicture()}};n.handleKeyDown=function(e){var t=this.options_.userActions;if(!t||!t.hotkeys){return}if(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)){return}if("function"==typeof t.hotkeys){t.hotkeys.call(this,e)}else{this.handleHotkeys(e)}};n.handleHotkeys=function(e){var a=this.options_.userActions?this.options_.userActions.hotkeys:{},r=a.fullscreenKey,n=void 0===r?function(e){return Da.isEventKey(e,"f")}:r,i=a.muteKey,s=void 0===i?function(e){return Da.isEventKey(e,"m")}:i,o=a.playPauseKey,l=void 0===o?function(e){return Da.isEventKey(e,"k")||Da.isEventKey(e,"Space")}:o;if(n.call(this,e)){e.preventDefault();e.stopPropagation();var d=Zt.getComponent("FullscreenToggle");if(!1!==t[this.fsApi_.fullscreenEnabled]){d.prototype.handleClick.call(this,e)}}else if(s.call(this,e)){e.preventDefault();e.stopPropagation();var p=Zt.getComponent("MuteToggle");p.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault();e.stopPropagation();var u=Zt.getComponent("PlayToggle");u.prototype.handleClick.call(this,e)}};n.canPlayType=function(e){for(var t,a=0,r=this.options_.techOrder;a<r.length;a++){var n=r[a],s=ii.getTech(n);if(!s){s=Zt.getComponent(n)}if(!s){ft.error("The \""+n+"\" tech is undefined. Skipped browser support check for that tech.");continue}if(s.isSupported()){t=s.canPlayType(e);if(t){return t}}}return""};n.selectSource=function(e){var t=this,a=this.options_.techOrder.map(function(e){return[e,ii.getTech(e)]}).filter(function(e){var t=e[0],a=e[1];if(a){return a.isSupported()}ft.error("The \""+t+"\" tech is undefined. Skipped browser support check for that tech.");return!1}),r=function(e,t,a){var r;e.some(function(e){return t.some(function(t){r=a(e,t);if(r){return!0}})});return r},n,i=function(e){return function(t,a){return e(a,t)}},s=function(e,a){var r=e[0],n=e[1];if(n.canPlaySource(a,t.options_[r.toLowerCase()])){return{source:a,tech:r}}};if(this.options_.sourceOrder){n=r(e,a,i(s))}else{n=r(a,e,s)}return n||!1};n.src=function(e){var t=this;if("undefined"==typeof e){return this.cache_.src||""}var a=yi(e);if(!a.length){this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);return}this.changingSrc_=!0;this.cache_.sources=a;this.updateSourceCaches_(a[0]);qe(this,a[0],function(e,r){t.middleware_=r;t.cache_.sources=a;t.updateSourceCaches_(e);var n=t.src_(e);if(n){if(1<a.length){return t.src(a.slice(1))}t.changingSrc_=!1;t.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);t.triggerReady();return}Ve(r,t.tech_)})};n.src_=function(e){var t=this,a=this.selectSource([e]);if(!a){return!0}if(!Jt(a.tech,this.techName_)){this.changingSrc_=!0;this.loadTech_(a.tech,a.source);this.tech_.ready(function(){t.changingSrc_=!1});return!1}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",e)}else{this.techCall_("src",e.src)}this.changingSrc_=!1},!0);return!1};n.load=function(){this.techCall_("load")};n.reset=function(){var t=this,a=this.options_.Promise||e.Promise;if(this.paused()||!a){this.doReset_()}else{var r=this.play();me(r.then(function(){return t.doReset_()}))}};n.doReset_=function(){if(this.tech_){this.tech_.clearTracks("text")}this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();if(Ft(this)){this.trigger("playerreset")}};n.resetControlBarUI_=function(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()};n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,a=e.remainingTimeDisplay;if(t){t.updateContent()}if(a){a.updateContent()}};n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()};n.resetVolumeBar_=function(){this.volume(1);this.trigger("volumechange")};n.currentSources=function(){var e=this.currentSource(),t=[];if(0!==Object.keys(e).length){t.push(e)}return this.cache_.sources||t};n.currentSource=function(){return this.cache_.source||{}};n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""};n.currentType=function(){return this.currentSource()&&this.currentSource().type||""};n.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e);this.options_.preload=e;return}return this.techGet_("preload")};n.autoplay=function(e){if(e===void 0){return this.options_.autoplay||!1}var t;if("string"==typeof e&&/(any|play|muted)/.test(e)){this.options_.autoplay=e;this.manualAutoplay_(e);t=!1}else if(!e){this.options_.autoplay=!1}else{this.options_.autoplay=!0}t="undefined"==typeof t?this.options_.autoplay:t;if(this.tech_){this.techCall_("setAutoplay",t)}};n.playsinline=function(e){if(e!==void 0){this.techCall_("setPlaysinline",e);this.options_.playsinline=e;return this}return this.techGet_("playsinline")};n.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e);this.options_.loop=e;return}return this.techGet_("loop")};n.poster=function(e){if(e===void 0){return this.poster_}if(!e){e=""}if(e===this.poster_){return}this.poster_=e;this.techCall_("setPoster",e);this.isPosterFromTech_=!1;this.trigger("posterchange")};n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";if(e!==this.poster_){this.poster_=e;this.isPosterFromTech_=!0;this.trigger("posterchange")}}};n.controls=function(e){if(e===void 0){return!!this.controls_}e=!!e;if(this.controls_===e){return}this.controls_=e;if(this.usingNativeControls()){this.techCall_("setControls",e)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}};n.usingNativeControls=function(e){if(e===void 0){return!!this.usingNativeControls_}e=!!e;if(this.usingNativeControls_===e){return}this.usingNativeControls_=e;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}};n.error=function(e){if(e===void 0){return this.error_||null}if(this.options_.suppressNotSupportedError&&e&&e.message&&e.message===this.localize(this.options_.notSupportedMessage)){var t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1;this.any(["click","touchstart"],t);this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(null===e){this.error_=e;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new ue(e);this.addClass("vjs-error");ft.error("(CODE:"+this.error_.code+" "+ue.errorTypes[this.error_.code]+")",this.error_.message,this.error_);this.trigger("error")};n.reportUserActivity=function(){this.userActivity_=!0};n.userActive=function(e){if(e===void 0){return this.userActive_}e=!!e;if(e===this.userActive_){return}this.userActive_=e;if(this.userActive_){this.userActivity_=!0;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(t){t.stopPropagation();t.preventDefault()})}this.userActivity_=!1;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")};n.listenForUserActivity_=function(){var e,t,a,r=Ut(this,this.reportUserActivity),n=function(n){if(n.screenX!==t||n.screenY!==a){t=n.screenX;a=n.screenY;r()}},i=function(){r();this.clearInterval(e);e=this.setInterval(r,250)},s=function(){r();this.clearInterval(e)};this.on("mousedown",i);this.on("mousemove",n);this.on("mouseup",s);var o=this.getChild("controlBar");if(o&&!sa&&!la){o.on("mouseenter",function(){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout;this.player().options_.inactivityTimeout=0});o.on("mouseleave",function(){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",r);this.on("keyup",r);var l;this.setInterval(function(){if(!this.userActivity_){return}this.userActivity_=!1;this.userActive(!0);this.clearTimeout(l);var e=this.options_.inactivityTimeout;if(0>=e){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(!1)}},e)},250)};n.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1};n.defaultPlaybackRate=function(e){if(e!==void 0){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1};n.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_};n.addTextTrack=function(e,t,a){if(this.tech_){return this.tech_.addTextTrack(e,t,a)}};n.addRemoteTextTrack=function(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}};n.removeRemoteTextTrack=function(e){if(void 0===e){e={}}var t=e,a=t.track;if(!a){a=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(a)}};n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")};n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0};n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0};n.language=function(e){if(e===void 0){return this.language_}this.language_=(e+"").toLowerCase()};n.languages=function(){return ee(r.prototype.options_.languages,this.languages_)};n.toJSON=function(){var e=ee(this.options_),t=e.tracks;e.tracks=[];for(var a=0,r;a<t.length;a++){r=t[a];r=ee(r);r.player=void 0;e.tracks[a]=r}return e};n.createModal=function(e,t){var a=this;t=t||{};t.content=e||"";var r=new Ba(this,t);this.addChild(r);r.on("dispose",function(){a.removeChild(r)});r.open();return r};n.updateCurrentBreakpoint_=function(){if(!this.responsive()){return}for(var e=this.currentBreakpoint(),t=this.currentWidth(),a=0;a<to.length;a++){var r=to[a],n=this.breakpoints_[r];if(t<=n){if(e===r){return}if(e){this.removeClass(ao[e])}this.addClass(ao[r]);this.breakpoint_=r;break}}};n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="";if(e){this.removeClass(e)}};n.breakpoints=function(e){if(e===void 0){return s(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=s({},ro,e);this.updateCurrentBreakpoint_();return s(this.breakpoints_)};n.responsive=function(e){if(e===void 0){return this.responsive_}e=!!e;var t=this.responsive_;if(e===t){return}this.responsive_=e;if(e){this.on("playerresize",this.updateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.updateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return e};n.currentBreakpoint=function(){return this.breakpoint_};n.currentBreakpointClass=function(){return ao[this.breakpoint_]||""};n.loadMedia=function(e,t){var a=this;if(!e||"object"!==_typeof(e)){return}this.reset();this.cache_.media=ee(e);var r=this.cache_.media,n=r.artwork,i=r.poster,s=r.src,o=r.textTracks;if(!n&&i){this.cache_.media.artwork=[{src:i,type:mi(i)}]}if(s){this.src(s)}if(i){this.poster(i)}if(Array.isArray(o)){o.forEach(function(e){return a.addRemoteTextTrack(e,!1)})}this.ready(t)};n.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}),r={src:t,textTracks:a};if(e){r.poster=e;r.artwork=[{src:r.poster,type:mi(r.poster)}]}return r}return ee(this.cache_.media)};r.getTagSettings=function(e){var t={sources:[],tracks:[]},a=E(e),r=a["data-setup"];if(T(e,"vjs-fill")){a.fill=!0}if(T(e,"vjs-fluid")){a.fluid=!0}if(null!==r){var n=La(r||"{}"),o=n[0],l=n[1];if(o){ft.error(o)}s(a,l)}s(t,a);if(e.hasChildNodes()){for(var d=e.childNodes,p=0,u=d.length;p<u;p++){var c=d[p],m=c.nodeName.toLowerCase();if("source"===m){t.sources.push(E(c))}else if("track"===m){t.tracks.push(E(c))}}}return t};n.flexNotSupported_=function(){var e=t.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)};return r}(Zt);Wn.names.forEach(function(e){var t=Wn[e];no.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});no.players={};var io=e.navigator;no.prototype.options_={techOrder:ii.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:io&&(io.languages&&io.languages[0]||io.userLanguage||io.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(e){no.prototype[e]=function(){return this.techGet_(e)}});Zs.forEach(function(e){no.prototype["handleTech"+Qt(e)+"_"]=function(){return this.trigger(e)}});Zt.registerComponent("Player",no);var so="activePlugins_",oo={},lo=function(e){return oo.hasOwnProperty(e)},po=function(e){return lo(e)?oo[e]:void 0},uo=function(e,t){e[so]=e[so]||{};e[so][t]=!0},co=function(e,t,a){var r=(a?"before":"")+"pluginsetup";e.trigger(r,t);e.trigger(r+":"+t.name,t)},mo=function(e,t){var a=function(){co(this,{name:e,plugin:t,instance:null},!0);var a=t.apply(this,arguments);uo(this,e);co(this,{name:e,plugin:t,instance:a});return a};Object.keys(t).forEach(function(e){a[e]=t[e]});return a},go=function(e,t){t.prototype.name=e;return function(){co(this,{name:e,plugin:t,instance:null},!0);for(var a=arguments.length,r=Array(a),n=0;n<a;n++){r[n]=arguments[n]}var i=ne(t,[this].concat(r));this[e]=function(){return i};co(this,i.getEventHash());return i}},yo=function(){function e(t){if(this.constructor===e){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=t;J(this);delete this.trigger;Z(this,this.constructor.defaultState);uo(t,this.name);this.dispose=Ut(this,this.dispose);t.on("dispose",this.dispose)}var t=e.prototype;t.version=function(){return this.constructor.VERSION};t.getEventHash=function(e){if(void 0===e){e={}}e.name=this.name;e.plugin=this.constructor;e.instance=this;return e};t.trigger=function(e,t){if(void 0===t){t={}}return Y(this.eventBusEl_,e,this.getEventHash(t))};t.handleStateChanged=function(){};t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose");this.off();t.off("dispose",this.dispose);t[so][e]=!1;this.player=this.state=null;t[e]=go(e,oo[e])};e.isBasic=function(t){var a="string"==typeof t?po(t):t;return"function"==typeof a&&!e.prototype.isPrototypeOf(a.prototype)};e.registerPlugin=function(t,a){if("string"!=typeof t){throw new Error("Illegal plugin name, \""+t+"\", must be a string, was "+_typeof(t)+".")}if(lo(t)){ft.warn("A plugin named \""+t+"\" already exists. You may want to avoid re-registering plugins!")}else if(no.prototype.hasOwnProperty(t)){throw new Error("Illegal plugin name, \""+t+"\", cannot share a name with an existing player method!")}if("function"!=typeof a){throw new Error("Illegal plugin for \""+t+"\", must be a function, was "+_typeof(a)+".")}oo[t]=a;if(t!=="plugin"){if(e.isBasic(a)){no.prototype[t]=mo(t,a)}else{no.prototype[t]=go(t,a)}}return a};e.deregisterPlugin=function(e){if(e==="plugin"){throw new Error("Cannot de-register base plugin.")}if(lo(e)){delete oo[e];delete no.prototype[e]}};e.getPlugins=function(e){if(void 0===e){e=Object.keys(oo)}var t;e.forEach(function(e){var a=po(e);if(a){t=t||{};t[e]=a}});return t};e.getPluginVersion=function(e){var t=po(e);return t&&t.VERSION||""};return e}();yo.getPlugin=po;yo.BASE_PLUGIN_NAME="plugin";yo.registerPlugin("plugin",yo);no.prototype.usingPlugin=function(e){return!!this[so]&&!0===this[so][e]};no.prototype.hasPlugin=function(e){return!!lo(e)};var ho=function(e,t){if("function"!=typeof t&&null!==t){throw new TypeError("Super expression must either be null or a function, not "+_typeof(t))}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});if(t){e.super_=t}},_o=function(e,t){if(void 0===t){t={}}var a=function(){e.apply(this,arguments)},r={};if("object"===_typeof(t)){if(t.constructor!==Object.prototype.constructor){a=t.constructor}r=t}else if("function"==typeof t){a=t}ho(a,e);for(var n in r){if(r.hasOwnProperty(n)){a.prototype[n]=r[n]}}return a},fo=function(e){return 0===e.indexOf("#")?e.slice(1):e};function it(e,t,a){var r=it.getPlayer(e);if(r){if(t){ft.warn("Player \""+e+"\" is already initialised. Options will not be applied.")}if(a){r.ready(a)}return r}var n="string"==typeof e?St("#"+fo(e)):e;if(!g(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}if(!n.ownerDocument.defaultView||!n.ownerDocument.body.contains(n)){ft.warn("The element supplied is not included in the DOM")}t=t||{};it.hooks("beforesetup").forEach(function(e){var a=e(n,ee(t));if(!o(a)||Array.isArray(a)){ft.error("please return an object in beforesetup hooks");return}t=ee(t,a)});var i=Zt.getComponent("Player");r=new i(n,t,a);it.hooks("setup").forEach(function(e){return e(r)});return r}it.hooks_={};it.hooks=function(e,t){it.hooks_[e]=it.hooks_[e]||[];if(t){it.hooks_[e]=it.hooks_[e].concat(t)}return it.hooks_[e]};it.hook=function(e,t){it.hooks(e,t)};it.hookOnce=function(e,t){it.hooks(e,[].concat(t).map(function(t){return function a(){it.removeHook(e,a);return t.apply(void 0,arguments)}}))};it.removeHook=function(e,t){var a=it.hooks(e).indexOf(t);if(-1>=a){return!1}it.hooks_[e]=it.hooks_[e].slice();it.hooks_[e].splice(a,1);return!0};if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE&&m()){var bo=St(".vjs-styles-defaults");if(!bo){bo=It("vjs-styles-defaults");var To=St("head");if(To){To.insertBefore(bo,To.firstChild)}Lt(bo,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}F(1,it);it.VERSION="7.6.5";it.options=no.prototype.options_;it.getPlayers=function(){return no.players};it.getPlayer=function(e){var t=no.players,a;if("string"==typeof e){var r=fo(e),n=t[r];if(n){return n}a=St("#"+r)}else{a=e}if(g(a)){var i=a,s=i.player,o=i.playerId;if(s||t[o]){return s||t[o]}}};it.getAllPlayers=function(){return Object.keys(no.players).map(function(e){return no.players[e]}).filter(Boolean)};it.players=no.players;it.getComponent=Zt.getComponent;it.registerComponent=function(e,t){if(ii.isTech(t)){ft.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)")}Zt.registerComponent.call(Zt,e,t)};it.getTech=ii.getTech;it.registerTech=ii.registerTech;it.use=function(e,t){si[e]=si[e]||[];si[e].push(t)};Object.defineProperty(it,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(it.middleware,"TERMINATOR",{value:li,writeable:!1,enumerable:!0});it.browser=Ta;it.TOUCH_ENABLED=ba;it.extend=_o;it.mergeOptions=ee;it.bind=Ut;it.registerPlugin=yo.registerPlugin;it.deregisterPlugin=yo.deregisterPlugin;it.plugin=function(e,t){ft.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return yo.registerPlugin(e,t)};it.getPlugins=yo.getPlugins;it.getPlugin=yo.getPlugin;it.getPluginVersion=yo.getPluginVersion;it.addLanguage=function(e,t){var a;e=(""+e).toLowerCase();it.options.languages=ee(it.options.languages,(a={},a[e]=t,a));return it.options.languages[e]};it.log=ft;it.createLogger=bt;it.createTimeRange=it.createTimeRanges=de;it.formatTime=tt;it.setFormatTime=function(e){xi=e};it.resetFormatTime=function(){xi=Li};it.parseUrl=Za;it.isCrossOrigin=ar;it.EventTarget=Bt;it.on=G;it.one=X;it.off=K;it.trigger=Y;it.xhr=On;it.TextTrack=Mn;it.AudioTrack=Nn;it.VideoTrack=Bn;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){it[e]=function(){ft.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead");return kt[e].apply(null,arguments)}});it.computedStyle=d;it.dom=kt;it.url=rr;var vo=ge(function(e){(function(){var t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,i={buildAbsoluteURL:function(e,t,r){r=r||{};e=e.trim();t=t.trim();if(!t){if(!r.alwaysNormalize){return e}var n=i.parseURL(e);if(!n){throw new Error("Error trying to parse base URL.")}n.path=i.normalizePath(n.path);return i.buildURLFromParts(n)}var s=i.parseURL(t);if(!s){throw new Error("Error trying to parse relative URL.")}if(s.scheme){if(!r.alwaysNormalize){return t}s.path=i.normalizePath(s.path);return i.buildURLFromParts(s)}var o=i.parseURL(e);if(!o){throw new Error("Error trying to parse base URL.")}if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=a.exec(o.path);o.netLoc=l[1];o.path=l[2]}if(o.netLoc&&!o.path){o.path="/"}var d={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc){d.netLoc=o.netLoc;if("/"!==s.path[0]){if(!s.path){d.path=o.path;if(!s.params){d.params=o.params;if(!s.query){d.query=o.query}}}else{var p=o.path,u=p.substring(0,p.lastIndexOf("/")+1)+s.path;d.path=i.normalizePath(u)}}}if(null===d.path){d.path=r.alwaysNormalize?i.normalizePath(s.path):s.path}return i.buildURLFromParts(d)},parseURL:function(e){var a=t.exec(e);if(!a){return null}return{scheme:a[1]||"",netLoc:a[2]||"",path:a[3]||"",params:a[4]||"",query:a[5]||"",fragment:a[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(r,"");while(e.length!==(e=e.replace(n,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=i})()});function st(){st=Object.assign||function(e){for(var t=1,a;t<arguments.length;t++){a=arguments[t];for(var r in a){if(Object.prototype.hasOwnProperty.call(a,r)){e[r]=a[r]}}}return e};return st.apply(this,arguments)}function ot(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function lt(e){if(void 0===e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}var So=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};t.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1<a};t.trigger=function(e){var t=this.listeners[e],a,r,n;if(!t){return}if(2===arguments.length){r=t.length;for(a=0;a<r;++a){t[a].call(this,arguments[1])}}else{n=Array.prototype.slice.call(arguments,1);r=t.length;for(a=0;a<r;++a){t[a].apply(this,n)}}};t.dispose=function(){this.listeners={}};t.pipe=function(e){this.on("data",function(t){e.push(t)})};return e}(),ko=function(e){ot(t,e);function t(){var t=e.call(this)||this;t.buffer="";return t}var a=t.prototype;a.push=function(e){var t;this.buffer+=e;t=this.buffer.indexOf("\n");for(;-1<t;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}};return t}(So),Co=function(){return new RegExp("(?:^|,)("+("(?:[^=]*)=(?:"+"\"[^\"]*\"|[^,]*"+")")+")")},Eo=function(e){var t=e.split(Co()),a={},r=t.length,n;while(r--){if(""===t[r]){continue}n=/([^=]*)=(.*)/.exec(t[r]).slice(1);n[0]=n[0].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1");a[n[0]]=n[1]}return a},Po=function(e){ot(t,e);function t(){var t=e.call(this)||this;t.customParsers=[];t.tagMappers=[];return t}var a=t.prototype;a.push=function(e){var t=this,a,r;e=e.trim();if(0===e.length){return}if("#"!==e[0]){this.trigger("data",{type:"uri",uri:e});return}var n=this.tagMappers.reduce(function(t,a){var r=a(e);if(r===e){return t}return t.concat([r])},[e]);n.forEach(function(e){for(var n=0;n<t.customParsers.length;n++){if(t.customParsers[n].call(t,e)){return}}if(0!==e.indexOf("#EXT")){t.trigger("data",{type:"comment",text:e.slice(1)});return}e=e.replace("\r","");a=/^#EXTM3U/.exec(e);if(a){t.trigger("data",{type:"tag",tagType:"m3u"});return}a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e);if(a){r={type:"tag",tagType:"inf"};if(a[1]){r.duration=parseFloat(a[1])}if(a[2]){r.title=a[2]}t.trigger("data",r);return}a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"targetduration"};if(a[1]){r.duration=parseInt(a[1],10)}t.trigger("data",r);return}a=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"totalduration"};if(a[1]){r.duration=parseInt(a[1],10)}t.trigger("data",r);return}a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"version"};if(a[1]){r.version=parseInt(a[1],10)}t.trigger("data",r);return}a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"media-sequence"};if(a[1]){r.number=parseInt(a[1],10)}t.trigger("data",r);return}a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"discontinuity-sequence"};if(a[1]){r.number=parseInt(a[1],10)}t.trigger("data",r);return}a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e);if(a){r={type:"tag",tagType:"playlist-type"};if(a[1]){r.playlistType=a[1]}t.trigger("data",r);return}a=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e);if(a){r={type:"tag",tagType:"byterange"};if(a[1]){r.length=parseInt(a[1],10)}if(a[2]){r.offset=parseInt(a[2],10)}t.trigger("data",r);return}a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e);if(a){r={type:"tag",tagType:"allow-cache"};if(a[1]){r.allowed=!/NO/.test(a[1])}t.trigger("data",r);return}a=/^#EXT-X-MAP:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"map"};if(a[1]){var s=Eo(a[1]);if(s.URI){r.uri=s.URI}if(s.BYTERANGE){var o=s.BYTERANGE.split("@"),l=o[0],d=o[1];r.byterange={};if(l){r.byterange.length=parseInt(l,10)}if(d){r.byterange.offset=parseInt(d,10)}}}t.trigger("data",r);return}a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"stream-inf"};if(a[1]){r.attributes=Eo(a[1]);if(r.attributes.RESOLUTION){var p=r.attributes.RESOLUTION.split("x"),u={};if(p[0]){u.width=parseInt(p[0],10)}if(p[1]){u.height=parseInt(p[1],10)}r.attributes.RESOLUTION=u}if(r.attributes.BANDWIDTH){r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)}if(r.attributes["PROGRAM-ID"]){r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10)}}t.trigger("data",r);return}a=/^#EXT-X-MEDIA:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"media"};if(a[1]){r.attributes=Eo(a[1])}t.trigger("data",r);return}a=/^#EXT-X-ENDLIST/.exec(e);if(a){t.trigger("data",{type:"tag",tagType:"endlist"});return}a=/^#EXT-X-DISCONTINUITY/.exec(e);if(a){t.trigger("data",{type:"tag",tagType:"discontinuity"});return}a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"program-date-time"};if(a[1]){r.dateTimeString=a[1];r.dateTimeObject=new Date(a[1])}t.trigger("data",r);return}a=/^#EXT-X-KEY:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"key"};if(a[1]){r.attributes=Eo(a[1]);if(r.attributes.IV){if("0x"===r.attributes.IV.substring(0,2).toLowerCase()){r.attributes.IV=r.attributes.IV.substring(2)}r.attributes.IV=r.attributes.IV.match(/.{8}/g);r.attributes.IV[0]=parseInt(r.attributes.IV[0],16);r.attributes.IV[1]=parseInt(r.attributes.IV[1],16);r.attributes.IV[2]=parseInt(r.attributes.IV[2],16);r.attributes.IV[3]=parseInt(r.attributes.IV[3],16);r.attributes.IV=new Uint32Array(r.attributes.IV)}}t.trigger("data",r);return}a=/^#EXT-X-START:?(.*)$/.exec(e);if(a){r={type:"tag",tagType:"start"};if(a[1]){r.attributes=Eo(a[1]);r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]);r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)}t.trigger("data",r);return}a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e);if(a){r={type:"tag",tagType:"cue-out-cont"};if(a[1]){r.data=a[1]}else{r.data=""}t.trigger("data",r);return}a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e);if(a){r={type:"tag",tagType:"cue-out"};if(a[1]){r.data=a[1]}else{r.data=""}t.trigger("data",r);return}a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e);if(a){r={type:"tag",tagType:"cue-in"};if(a[1]){r.data=a[1]}else{r.data=""}t.trigger("data",r);return}t.trigger("data",{type:"tag",data:e.slice(4)})})};a.addParser=function(e){var t=this,a=e.expression,r=e.customType,n=e.dataParser,i=e.segment;if("function"!=typeof n){n=function(e){return e}}this.customParsers.push(function(e){var s=a.exec(e);if(s){t.trigger("data",{type:"custom",data:n(e),customType:r,segment:i});return!0}})};a.addTagMapper=function(e){var t=e.expression,a=e.map;this.tagMappers.push(function(e){if(t.test(e)){return a(e)}return e})};return t}(So);function dt(t){for(var a=e.atob(t||""),r=new Uint8Array(a.length),n=0;n<a.length;n++){r[n]=a.charCodeAt(n)}return r}var Io=function(e){ot(t,e);function t(){var t=e.call(this)||this;t.lineStream=new ko;t.parseStream=new Po;t.lineStream.pipe(t.parseStream);var a=lt(t),r=[],n={},i,s,o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};t.parseStream.on("data",function(e){var t,p;({tag:function(){(({"allow-cache":function(){this.manifest.allowCache=e.allowed;if(!("allowed"in e)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=!0}},byterange:function t(){var t={};if("length"in e){n.byterange=t;t.length=e.length;if(!("offset"in e)){this.trigger("info",{message:"defaulting offset to zero"});e.offset=0}}if("offset"in e){n.byterange=t;t.offset=e.offset}},endlist:function(){this.manifest.endList=!0},inf:function(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(0<e.duration){n.duration=e.duration}if(0===e.duration){n.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=r},key:function(){if(!e.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if("NONE"===e.attributes.METHOD){s=null;return}if(!e.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(e.attributes.KEYFORMAT==="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"){if(-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if("SAMPLE-AES-CENC"===e.attributes.METHOD){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if("data:text/plain;base64,"!==e.attributes.URI.substring(0,23)){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2))){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:dt(e.attributes.URI.split(",")[1])}};return}if(!e.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}s={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI};if("undefined"!=typeof e.attributes.IV){s.iv=e.attributes.IV}},"media-sequence":function(){if(!isFinite(e.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});return}this.manifest.discontinuitySequence=e.number;d=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});return}this.manifest.playlistType=e.playlistType},map:function(){i={};if(e.uri){i.uri=e.uri}if(e.byterange){i.byterange=e.byterange}},"stream-inf":function(){this.manifest.playlists=r;this.manifest.mediaGroups=this.manifest.mediaGroups||l;if(!e.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!n.attributes){n.attributes={}}st(n.attributes,e.attributes)},media:function(){this.manifest.mediaGroups=this.manifest.mediaGroups||l;if(!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var a=this.manifest.mediaGroups[e.attributes.TYPE];a[e.attributes["GROUP-ID"]]=a[e.attributes["GROUP-ID"]]||{};t=a[e.attributes["GROUP-ID"]];p={default:/yes/i.test(e.attributes.DEFAULT)};if(p["default"]){p.autoselect=!0}else{p.autoselect=/yes/i.test(e.attributes.AUTOSELECT)}if(e.attributes.LANGUAGE){p.language=e.attributes.LANGUAGE}if(e.attributes.URI){p.uri=e.attributes.URI}if(e.attributes["INSTREAM-ID"]){p.instreamId=e.attributes["INSTREAM-ID"]}if(e.attributes.CHARACTERISTICS){p.characteristics=e.attributes.CHARACTERISTICS}if(e.attributes.FORCED){p.forced=/yes/i.test(e.attributes.FORCED)}t[e.attributes.NAME]=p},discontinuity:function(){d+=1;n.discontinuity=!0;this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){if("undefined"==typeof this.manifest.dateTimeString){this.manifest.dateTimeString=e.dateTimeString;this.manifest.dateTimeObject=e.dateTimeObject}n.dateTimeString=e.dateTimeString;n.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||0>e.duration){this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});return}this.manifest.targetDuration=e.duration},totalduration:function(){if(!isFinite(e.duration)||0>e.duration){this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration});return}this.manifest.totalDuration=e.duration},start:function(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function(){n.cueOut=e.data},"cue-out-cont":function(){n.cueOutCont=e.data},"cue-in":function(){n.cueIn=e.data}})[e.tagType]||o).call(a)},uri:function(){n.uri=e.uri;r.push(n);if(this.manifest.targetDuration&&!("duration"in n)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});n.duration=this.manifest.targetDuration}if(s){n.key=s}n.timeline=d;if(i){n.map=i}n={}},comment:function(){},custom:function(){if(e.segment){n.custom=n.custom||{};n.custom[e.customType]=e.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[e.customType]=e.data}}})[e.type].call(a)});return t}var a=t.prototype;a.push=function(e){this.lineStream.push(e)};a.end=function(){this.lineStream.push("\n")};a.addParser=function(e){this.parseStream.addParser(e)};a.addTagMapper=function(e){this.parseStream.addTagMapper(e)};return t}(So),Lo=function(e){return!!e&&"object"===_typeof(e)},xo=function e(){for(var t=arguments.length,a=Array(t),r=0;r<t;r++){a[r]=arguments[r]}return a.reduce(function(t,a){Object.keys(a).forEach(function(r){if(Array.isArray(t[r])&&Array.isArray(a[r])){t[r]=t[r].concat(a[r])}else if(Lo(t[r])&&Lo(a[r])){t[r]=e(t[r],a[r])}else{t[r]=a[r]}});return t},{})},Ao=function(e){return Object.keys(e).map(function(t){return e[t]})},Do=function(e,t){for(var a=[],r=e;r<t;r++){a.push(r)}return a},wo=function(e){return e.reduce(function(e,t){return e.concat(t)},[])},Oo=function(e){if(!e.length){return[]}for(var t=[],a=0;a<e.length;a++){t.push(e[a])}return t},Ro=function(e,t){return e.reduce(function(r,a,e){if(a[t]){r.push(e)}return r},[])},Uo={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};var Mo=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){(function(){var t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,i={buildAbsoluteURL:function(e,t,r){r=r||{};e=e.trim();t=t.trim();if(!t){if(!r.alwaysNormalize){return e}var n=i.parseURL(e);if(!n){throw new Error("Error trying to parse base URL.")}n.path=i.normalizePath(n.path);return i.buildURLFromParts(n)}var s=i.parseURL(t);if(!s){throw new Error("Error trying to parse relative URL.")}if(s.scheme){if(!r.alwaysNormalize){return t}s.path=i.normalizePath(s.path);return i.buildURLFromParts(s)}var o=i.parseURL(e);if(!o){throw new Error("Error trying to parse base URL.")}if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=a.exec(o.path);o.netLoc=l[1];o.path=l[2]}if(o.netLoc&&!o.path){o.path="/"}var d={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc){d.netLoc=o.netLoc;if("/"!==s.path[0]){if(!s.path){d.path=o.path;if(!s.params){d.params=o.params;if(!s.query){d.query=o.query}}}else{var p=o.path,u=p.substring(0,p.lastIndexOf("/")+1)+s.path;d.path=i.normalizePath(u)}}}if(null===d.path){d.path=r.alwaysNormalize?i.normalizePath(s.path):s.path}return i.buildURLFromParts(d)},parseURL:function(e){var a=t.exec(e);if(!a){return null}return{scheme:a[1]||"",netLoc:a[2]||"",path:a[3]||"",params:a[4]||"",query:a[5]||"",fragment:a[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(r,"");while(e.length!==(e=e.replace(n,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=i})()}),No=function(t,a){if(/^[a-z]+:/i.test(a)){return a}if(!/\/\//i.test(t)){t=Mo.buildAbsoluteURL(e.location.href,t)}return Mo.buildAbsoluteURL(t,a)},Bo=function(e){var t=e.baseUrl,a=void 0===t?"":t,r=e.source,n=void 0===r?"":r,i=e.range,s=void 0===i?"":i,o=e.indexRange,l=void 0===o?"":o,d={uri:n,resolvedUri:No(a||"",n)};if(s||l){var p=s?s:l,u=p.split("-"),c=parseInt(u[0],10),m=parseInt(u[1],10);d.byterange={length:m-c+1,offset:c}}return d},jo=function(e){var t=e.offset+e.length-1;return e.offset+"-"+t},Fo={static:function(e){var t=e.duration,a=e.timescale,r=void 0===a?1:a,n=e.sourceDuration;return{start:0,end:Math.ceil(n/(t/r))}},dynamic:function(e){var t=e.NOW,a=e.clientOffset,r=e.availabilityStartTime,n=e.timescale,i=void 0===n?1:n,s=e.duration,o=e.start,l=void 0===o?0:o,d=e.minimumUpdatePeriod,p=void 0===d?0:d,u=e.timeShiftBufferDepth,c=void 0===u?1/0:u,m=(t+a)/1e3,g=r+l,y=Math.ceil((m+p-g)*i/s),h=Math.floor((m-g-c)*i/s),_=Math.floor((m-g)*i/s);return{start:Math.max(0,h),end:Math.min(y,_)}}},Ho=function(e){return function(t,a){var r=e.duration,n=e.timescale,i=void 0===n?1:n,s=e.periodIndex,o=e.startNumber,l=void 0===o?1:o;return{number:l+t,duration:r/i,timeline:s,time:a*r}}},qo=function(e){var t=e.type,a=void 0===t?"static":t,r=e.duration,n=e.timescale,i=void 0===n?1:n,s=e.sourceDuration,o=Fo[a](e),l=o.start,d=o.end,p=Do(l,d).map(Ho(e));if("static"===a){var u=p.length-1;p[u].duration=s-r/i*u}return p},Vo=function(e){var t=e.baseUrl,a=e.initialization,r=void 0===a?{}:a,n=e.sourceDuration,i=e.timescale,s=void 0===i?1:i,o=e.indexRange,l=void 0===o?"":o,d=e.duration;if(!t){throw new Error(Uo.NO_BASE_URL)}var p=Bo({baseUrl:t,source:r.sourceURL,range:r.range}),u=Bo({baseUrl:t,source:t,indexRange:l});u.map=p;if(d){var c=qo(e);if(c.length){u.duration=c[0].duration;u.timeline=c[0].timeline}}else if(n){u.duration=n/s;u.timeline=0}u.number=0;return[u]},Wo=function(e,t,a){for(var r=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,s=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,d=t.timescale,p=t.references.filter(function(e){return 1!==e.referenceType}),u=[],c=l+t.firstOffset,m=0;m<p.length;m++){var g=t.references[m],y=g.referencedSize,h=g.subsegmentDuration,_=c+y-1,f=c+"-"+_,b=Vo({baseUrl:a,timescale:d,timeline:s,periodIndex:s,duration:h,sourceDuration:n,indexRange:f})[0];if(r){b.map=r}u.push(b);c+=y}e.segments=u;return e},zo=function(e){var t=Ao(e.reduce(function(e,t){var a=t.attributes.id+(t.attributes.lang||"");if(e[a]){var r;if(t.segments[0]){t.segments[0].discontinuity=!0}(r=e[a].segments).push.apply(r,t.segments);if(t.attributes.contentProtection){e[a].attributes.contentProtection=t.attributes.contentProtection}}else{e[a]=t}return e},{}));return t.map(function(e){e.discontinuityStarts=Ro(e.segments,"discontinuity");return e})},Go=function(e,t){if(void 0===t){t={}}if(!Object.keys(t).length){return e}for(var a in e){var r=e[a];if(!r.sidx){continue}var n=r.sidx.uri+"-"+jo(r.sidx.byterange),i=t[n]&&t[n].sidx;if(r.sidx&&i){Wo(r,i,r.sidx.resolvedUri)}}return e},$o=function(e){var t,a=e.attributes,r=e.segments,n=e.sidx,i={attributes:(t={NAME:a.id,BANDWIDTH:a.bandwidth,CODECS:a.codecs},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(a.type||"static"),timeline:a.periodIndex,resolvedUri:"",targetDuration:a.duration,segments:r,mediaSequence:r.length?r[0].number:1};if(a.contentProtection){i.contentProtection=a.contentProtection}if(n){i.sidx=n}return i},Ko=function(e){var t,a=e.attributes,r=e.segments;if("undefined"==typeof r){r=[{uri:a.baseUrl,timeline:a.periodIndex,resolvedUri:a.baseUrl||"",duration:a.sourceDuration,number:0}];a.duration=a.sourceDuration}return{attributes:(t={NAME:a.id,BANDWIDTH:a.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(a.type||"static"),timeline:a.periodIndex,resolvedUri:a.baseUrl||"",targetDuration:a.duration,segments:r,mediaSequence:r.length?r[0].number:1}},Yo=function(e,t){if(void 0===t){t={}}var r,n=e.reduce(function(e,a){var n=a.attributes.role&&a.attributes.role.value||"",i=a.attributes.lang||"",s="main";if(i){var o=n?" ("+n+")":"";s=""+a.attributes.lang+o}if(e[s]&&e[s].playlists[0].attributes.BANDWIDTH>a.attributes.bandwidth){return e}e[s]={language:i,autoselect:!0,default:"main"===n,playlists:Go([$o(a)],t),uri:""};if("undefined"==typeof r&&"main"===n){r=a;r["default"]=!0}return e},{});if(!r){var i=Object.keys(n)[0];n[i]["default"]=!0}return n},Xo=function(e,t){if(void 0===t){t={}}return e.reduce(function(e,a){var r=a.attributes.lang||"text";if(e[r]){return e}e[r]={language:r,default:!1,autoselect:!1,playlists:Go([Ko(a)],t),uri:""};return e},{})},Qo=function(e){var t,a=e.attributes,r=e.segments,n=e.sidx,i={attributes:(t={NAME:a.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:a.width,height:a.height},CODECS:a.codecs,BANDWIDTH:a.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(a.type||"static"),timeline:a.periodIndex,resolvedUri:"",targetDuration:a.duration,segments:r,mediaSequence:r.length?r[0].number:1};if(a.contentProtection){i.contentProtection=a.contentProtection}if(n){i.sidx=n}return i},Jo=function(e,t){var a;if(void 0===t){t={}}if(!e.length){return{}}var r=e[0].attributes,n=r.sourceDuration,i=r.minimumUpdatePeriod,s=void 0===i?0:i,o=zo(e.filter(function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType})).map(Qo),l=zo(e.filter(function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType})),d=e.filter(function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType}),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(a={AUDIO:{},VIDEO:{}},a["CLOSED-CAPTIONS"]={},a.SUBTITLES={},a),uri:"",duration:n,playlists:Go(o,t),minimumUpdatePeriod:1e3*s};if(l.length){p.mediaGroups.AUDIO.audio=Yo(l,t)}if(d.length){p.mediaGroups.SUBTITLES.subs=Xo(d,t)}return p},Zo=function(e,t,a){var r=e.NOW,n=e.clientOffset,i=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,l=e.start,d=void 0===l?0:l,p=e.minimumUpdatePeriod,u=void 0===p?0:p;return Math.ceil((((r+n)/1e3+u-(i+d))*o-t)/a)},el=function(e,t){for(var a=e.type,r=void 0===a?"static":a,n=e.minimumUpdatePeriod,i=void 0===n?0:n,s=e.media,o=void 0===s?"":s,l=e.sourceDuration,d=e.timescale,p=void 0===d?1:d,u=e.startNumber,c=void 0===u?1:u,m=e.periodIndex,g=[],y=-1,h=0;h<t.length;h++){var _=t[h],f=_.d,b=_.r||0,T=_.t||0;if(0>y){y=T}if(T&&T>y){y=T}var v=void 0;if(0>b){var S=h+1;if(S===t.length){if("dynamic"===r&&0<i&&0<o.indexOf("$Number$")){v=Zo(e,y,f)}else{v=(l*p-y)/f}}else{v=(t[S].t-y)/f}}else{v=b+1}var k=c+g.length+v,C=c+g.length;while(C<k){g.push({number:C,duration:f/p,time:y,timeline:m});y+=f;C++}}return g},tl=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,al=function(e){return function(t,a,r,n){if("$$"===t){return"$"}if("undefined"==typeof e[a]){return t}var i=""+e[a];if("RepresentationID"===a){return i}if(!r){n=1}else{n=parseInt(n,10)}if(i.length>=n){return i}return""+Array(n-i.length+1).join("0")+i}},rl=function(e,t){return e.replace(tl,al(t))},nl=function(e,t){if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}if(e.duration){return qo(e)}return el(e,t)},il=function(e,t){var a={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,n=void 0===r?{sourceURL:"",range:""}:r,i=Bo({baseUrl:e.baseUrl,source:rl(n.sourceURL,a),range:n.range}),s=nl(e,t);return s.map(function(t){a.Number=t.number;a.Time=t.time;var r=rl(e.media||"",a);return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:No(e.baseUrl||"",r),map:i,number:t.number}})},sl=function(e,t){var a=e.baseUrl,r=e.initialization,n=void 0===r?{}:r,i=Bo({baseUrl:a,source:n.sourceURL,range:n.range}),s=Bo({baseUrl:a,source:t.media,range:t.mediaRange});s.map=i;return s},ol=function(e,t){var a=e.duration,r=e.segmentUrls,n=void 0===r?[]:r;if(!a&&!t||a&&t){throw new Error(Uo.SEGMENT_TIME_UNSPECIFIED)}var i=n.map(function(t){return sl(e,t)}),s;if(a){s=qo(e)}if(t){s=el(e,t)}var o=s.map(function(e,t){if(i[t]){var a=i[t];a.timeline=e.timeline;a.duration=e.duration;a.number=e.number;return a}}).filter(function(e){return e});return o},ll=function(e){var t=e.attributes,a=e.segmentInfo,r,n;if(a.template){n=il;r=xo(t,a.template)}else if(a.base){n=Vo;r=xo(t,a.base)}else if(a.list){n=ol;r=xo(t,a.list)}var i={attributes:t};if(!n){return i}var s=n(r,a.timeline);if(r.duration){var o=r,l=o.duration,d=o.timescale,p=void 0===d?1:d;r.duration=l/p}else if(s.length){r.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0)}else{r.duration=0}i.attributes=r;i.segments=s;if(a.base&&r.indexRange){i.sidx=s[0];i.segments=[]}return i},dl=function(e){return e.map(ll)},pl=function(e,t){return Oo(e.childNodes).filter(function(e){var a=e.tagName;return a===t})},ul=function(e){return e.textContent.trim()},cl=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,a=t.exec(e);if(!a){return 0}var r=a.slice(1),n=r[0],i=r[1],s=r[2],o=r[3],l=r[4],d=r[5];return parseFloat(n||0)*31536000+parseFloat(i||0)*2592000+parseFloat(s||0)*86400+parseFloat(o||0)*3600+parseFloat(l||0)*60+parseFloat(d||0)},ml=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(t.test(e)){e+="Z"}return Date.parse(e)},gl={mediaPresentationDuration:function(e){return cl(e)},availabilityStartTime:function(e){return ml(e)/1e3},minimumUpdatePeriod:function(e){return cl(e)},timeShiftBufferDepth:function(e){return cl(e)},start:function(e){return cl(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)},duration:function(e){var t=parseInt(e,10);if(isNaN(t)){return cl(e)}return 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}},yl=function(e){if(!(e&&e.attributes)){return{}}return Oo(e.attributes).reduce(function(t,a){var e=gl[a.name]||gl.DEFAULT;t[a.name]=e(a.value);return t},{})};function pt(t){for(var a=e.atob(t),r=new Uint8Array(a.length),n=0;n<a.length;n++){r[n]=a.charCodeAt(n)}return r}var hl={"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"},_l=function(e,t){if(!t.length){return e}return wo(e.map(function(e){return t.map(function(t){return No(e,ul(t))})}))},fl=function(e){var t=pl(e,"SegmentTemplate")[0],a=pl(e,"SegmentList")[0],r=a&&pl(a,"SegmentURL").map(function(e){return xo({tag:"SegmentURL"},yl(e))}),n=pl(e,"SegmentBase")[0],i=a||t,s=i&&pl(i,"SegmentTimeline")[0],o=a||n||t,l=o&&pl(o,"Initialization")[0],d=t&&yl(t);if(d&&l){d.initialization=l&&yl(l)}else if(d&&d.initialization){d.initialization={sourceURL:d.initialization}}var p={template:d,timeline:s&&pl(s,"S").map(function(e){return yl(e)}),list:a&&xo(yl(a),{segmentUrls:r,initialization:yl(l)}),base:n&&xo(yl(n),{initialization:yl(l)})};Object.keys(p).forEach(function(e){if(!p[e]){delete p[e]}});return p},bl=function(e,t,a){return function(r){var n=pl(r,"BaseURL"),i=_l(t,n),s=xo(e,yl(r)),o=fl(r);return i.map(function(e){return{segmentInfo:xo(a,o),attributes:xo(s,{baseUrl:e})}})}},Tl=function(e){return e.reduce(function(e,t){var a=yl(t),r=hl[a.schemeIdUri];if(r){e[r]={attributes:a};var n=pl(t,"cenc:pssh")[0];if(n){var i=ul(n),s=i&&pt(i);e[r].pssh=s}}return e},{})},vl=function(e,t,a){return function(r){var n=yl(r),i=_l(t,pl(r,"BaseURL")),s=pl(r,"Role")[0],o={role:yl(s)},l=xo(e,n,o),d=Tl(pl(r,"ContentProtection"));if(Object.keys(d).length){l=xo(l,{contentProtection:d})}var p=fl(r),u=pl(r,"Representation"),c=xo(a,p);return wo(u.map(bl(l,i,c)))}},Sl=function(t,a){return function(r,n){var i=_l(a,pl(r,"BaseURL")),s=yl(r),o=parseInt(s.id,10),l=e.isNaN(o)?n:o,d=xo(t,{periodIndex:l}),p=pl(r,"AdaptationSet"),u=fl(r);return wo(p.map(vl(d,i,u)))}},kl=function(e,t){if(void 0===t){t={}}var a=t,r=a.manifestUri,n=void 0===r?"":r,i=a.NOW,s=void 0===i?Date.now():i,o=a.clientOffset,l=void 0===o?0:o,d=pl(e,"Period");if(!d.length){throw new Error(Uo.INVALID_NUMBER_OF_PERIOD)}var p=yl(e),u=_l([n],pl(e,"BaseURL"));p.sourceDuration=p.mediaPresentationDuration||0;p.NOW=s;p.clientOffset=l;return wo(d.map(Sl(p,u)))},Cl=function(t){if(""===t){throw new Error(Uo.DASH_EMPTY_MANIFEST)}var a=new e.DOMParser,r=a.parseFromString(t,"application/xml"),n=r&&"MPD"===r.documentElement.tagName?r.documentElement:null;if(!n||n&&0<n.getElementsByTagName("parsererror").length){throw new Error(Uo.DASH_INVALID_XML)}return n},El=function(e){var t=pl(e,"UTCTiming")[0];if(!t){return null}var a=yl(t);switch(a.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":a.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":a.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":a.method="DIRECT";a.value=Date.parse(a.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Uo.UNSUPPORTED_UTC_TIMING_SCHEME);}return a},Pl=function(e,t){if(void 0===t){t={}}return Jo(dl(kl(Cl(e),t)),t.sidxMapping)},Il=function(e){return El(Cl(e))},Ll={toUnsigned:function(e){return e>>>0},toHexString:function(e){return("00"+e.toString(16)).slice(-2)}},xl=Ll.toUnsigned,Al=Ll.toHexString,Dl,wl,Ol,Rl,Ul,Ml;Dl=function(e,t){var a=[],r,n,s,o,l;if(!t.length){return null}for(r=0;r<e.byteLength;){n=xl(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);s=wl(e.subarray(r+4,r+8));o=1<n?r+n:e.byteLength;if(s===t[0]){if(1===t.length){a.push(e.subarray(r+8,o))}else{l=Dl(e.subarray(r+8,o),t.slice(1));if(l.length){a=a.concat(l)}}}r=o}return a};wl=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t};Ol=function(e){var t=Dl(e,["moov","trak"]);return t.reduce(function(e,t){var a,r,n,i,s;a=Dl(t,["tkhd"])[0];if(!a){return null}r=a[0];n=0===r?12:20;i=xl(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]);s=Dl(t,["mdia","mdhd"])[0];if(!s){return null}r=s[0];n=0===r?12:20;e[i]=xl(s[n]<<24|s[n+1]<<16|s[n+2]<<8|s[n+3]);return e},{})};Rl=function(e,t){var a,r,n;a=Dl(t,["moof","traf"]);r=[].concat.apply([],a.map(function(t){return Dl(t,["tfhd"]).map(function(a){var r,n,i;r=xl(a[4]<<24|a[5]<<16|a[6]<<8|a[7]);n=e[r]||9e4;i=Dl(t,["tfdt"]).map(function(e){var t,a;t=e[0];a=xl(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);if(1===t){a*=Math.pow(2,32);a+=xl(e[8]<<24|e[9]<<16|e[10]<<8|e[11])}return a})[0];i=i||1/0;return i/n})}));n=Math.min.apply(null,r);return isFinite(n)?n:0};Ul=function(e){var t=Dl(e,["moov","trak"]),a=[];t.forEach(function(e){var t=Dl(e,["mdia","hdlr"]),r=Dl(e,["tkhd"]);t.forEach(function(e,t){var n=wl(e.subarray(8,12)),i=r[t],s,o;if("vide"===n){s=new DataView(i.buffer,i.byteOffset,i.byteLength);s.getUint8(0);o=s.getUint32(20);a.push(o)}})});return a};Ml=function(e){var t=Dl(e,["moov","trak"]),a=[];t.forEach(function(e){var t={},r=Dl(e,["tkhd"])[0],n;if(r){n=new DataView(r.buffer,r.byteOffset,r.byteLength);n.getUint8(0);t.id=n.getUint32(20)}var i=Dl(e,["mdia","hdlr"])[0];if(i){var s=wl(i.subarray(8,12));if("vide"===s){t.type="video"}else if("soun"===s){t.type="audio"}else{t.type=s}}var o=Dl(e,["mdia","minf","stbl","stsd"])[0];if(o){var l=o.subarray(8);t.codec=wl(l.subarray(4,8));var d=Dl(l,[t.codec])[0],p,u;if(d){if(/^[a-z]vc[1-9]$/i.test(t.codec)){p=d.subarray(78);u=wl(p.subarray(4,8));if("avcC"===u&&11<p.length){t.codec+=".";t.codec+=Al(p[9]);t.codec+=Al(p[10]);t.codec+=Al(p[11])}else{t.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(t.codec)){p=d.subarray(28);u=wl(p.subarray(4,8));if("esds"===u&&20<p.length&&0!==p[19]){t.codec+="."+Al(p[19]);t.codec+="."+Al(63&p[20]>>>2).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}}}var c=Dl(e,["mdia","mdhd"])[0];if(c&&r){20;t.timescale=xl(c[20]<<24|c[21]<<16|c[22]<<8|c[23])}a.push(t)});return a};var Nl={findBox:Dl,parseType:wl,timescale:Ol,startTime:Rl,videoTrackIds:Ul,tracks:Ml},Bl,jl,Fl=Nl.parseType,Hl=function(e){return new Date(1e3*e-20828448e5)},ql=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]}},Vl=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=[],r,n;for(r=0;r+4<e.length;r+=n){n=t.getUint32(r);r+=4;if(0>=n){a.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(31&e[r]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push(31&"UNKNOWN NAL - "+e[r]);break;}}return a},Wl={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Bl(e.subarray(78,e.byteLength))}},avcC:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},r=31&e[5],n,s,o,l;o=6;for(l=0;l<r;l++){s=t.getUint16(o);o+=2;a.sps.push(new Uint8Array(e.subarray(o,o+s)));o+=s}n=e[o];o++;for(l=0;l<n;l++){s=t.getUint16(o);o+=2;a.pps.push(new Uint8Array(e.subarray(o,o+s)));o+=s}return a},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:63&e[12]>>>2,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:31&e[26]>>>3,samplingFrequencyIndex:(7&e[26])<<1|1&e[27]>>>7,channelConfiguration:15&e[27]>>>3}}}},ftyp:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={majorBrand:Fl(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},r=8;while(r<e.byteLength){a.compatibleBrands.push(Fl(e.subarray(r,r+4)));r+=4}return a},dinf:function(e){return{boxes:Bl(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:Bl(e.subarray(8))}},hdlr:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:Fl(e.subarray(8,12)),name:""},r=8;for(r=24;r<e.byteLength;r++){if(0===e[r]){r++;break}a.name+=String.fromCharCode(e[r])}a.name=decodeURIComponent(escape(a.name));return a},mdat:function(e){return{byteLength:e.byteLength,nals:Vl(e)}},mdhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=4,r,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};if(1===n.version){a+=4;n.creationTime=Hl(t.getUint32(a));a+=8;n.modificationTime=Hl(t.getUint32(a));a+=4;n.timescale=t.getUint32(a);a+=8;n.duration=t.getUint32(a)}else{n.creationTime=Hl(t.getUint32(a));a+=4;n.modificationTime=Hl(t.getUint32(a));a+=4;n.timescale=t.getUint32(a);a+=4;n.duration=t.getUint32(a)}a+=4;r=t.getUint16(a);n.language+=String.fromCharCode((r>>10)+96);n.language+=String.fromCharCode(((992&r)>>5)+96);n.language+=String.fromCharCode((31&r)+96);return n},mdia:function(e){return{boxes:Bl(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Bl(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};if(28<e.byteLength){a.streamDescriptor=Bl(e.subarray(28))[0]}return a},moof:function(e){return{boxes:Bl(e)}},moov:function(e){return{boxes:Bl(e)}},mvex:function(e){return{boxes:Bl(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};if(1===r.version){a+=4;r.creationTime=Hl(t.getUint32(a));a+=8;r.modificationTime=Hl(t.getUint32(a));a+=4;r.timescale=t.getUint32(a);a+=8;r.duration=t.getUint32(a)}else{r.creationTime=Hl(t.getUint32(a));a+=4;r.modificationTime=Hl(t.getUint32(a));a+=4;r.timescale=t.getUint32(a);a+=4;r.duration=t.getUint32(a)}a+=4;r.rate=t.getUint16(a)+t.getUint16(a+2)/16;a+=4;r.volume=t.getUint8(a)+t.getUint8(a+1)/8;a+=2;a+=2;a+=8;r.matrix=new Uint32Array(e.subarray(a,a+36));a+=36;a+=24;r.nextTrackId=t.getUint32(a);return r},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},a;for(a=4;a<e.byteLength;a++){t.samples.push({dependsOn:(48&e[a])>>4,isDependedOn:(12&e[a])>>2,hasRedundancy:3&e[a]})}return t},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8),earliestPresentationTime:t.getUint32(12),firstOffset:t.getUint32(16)},r=t.getUint16(22),n;for(n=24;r;n+=12,r--){a.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)})}return a},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Bl(e)}},stco:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=t.getUint32(4),n;for(n=8;r;n+=4,r--){a.chunkOffsets.push(t.getUint32(n))}return a},stsc:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]},n;for(n=8;a;n+=12,a--){r.sampleToChunks.push({firstChunk:t.getUint32(n),samplesPerChunk:t.getUint32(n+4),sampleDescriptionIndex:t.getUint32(n+8)})}return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Bl(e.subarray(8))}},stsz:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:t.getUint32(4),entries:[]},r;for(r=12;r<e.byteLength;r+=4){a.entries.push(t.getUint32(r))}return a},stts:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=t.getUint32(4),n;for(n=8;r;n+=8,r--){a.timeToSamples.push({sampleCount:t.getUint32(n),sampleDelta:t.getUint32(n+4)})}return a},styp:function(e){return Wl.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};if(1===t.version){t.baseMediaDecodeTime*=Math.pow(2,32);t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]}return t},tfhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},r=1&a.flags[2],n=2&a.flags[2],s=8&a.flags[2],o=16&a.flags[2],l=32&a.flags[2],d=65536&a.flags[0],p=131072&a.flags[0],u;u=8;if(r){u+=4;a.baseDataOffset=t.getUint32(12);u+=4}if(n){a.sampleDescriptionIndex=t.getUint32(u);u+=4}if(s){a.defaultSampleDuration=t.getUint32(u);u+=4}if(o){a.defaultSampleSize=t.getUint32(u);u+=4}if(l){a.defaultSampleFlags=t.getUint32(u)}if(d){a.durationIsEmpty=!0}if(!r&&p){a.baseDataOffsetIsMoof=!0}return a},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=4,r={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};if(1===r.version){a+=4;r.creationTime=Hl(t.getUint32(a));a+=8;r.modificationTime=Hl(t.getUint32(a));a+=4;r.trackId=t.getUint32(a);a+=4;a+=8;r.duration=t.getUint32(a)}else{r.creationTime=Hl(t.getUint32(a));a+=4;r.modificationTime=Hl(t.getUint32(a));a+=4;r.trackId=t.getUint32(a);a+=4;a+=4;r.duration=t.getUint32(a)}a+=4;a+=8;r.layer=t.getUint16(a);a+=2;r.alternateGroup=t.getUint16(a);a+=2;r.volume=t.getUint8(a)+t.getUint8(a+1)/8;a+=2;a+=2;r.matrix=new Uint32Array(e.subarray(a,a+36));a+=36;r.width=t.getUint16(a)+t.getUint16(a+2)/16;a+=4;r.height=t.getUint16(a)+t.getUint16(a+2)/16;return r},traf:function(e){return{boxes:Bl(e)}},trak:function(e){return{boxes:Bl(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},a=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&t.flags[2],n=4&t.flags[2],i=1&t.flags[1],s=2&t.flags[1],o=4&t.flags[1],l=8&t.flags[1],d=a.getUint32(4),p=8,u;if(r){t.dataOffset=a.getInt32(p);p+=4}if(n&&d){u={flags:ql(e.subarray(p,p+4))};p+=4;if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u);d--}while(d--){u={};if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(o){u.flags=ql(e.subarray(p,p+4));p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u)}return t},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};Bl=function(e){for(var t=0,a=[],r,n,s,o,l,d=new ArrayBuffer(e.length),p=new Uint8Array(d),u=0;u<e.length;++u){p[u]=e[u]}r=new DataView(d);while(t<e.byteLength){n=r.getUint32(t);s=Fl(e.subarray(t+4,t+8));o=1<n?t+n:e.byteLength;l=(Wl[s]||function(e){return{data:e}})(e.subarray(t+8,o));l.size=n;l.type=s;a.push(l);t=o}return a};jl=function(e,t){var a;t=t||0;a=Array(2*t+1).join(" ");return e.map(function(e){return a+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var r=a+"  "+t+": ",n=e[t];if(n instanceof Uint8Array||n instanceof Uint32Array){var i=Array.prototype.slice.call(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);if(!i){return r+"<>"}if(1===i.length){return r+"<"+i.join("").slice(1)+">"}return r+"<\n"+i.map(function(e){return a+"  "+e}).join("\n")+"\n"+a+"  >"}return r+JSON.stringify(n,null,2).split("\n").map(function(e,t){if(0===t){return e}return a+"  "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+jl(e.boxes,t+1):"")}).join("\n")};var zl={inspect:Bl,textify:jl,parseTfdt:Wl.tfdt,parseHdlr:Wl.hdlr,parseTfhd:Wl.tfhd,parseTrun:Wl.trun,parseSidx:Wl.sidx},Gl=4,$l=function(e){var t=0,a={payloadType:-1,payloadSize:0},r=0,n=0;while(t<e.byteLength){if(e[t]===128){break}while(255===e[t]){r+=255;t++}r+=e[t++];while(255===e[t]){n+=255;t++}n+=e[t++];if(!a.payload&&r===Gl){a.payloadType=r;a.payloadSize=n;a.payload=e.subarray(t,t+n);break}t+=n;r=0;n=0}return a},Kl=function(e,t){var a=[],r,n,s,o;if(!(64&t[0])){return a}n=31&t[0];for(r=0;r<n;r++){s=3*r;o={type:3&t[s+2],pts:e};if(4&t[s+2]){o.ccData=t[s+3]<<8|t[s+4];a.push(o)}}return a},Yl=function(e){var t=e.byteLength,a=[],r=1,n,s;while(r<t-2){if(0===e[r]&&0===e[r+1]&&3===e[r+2]){a.push(r+2);r+=2}else{r++}}if(0===a.length){return e}n=t-a.length;s=new Uint8Array(n);var o=0;for(r=0;r<n;o++,r++){if(o===a[0]){o++;a.shift()}s[r]=e[o]}return s},Xl={parseSei:$l,parseUserData:function(e){if(181!==e.payload[0]){return null}if(49!=(e.payload[1]<<8|e.payload[2])){return null}if("GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])){return null}if(3!==e.payload[7]){return null}return e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:Kl,discardEmulationPreventionBytes:Yl,USER_DATA_REGISTERED_ITU_T_T35:Gl},Ql=function(){this.init=function(){var e={};this.on=function(t,a){if(!e[t]){e[t]=[]}e[t]=e[t].concat(a)};this.off=function(t,a){var r;if(!e[t]){return!1}r=e[t].indexOf(a);e[t]=e[t].slice();e[t].splice(r,1);return-1<r};this.trigger=function(t){var a,r,n,s;a=e[t];if(!a){return}if(2===arguments.length){n=a.length;for(r=0;r<n;++r){a[r].call(this,arguments[1])}}else{s=[];r=arguments.length;for(r=1;r<arguments.length;++r){s.push(arguments[r])}n=a.length;for(r=0;r<n;++r){a[r].apply(this,s)}}};this.dispose=function(){e={}}}};Ql.prototype.pipe=function(e){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)});return e};Ql.prototype.push=function(e){this.trigger("data",e)};Ql.prototype.flush=function(e){this.trigger("done",e)};Ql.prototype.partialFlush=function(e){this.trigger("partialdone",e)};Ql.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)};Ql.prototype.reset=function(e){this.trigger("reset",e)};var Jl=Ql,Zl=function e(){e.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new id(0,0),new id(0,1),new id(1,0),new id(1,1)];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)};Zl.prototype=new Jl;Zl.prototype.push=function(e){var t,a,r;if("sei_rbsp"!==e.nalUnitType){return}t=Xl.parseSei(e.escapedRBSP);if(t.payloadType!==Xl.USER_DATA_REGISTERED_ITU_T_T35){return}a=Xl.parseUserData(t);if(!a){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=!1}return}r=Xl.parseCaptionPackets(e.pts,a);this.captionPackets_=this.captionPackets_.concat(r);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};Zl.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)};Zl.prototype.flushStream=function(e){if(!this.captionPackets_.length){this.flushCCStreams(e);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(2>e.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};Zl.prototype.flush=function(){return this.flushStream("flush")};Zl.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Zl.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Zl.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Zl.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};Zl.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};Zl.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var ed={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},td=function(e){if(null===e){return""}e=ed[e]||e;return String.fromCharCode(e)},ad=14,rd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],nd=function(){var e=[],t=ad+1;while(t--){e.push("")}return e},id=function e(t,a){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=a||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,r,n,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}r=t>>>8;n=255&t;if(t===this.PADDING_){}else 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);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;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_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=nd()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=nd()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=nd()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(r,n)){r=(3&r)<<8;i=td(r|n);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(r,n)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}r=(3&r)<<8;i=td(r|n);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(r,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&n)){this.addFormatting(e.pts,["i"])}if(1==(1&n)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(r,n)){this.column_+=3&n}else if(this.isPAC(r,n)){var s=rd.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&n&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(n)){if(14==(14&n)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(r)){if(0===n){n=null}i=td(r);i+=td(n);this[this.mode_](e.pts,i);this.column_+=i.length}}};id.prototype=new Jl;id.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};id.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=nd();this.nonDisplayed_=nd();this.lastControlCode_=null;this.column_=0;this.row_=ad;this.rollUpRows_=2;this.formatting_=[]};id.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(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_};id.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};id.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};id.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};id.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};id.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&127>=t};id.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};id.prototype.isNormalChar=function(e){return 32<=e&&127>=e};id.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=ad;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=nd();this.displayed_=nd()}if(t!==void 0&&t!==this.row_){for(var a=0;a<this.rollUpRows_;a++){this.displayed_[t-a]=this.displayed_[this.row_-a];this.displayed_[this.row_-a]=""}}if(t===void 0){t=this.row_}this.topRow_=t-this.rollUpRows_+1};id.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var a=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,a)};id.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};id.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};id.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};id.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]=""}for(e=this.row_+1;e<ad+1;e++){this.displayed_[e]=""}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]=""};id.prototype.paintOn=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};var sd=Xl.discardEmulationPreventionBytes,od={CaptionStream:Zl,Cea608Stream:id}.CaptionStream,ld=function(e,t){for(var a=e,r=0,n;r<t.length;r++){n=t[r];if(a<n.size){return n}a-=n.size}return null},dd=function(e,t,a){var r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[],s,o,l,d;for(o=0;o+4<e.length;o+=l){l=r.getUint32(o);o+=4;if(0>=l){continue}switch(31&e[o]){case 6:var p=e.subarray(o+1,o+1+l),u=ld(o,t);s={nalUnitType:"sei_rbsp",size:l,data:p,escapedRBSP:sd(p),trackId:a};if(u){s.pts=u.pts;s.dts=u.dts;d=u}else{s.pts=d.pts;s.dts=d.dts}n.push(s);break;default:break;}}return n},pd=function(e,t,a){var r=t,n=a.defaultSampleDuration||0,i=a.defaultSampleSize||0,s=a.trackId,o=[];e.forEach(function(e){var t=zl.parseTrun(e),a=t.samples;a.forEach(function(e){if(e.duration===void 0){e.duration=n}if(e.size===void 0){e.size=i}e.trackId=s;e.dts=r;if(e.compositionTimeOffset===void 0){e.compositionTimeOffset=0}e.pts=r+e.compositionTimeOffset;r+=e.duration});o=o.concat(a)});return o},ud=function(e,t){var a=Nl.findBox(e,["moof","traf"]),r=Nl.findBox(e,["mdat"]),n={},i=[];r.forEach(function(e,t){var r=a[t];i.push({mdat:e,traf:r})});i.forEach(function(e){var a=e.mdat,r=e.traf,i=Nl.findBox(r,["tfhd"]),s=zl.parseTfhd(i[0]),o=s.trackId,l=Nl.findBox(r,["tfdt"]),d=0<l.length?zl.parseTfdt(l[0]).baseMediaDecodeTime:0,p=Nl.findBox(r,["trun"]),u,c;if(t===o&&0<p.length){u=pd(p,d,s);c=dd(a,u,o);if(!n[o]){n[o]=[]}n[o]=n[o].concat(c)}});return n},cd=function(e,t,a){var r;if(null===t){return null}r=ud(e,t);return{seiNals:r[t],timescale:a}},md=function(){var e=!1,t,a,r,n,i,s;this.isInitialized=function(){return e};this.init=function(a){t=new od;e=!0;s=a?a.isPartial:!1;t.on("data",function(e){e.startTime=e.startPts/n;e.endTime=e.endPts/n;i.captions.push(e);i.captionStreams[e.stream]=!0})};this.isNewInit=function(e,t){if(e&&0===e.length||t&&"object"===_typeof(t)&&0===Object.keys(t).length){return!1}return r!==e[0]||n!==t[r]};this.parse=function(e,t,s){var o;if(!this.isInitialized()){return null}else if(!t||!s){return null}else if(this.isNewInit(t,s)){r=t[0];n=s[r]}else if(null===r||!n){a.push(e);return null}while(0<a.length){var l=a.shift();this.parse(l,t,s)}o=cd(e,r,n);if(null===o||!o.seiNals){return null}this.pushNals(o.seiNals);this.flushStream();return i};this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length){return null}e.forEach(function(e){t.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}if(!s){t.flush()}else{t.partialFlush()}};this.clearParsedCaptions=function(){i.captions=[];i.captionStreams={}};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}t.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){a=[];r=null;n=null;if(!i){i={captions:[],captionStreams:{}}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()},gd={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},yd="shared",hd=function(e,t){var a=1;if(e>t){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},_d=function e(t){var a,r;e.prototype.init.call(this);this.type_=t||yd;this.push=function(e){if(this.type_!==yd&&e.type!==this.type_){return}if(r===void 0){r=e.dts}e.dts=hd(e.dts,r);e.pts=hd(e.pts,r);a=e.dts;this.trigger("data",e)};this.flush=function(){r=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){r=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};_d.prototype=new Jl;var fd=function(e){var t=31&e[1];t<<=8;t|=e[2];return t},bd=function(e){return!!(64&e[1])},Td=function(e){var t=0;if(1<(48&e[3])>>>4){t+=e[4]+1}return t},vd=function(e){var t={},a=bd(e),r=4+Td(e);if(a){r+=e[r]+1}if(!(1&e[r+5])){return}var n,s,o;n=(15&e[r+1])<<8|e[r+2];s=3+n-4;o=(15&e[r+10])<<8|e[r+11];var l=12+o;while(l<s){var d=r+l;t[(31&e[d+1])<<8|e[d+2]]=e[d];l+=((15&e[d+3])<<8|e[d+4])+5}return t},Sd=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;}},kd=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Cd=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ed=function(e,t,a){var r,n="";for(r=t;r<a;r++){n+="%"+("00"+e[r].toString(16)).slice(-2)}return n},Pd=function(e,t,a){return unescape(Ed(e,t,a))},Id=function(e){var t=0;while(t+5<e.length){if(255!==e[t]||240!=(246&e[t+1])){t++;continue}return kd[(60&e[t+2])>>>2]}return null},Ld=function(e){var t,a,r,n;t=10;if(64&e[5]){t+=4;t+=Cd(e.subarray(10,14))}do{a=Cd(e.subarray(t+4,t+8));if(1>a){return null}n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===n){r=e.subarray(t+10,t+a+10);for(var s=0;s<r.byteLength;s++){if(0===r[s]){var o=Pd(r,0,s);if("com.apple.streaming.transportStreamTimestamp"===o){var l=r.subarray(s+1),d=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(t<e.byteLength);return null},xd=9e4,Ad,Dd,wd,Od,Rd,Ud,Md;Ad=function(e){return e*xd};Dd=function(e,t){return e*t};wd=function(e){return e/xd};Od=function(e,t){return e/t};Rd=function(e,t){return Ad(Od(e,t))};Ud=function(e,t){return Dd(wd(e),t)};Md=function(e,t,a){return wd(a?e:e-t)};var Nd={ONE_SECOND_IN_TS:xd,secondsToVideoTs:Ad,secondsToAudioTs:Dd,videoTsToSeconds:wd,audioTsToSeconds:Od,audioTsToVideoTs:Rd,videoTsToAudioTs:Ud,metadataTsToSeconds:Md},Bd={TimestampRolloverStream:_d,handleRollover:hd}.handleRollover,jd={};jd.ts={parseType:function(e,t){var a=fd(e);if(0===a){return"pat"}else if(a===t){return"pmt"}else if(t){return"pes"}return null},parsePat:function(e){var t=bd(e),a=4+Td(e);if(t){a+=e[a]+1}return(31&e[a+10])<<8|e[a+11]},parsePmt:vd,parsePayloadUnitStartIndicator:bd,parsePesType:function(e,t){var a=fd(e),r=t[a];switch(r){case gd.H264_STREAM_TYPE:return"video";case gd.ADTS_STREAM_TYPE:return"audio";case gd.METADATA_STREAM_TYPE:return"timed-metadata";default:return null;}},parsePesTime:function(e){var t=bd(e);if(!t){return null}var a=4+Td(e);if(a>=e.byteLength){return null}var r=null,n;n=e[a+7];if(192&n){r={};r.pts=(14&e[a+9])<<27|(255&e[a+10])<<20|(254&e[a+11])<<12|(255&e[a+12])<<5|(254&e[a+13])>>>3;r.pts*=4;r.pts+=(6&e[a+13])>>>1;r.dts=r.pts;if(64&n){r.dts=(14&e[a+14])<<27|(255&e[a+15])<<20|(254&e[a+16])<<12|(255&e[a+17])<<5|(254&e[a+18])>>>3;r.dts*=4;r.dts+=(6&e[a+18])>>>1}}return r},videoPacketContainsKeyFrame:function(e){var t=4+Td(e),a=e.subarray(t),r=0,n=0,i=!1,s;for(;n<a.byteLength-3;n++){if(1===a[n+2]){r=n+5;break}}while(r<a.byteLength){switch(a[r]){case 0:if(0!==a[r-1]){r+=2;break}else if(0!==a[r-2]){r++;break}if(n+3!==r-2){s=Sd(31&a[n+3]);if("slice_layer_without_partitioning_rbsp_idr"===s){i=!0}}do{r++}while(1!==a[r]&&r<a.length);n=r-2;r+=3;break;case 1:if(0!==a[r-1]||0!==a[r-2]){r+=3;break}s=Sd(31&a[n+3]);if("slice_layer_without_partitioning_rbsp_idr"===s){i=!0}n=r-2;r+=3;break;default:r+=3;break;}}a=a.subarray(n);r-=n;n=0;if(a&&3<a.byteLength){s=Sd(31&a[n+3]);if("slice_layer_without_partitioning_rbsp_idr"===s){i=!0}}return i}};jd.aac={isLikelyAacData:function(e){if(e[0]===73&&e[1]===68&&e[2]===51){return!0}return!1},parseId3TagSize:function(e,t){var a=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],r=e[t+5];if((16&r)>>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,r=e[t+4]<<3,n=e[t+3]&6144;return n|r|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:Id,parseAacTimestamp:Ld};var Fd=Nd.ONE_SECOND_IN_TS,Hd=188,qd=71,Vd=function(e,t){var a=0,r=Hd,n,i;while(r<e.byteLength){if(e[a]===qd&&e[r]===qd){n=e.subarray(a,r);i=jd.ts.parseType(n,t.pid);switch(i){case"pat":if(!t.pid){t.pid=jd.ts.parsePat(n)}break;case"pmt":if(!t.table){t.table=jd.ts.parsePmt(n)}break;default:break;}if(t.pid&&t.table){return}a+=Hd;r+=Hd;continue}a++;r++}},Wd=function(e,t,a){var r=0,n=Hd,i,s,o,l,d,p=!1;while(n<=e.byteLength){if(e[r]===qd&&(e[n]===qd||n===e.byteLength)){i=e.subarray(r,n);s=jd.ts.parseType(i,t.pid);switch(s){case"pes":o=jd.ts.parsePesType(i,t.table);l=jd.ts.parsePayloadUnitStartIndicator(i);if("audio"===o&&l){d=jd.ts.parsePesTime(i);if(d){d.type="audio";a.audio.push(d);p=!0}}break;default:break;}if(p){break}r+=Hd;n+=Hd;continue}r++;n++}n=e.byteLength;r=n-Hd;p=!1;while(0<=r){if(e[r]===qd&&(e[n]===qd||n===e.byteLength)){i=e.subarray(r,n);s=jd.ts.parseType(i,t.pid);switch(s){case"pes":o=jd.ts.parsePesType(i,t.table);l=jd.ts.parsePayloadUnitStartIndicator(i);if("audio"===o&&l){d=jd.ts.parsePesTime(i);if(d){d.type="audio";a.audio.push(d);p=!0}}break;default:break;}if(p){break}r-=Hd;n-=Hd;continue}r--;n--}},zd=function(e,t,a){var r=0,n=Hd,s,o,l,d,p,u,c,m,g=!1,y={data:[],size:0};while(n<e.byteLength){if(e[r]===qd&&e[n]===qd){s=e.subarray(r,n);o=jd.ts.parseType(s,t.pid);switch(o){case"pes":l=jd.ts.parsePesType(s,t.table);d=jd.ts.parsePayloadUnitStartIndicator(s);if("video"===l){if(d&&!g){p=jd.ts.parsePesTime(s);if(p){p.type="video";a.video.push(p);g=!0}}if(!a.firstKeyFrame){if(d){if(0!==y.size){u=new Uint8Array(y.size);c=0;while(y.data.length){m=y.data.shift();u.set(m,c);c+=m.byteLength}if(jd.ts.videoPacketContainsKeyFrame(u)){var h=jd.ts.parsePesTime(u);if(h){a.firstKeyFrame=h;a.firstKeyFrame.type="video"}else{console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}}y.size=0}}y.data.push(s);y.size+=s.byteLength}}break;default:break;}if(g&&a.firstKeyFrame){break}r+=Hd;n+=Hd;continue}r++;n++}n=e.byteLength;r=n-Hd;g=!1;while(0<=r){if(e[r]===qd&&e[n]===qd){s=e.subarray(r,n);o=jd.ts.parseType(s,t.pid);switch(o){case"pes":l=jd.ts.parsePesType(s,t.table);d=jd.ts.parsePayloadUnitStartIndicator(s);if("video"===l&&d){p=jd.ts.parsePesTime(s);if(p){p.type="video";a.video.push(p);g=!0}}break;default:break;}if(g){break}r-=Hd;n-=Hd;continue}r--;n--}},Gd=function(e,t){if(e.audio&&e.audio.length){var a=t;if("undefined"==typeof a){a=e.audio[0].dts}e.audio.forEach(function(e){e.dts=Bd(e.dts,a);e.pts=Bd(e.pts,a);e.dtsTime=e.dts/Fd;e.ptsTime=e.pts/Fd})}if(e.video&&e.video.length){var r=t;if("undefined"==typeof r){r=e.video[0].dts}e.video.forEach(function(e){e.dts=Bd(e.dts,r);e.pts=Bd(e.pts,r);e.dtsTime=e.dts/Fd;e.ptsTime=e.pts/Fd});if(e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=Bd(n.dts,r);n.pts=Bd(n.pts,r);n.dtsTime=n.dts/Fd;n.ptsTime=n.dts/Fd}}},$d=function(e){var t=!1,a=0,r=null,n=null,i=0,s=0,o;while(3<=e.length-s){var l=jd.aac.parseType(e,s);switch(l){case"timed-metadata":if(10>e.length-s){t=!0;break}i=jd.aac.parseId3TagSize(e,s);if(i>e.length){t=!0;break}if(null===n){o=e.subarray(s,s+i);n=jd.aac.parseAacTimestamp(o)}s+=i;break;case"audio":if(7>e.length-s){t=!0;break}i=jd.aac.parseAdtsSize(e,s);if(i>e.length){t=!0;break}if(null===r){o=e.subarray(s,s+i);r=jd.aac.parseSampleRate(o)}a++;s+=i;break;default:s++;break;}if(t){return null}}if(null===r||null===n){return null}var d=Fd/r,p={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*a*d,pts:n+1024*a*d}]};return p},Kd=function(e){var t={pid:null,table:null},a={};Vd(e,t);for(var r in t.table){if(t.table.hasOwnProperty(r)){var n=t.table[r];switch(n){case gd.H264_STREAM_TYPE:a.video=[];zd(e,t,a);if(0===a.video.length){delete a.video}break;case gd.ADTS_STREAM_TYPE:a.audio=[];Wd(e,t,a);if(0===a.audio.length){delete a.audio}break;default:break;}}}return a};function ut(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var Yd=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},Xd=function(){function e(e,t){for(var a=0,r;a<t.length;a++){r=t[a];r.enumerable=r.enumerable||!1;r.configurable=!0;if("value"in r)r.writable=!0;Object.defineProperty(e,r.key,r)}}return function(t,a,r){if(a)e(t.prototype,a);if(r)e(t,r);return t}}(),Qd=function(e,t){if("function"!=typeof t&&null!==t){throw new TypeError("Super expression must either be null or a function, not "+_typeof(t))}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t},Jd=function(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&("object"===_typeof(t)||"function"==typeof t)?t:e},Zd=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],a=e[1],r=t[4],n=a[4],o=void 0,l=void 0,p=void 0,u=[],d=[],c=void 0,m=void 0,g=void 0,y=void 0,h=void 0,_=void 0;for(o=0;256>o;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!r[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);r[l]=y;n[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},ep=null,tp=function(){function e(t){Yd(this,e);if(!ep){ep=Zd()}this._tables=[[ep[0][0].slice(),ep[0][1].slice(),ep[0][2].slice(),ep[0][3].slice(),ep[0][4].slice()],[ep[1][0].slice(),ep[1][1].slice(),ep[1][2].slice(),ep[1][3].slice(),ep[1][4].slice()]];var a=void 0,r=void 0,n=void 0,s=void 0,o=void 0,l=this._tables[0][4],d=this._tables[1],p=t.length,u=1;if(4!==p&&6!==p&&8!==p){throw new Error("Invalid aes key size")}s=t.slice(0);o=[];this._key=[s,o];for(a=p;a<4*p+28;a++){n=s[a-1];if(0==a%p||8===p&&4==a%p){n=l[n>>>24]<<24^l[255&n>>16]<<16^l[255&n>>8]<<8^l[255&n];if(0==a%p){n=n<<8^n>>>24^u<<24;u=u<<1^283*(u>>7)}}s[a]=s[a-p]^n}for(r=0;a;r++,a--){n=s[3&r?a:a-4];if(4>=a||4>r){o[r]=n}else{o[r]=d[0][l[n>>>24]]^d[1][l[255&n>>16]]^d[2][l[255&n>>8]]^d[3][l[255&n]]}}}e.prototype.decrypt=function(e,t,r,n,s,o){var l=this._key[1],p=e^l[0],u=n^l[1],m=r^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],P=S[3],I=S[4];for(T=0;T<f;T++){y=k[p>>>24]^C[255&u>>16]^E[255&m>>8]^P[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^P[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^P[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^P[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=I[p>>>24]<<24^I[255&u>>16]<<16^I[255&m>>8]<<8^I[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),ap=function(){function e(){Yd(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1<a};e.prototype.trigger=function(e){var t=this.listeners[e];if(!t){return}if(2===arguments.length){for(var a=t.length,r=0;r<a;++r){t[r].call(this,arguments[1])}}else{for(var n=Array.prototype.slice.call(arguments,1),s=t.length,o=0;o<s;++o){t[o].apply(this,n)}}};e.prototype.dispose=function(){this.listeners={}};e.prototype.pipe=function(e){this.on("data",function(t){e.push(t)})};return e}(),rp=function(e){Qd(t,e);function t(){Yd(this,t);var a=Jd(this,e.call(this,ap));a.jobs=[];a.delay=1;a.timeout_=null;return a}t.prototype.processJob_=function(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}};t.prototype.push=function(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}};return t}(ap),np=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},ip=function(e,t,a){var r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),n=new tp(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,l=void 0,d=void 0,p=void 0,u=void 0,c=void 0,m=void 0,g=void 0,y=void 0;o=a[0];l=a[1];d=a[2];p=a[3];for(y=0;y<r.length;y+=4){u=np(r[y]);c=np(r[y+1]);m=np(r[y+2]);g=np(r[y+3]);n.decrypt(u,c,m,g,s,y);s[y]=np(s[y]^o);s[y+1]=np(s[y+1]^l);s[y+2]=np(s[y+2]^d);s[y+3]=np(s[y+3]^p);o=u;l=c;d=m;p=g}return i},sp=function(){function e(t,a,r,n){Yd(this,e);var s=e.STEP,o=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;this.asyncStream_=new rp;this.asyncStream_.push(this.decryptChunk_(o.subarray(d,d+s),a,r,l));for(d=s;d<o.length;d+=s){r=new Uint32Array([np(o[d-4]),np(o[d-3]),np(o[d-2]),np(o[d-1])]);this.asyncStream_.push(this.decryptChunk_(o.subarray(d,d+s),a,r,l))}this.asyncStream_.push(function(){n(null,ut(l))})}e.prototype.decryptChunk_=function(e,t,a,r){return function(){var n=ip(e,t,a);r.set(n,e.byteOffset)}};Xd(e,null,[{key:"STEP",get:function(){return 32e3}}]);return e}(),op=function(t,a){if(/^[a-z]+:/i.test(a)){return a}if(!/\/\//i.test(t)){t=vo.buildAbsoluteURL(e.location.href,t)}return vo.buildAbsoluteURL(t,a)},lp=function(e,t,a){if(e&&a.responseURL&&t!==a.responseURL){return a.responseURL}return t},dp=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},pp=function(){function e(e,t){for(var a=0,r;a<t.length;a++){r=t[a];r.enumerable=r.enumerable||!1;r.configurable=!0;if("value"in r)r.writable=!0;Object.defineProperty(e,r.key,r)}}return function(t,a,r){if(a)e(t.prototype,a);if(r)e(t,r);return t}}(),up=function e(t,a,r){if(null===t)t=Function.prototype;var n=Object.getOwnPropertyDescriptor(t,a);if(n===void 0){var i=Object.getPrototypeOf(t);if(null===i){}else{return e(i,a,r)}}else if("value"in n){return n.value}else{var s=n.get;if(s===void 0){return}return s.call(r)}},cp=function(e,t){if("function"!=typeof t&&null!==t){throw new TypeError("Super expression must either be null or a function, not "+_typeof(t))}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t},mp=function(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&("object"===_typeof(t)||"function"==typeof t)?t:e},gp=function(){function e(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var s=e[Symbol.iterator](),o;!(r=(o=s.next()).done);r=!0){a.push(o.value);if(t&&a.length===t)break}}catch(e){n=!0;i=e}finally{try{if(!r&&s["return"])s["return"]()}finally{if(n)throw i}}return a}return function(t,a){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,a)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}(),yp=it.mergeOptions,hp=it.EventTarget,_p=it.log,fp=function(e,t){["AUDIO","SUBTITLES"].forEach(function(a){for(var r in e.mediaGroups[a]){for(var n in e.mediaGroups[a][r]){var i=e.mediaGroups[a][r][n];t(i,a,r,n)}}})},bp=function(e,t,a){var r=t.slice();a=a||0;for(var n=Math.min(e.length,t.length+a),s=a;s<n;s++){r[s-a]=yp(e[s],r[s-a])}return r},Tp=function(e,t){if(!e.resolvedUri){e.resolvedUri=op(t,e.uri)}if(e.key&&!e.key.resolvedUri){e.key.resolvedUri=op(t,e.key.uri)}if(e.map&&!e.map.resolvedUri){e.map.resolvedUri=op(t,e.map.uri)}},vp=function(e,t){var a=yp(e,{}),r=a.playlists[t.uri];if(!r){return null}if(r.segments&&t.segments&&r.segments.length===t.segments.length&&r.endList===t.endList&&r.mediaSequence===t.mediaSequence){return null}var n=yp(r,t);if(r.segments){n.segments=bp(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}n.segments.forEach(function(e){Tp(e,n.resolvedUri)});for(var s=0;s<a.playlists.length;s++){if(a.playlists[s].uri===t.uri){a.playlists[s]=n}}a.playlists[t.uri]=n;return a},Sp=function(e){var t=e.playlists.length;while(t--){var a=e.playlists[t];e.playlists[a.uri]=a;a.resolvedUri=op(e.uri,a.uri);a.id=t;if(!a.attributes){a.attributes={};_p.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}},kp=function(e){fp(e,function(t){if(t.uri){t.resolvedUri=op(e.uri,t.uri)}})},Cp=function(e,t){var a=e.segments[e.segments.length-1],r=void 0;if(t&&a&&a.duration){r=1e3*a.duration}else{r=500*(e.targetDuration||10)}return r},Ep=function(t){cp(a,t);function a(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};dp(this,a);var n=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this)),i=r.withCredentials,s=i===void 0?!1:i,o=r.handleManifestRedirects,l=o===void 0?!1:o;n.srcUrl=e;n.hls_=t;n.withCredentials=s;n.handleManifestRedirects=l;var d=t.options_;n.customTagParsers=d&&d.customTagParsers||[];n.customTagMappers=d&&d.customTagMappers||[];if(!n.srcUrl){throw new Error("A non-empty playlist URL is required")}n.state="HAVE_NOTHING";n.on("mediaupdatetimeout",function(){if("HAVE_METADATA"!==n.state){return}n.state="HAVE_CURRENT_METADATA";n.request=n.hls_.xhr({uri:op(n.master.uri,n.media().uri),withCredentials:n.withCredentials},function(e){if(!n.request){return}if(e){return n.playlistRequestError(n.request,n.media().uri,"HAVE_METADATA")}n.haveMetadata(n.request,n.media().uri)})});return n}pp(a,[{key:"playlistRequestError",value:function(e,t,a){this.request=null;if(a){this.state=a}this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t+".",responseText:e.responseText,code:500<=e.status?4:2};this.trigger("error")}},{key:"haveMetadata",value:function(t,a){var r=this;this.request=null;this.state="HAVE_METADATA";var n=new Io;this.customTagParsers.forEach(function(e){return n.addParser(e)});this.customTagMappers.forEach(function(e){return n.addTagMapper(e)});n.push(t.responseText);n.end();n.manifest.uri=a;n.manifest.attributes=n.manifest.attributes||{};var i=vp(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration;if(i){this.master=i;this.media_=this.master.playlists[n.manifest.uri]}else{this.trigger("playlistunchanged")}if(!this.media().endList){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=e.setTimeout(function(){r.trigger("mediaupdatetimeout")},Cp(this.media(),!!i))}this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);e.clearTimeout(this.finalRenditionTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}},{key:"media",value:function(t,a){var r=this;if(!t){return this.media_}if("HAVE_NOTHING"===this.state){throw new Error("Cannot switch media playlist from "+this.state)}if("string"==typeof t){if(!this.master.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.master.playlists[t]}e.clearTimeout(this.finalRenditionTimeout);if(a){var n=1e3*(t.targetDuration/2)||5000;this.finalRenditionTimeout=e.setTimeout(this.media.bind(this,t,!1),n);return}var i=this.state,s=!this.media_||t.uri!==this.media_.uri;if(this.master.playlists[t.uri].endList){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(s){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!s){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.request=this.hls_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},function(e,a){if(!r.request){return}t.resolvedUri=lp(r.handleManifestRedirects,t.resolvedUri,a);if(e){return r.playlistRequestError(r.request,t.uri,i)}r.haveMetadata(a,t.uri);if("HAVE_MASTER"===i){r.trigger("loadedmetadata")}else{r.trigger("mediachange")}})}},{key:"pause",value:function(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);if("HAVE_NOTHING"===this.state){this.started=!1}if("SWITCHING_MEDIA"===this.state){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MASTER"}}else if("HAVE_CURRENT_METADATA"===this.state){this.state="HAVE_METADATA"}}},{key:"load",value:function(t){var a=this;e.clearTimeout(this.mediaUpdateTimeout);var r=this.media();if(t){var n=r?1e3*(r.targetDuration/2):5000;this.mediaUpdateTimeout=e.setTimeout(function(){return a.load()},n);return}if(!this.started){this.start();return}if(r&&!r.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}},{key:"start",value:function(){var t=this;this.started=!0;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(a,r){if(!t.request){return}t.request=null;if(a){t.error={status:r.status,message:"HLS playlist request error at URL: "+t.srcUrl+".",responseText:r.responseText,code:2};if("HAVE_NOTHING"===t.state){t.started=!1}return t.trigger("error")}var n=new Io;t.customTagParsers.forEach(function(e){return n.addParser(e)});t.customTagMappers.forEach(function(e){return n.addTagMapper(e)});n.push(r.responseText);n.end();t.state="HAVE_MASTER";t.srcUrl=lp(t.handleManifestRedirects,t.srcUrl,r);n.manifest.uri=t.srcUrl;if(n.manifest.playlists){t.master=n.manifest;Sp(t.master);kp(t.master);t.trigger("loadedplaylist");if(!t.request){t.media(n.manifest.playlists[0])}return}t.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:e.location.href,playlists:[{uri:t.srcUrl,id:0,resolvedUri:t.srcUrl,attributes:{}}]};t.master.playlists[t.srcUrl]=t.master.playlists[0];t.haveMetadata(r,t.srcUrl);return t.trigger("loadedmetadata")})}}]);return a}(hp),Pp=it.createTimeRange,Ip=function(e,t){var a=0,r=t-e.mediaSequence,n=e.segments[r];if(n){if("undefined"!=typeof n.start){return{result:n.start,precise:!0}}if("undefined"!=typeof n.end){return{result:n.end-n.duration,precise:!0}}}while(r--){n=e.segments[r];if("undefined"!=typeof n.end){return{result:a+n.end,precise:!0}}a+=n.duration;if("undefined"!=typeof n.start){return{result:a+n.start,precise:!0}}}return{result:a,precise:!1}},Lp=function(e,t){var a=0,r=void 0,n=t-e.mediaSequence;for(;n<e.segments.length;n++){r=e.segments[n];if("undefined"!=typeof r.start){return{result:r.start-a,precise:!0}}a+=r.duration;if("undefined"!=typeof r.end){return{result:r.end-a,precise:!0}}}return{result:-1,precise:!1}},xp=function(e,t,a){var r=void 0,n=void 0;if("undefined"==typeof t){t=e.mediaSequence+e.segments.length}if(t<e.mediaSequence){return 0}r=Ip(e,t);if(r.precise){return r.result}n=Lp(e,t);if(n.precise){return n.result}return r.result+a},Ap=function(t,a,r){if(!t){return 0}if("number"!=typeof r){r=0}if("undefined"==typeof a){if(t.totalDuration){return t.totalDuration}if(!t.endList){return e.Infinity}}return xp(t,a,r)},Dp=function(e,t,a){var r=0;if(t>a){var n=[a,t];t=n[0];a=n[1]}if(0>t){for(var s=t;s<Math.min(0,a);s++){r+=e.targetDuration}t=0}for(var o=t;o<a;o++){r+=e.segments[o].duration}return r},wp=function(e){if(!e.segments.length){return 0}var t=e.segments.length-1,a=e.segments[t].duration||e.targetDuration,r=a+2*e.targetDuration;while(t--){a+=e.segments[t].duration;if(a>=r){break}}return Math.max(0,t)},Op=function(e,t,a){if(!e||!e.segments){return null}if(e.endList){return Ap(e)}if(null===t){return null}t=t||0;var r=a?wp(e):e.segments.length;return xp(e,e.mediaSequence+r,t)},Rp=function(e){return 0==e-Math.floor(e)},Up=function(e,t){if(Rp(t)){return t+.1*e}for(var a=t.toString().split(".")[1].length,r=1;r<=a;r++){var n=Math.pow(10,r),s=t*n;if(Rp(s)||r===a){return(s+e)/n}}},Mp=Up.bind(null,1),Np=Up.bind(null,-1),Bp=function(e,t,a,r){var n=void 0,s=void 0,o=e.segments.length,l=t-r;if(0>l){if(0<a){for(n=a-1;0<=n;n--){s=e.segments[n];l+=Np(s.duration);if(0<l){return{mediaIndex:n,startTime:r-Dp(e,a,n)}}}}return{mediaIndex:0,startTime:t}}if(0>a){for(n=a;0>n;n++){l-=e.targetDuration;if(0>l){return{mediaIndex:0,startTime:t}}}a=0}for(n=a;n<o;n++){s=e.segments[n];l-=Mp(s.duration);if(0>l){return{mediaIndex:n,startTime:r+Dp(e,a,n)}}}return{mediaIndex:o-1,startTime:t}},jp=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Fp=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Hp=function(e){var t=jp(e);return!e.disabled&&!t},qp=function(e){for(var t=0;t<e.segments.length;t++){if(e.segments[t].key){return!0}}return!1},Vp=function(e){for(var t=0;t<e.segments.length;t++){if(e.segments[t].map){return!0}}return!1},Wp=function(e,t){return t.attributes&&t.attributes[e]},zp=function(e,t){if(1===e.playlists.length){return!0}var a=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){if(!Hp(e)){return!1}return(e.attributes.BANDWIDTH||0)<a}).length},Gp={duration:Ap,seekable:function(e,t){var a=Op(e,t,!0);if(null===a){return Pp()}return Pp(t||0,a)},safeLiveIndex:wp,getMediaInfoForTime:Bp,isEnabled:Hp,isDisabled:function(e){return e.disabled},isBlacklisted:jp,isIncompatible:Fp,playlistEnd:Op,isAes:qp,isFmp4:Vp,hasAttribute:Wp,estimateSegmentRequestTime:function(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:0;if(!Wp("BANDWIDTH",a)){return NaN}var n=e*a.attributes.BANDWIDTH;return(n-8*r)/t},isLowestEnabledRendition:zp},$p=it.xhr,Kp=it.mergeOptions,Yp=function(){return function e(t,a){t=Kp({timeout:45e3},t);var r=e.beforeRequest||it.Hls.xhr.beforeRequest;if(r&&"function"==typeof r){var n=r(t);if(n){t=n}}var i=$p(t,function(e,t){var r=i.response;if(!e&&r){i.responseTime=Date.now();i.roundTripTime=i.responseTime-i.requestTime;i.bytesReceived=r.byteLength||r.length;if(!i.bandwidth){i.bandwidth=Math.floor(1e3*(8*(i.bytesReceived/i.roundTripTime)))}}if(t.headers){i.responseHeaders=t.headers}if(e&&"ETIMEDOUT"===e.code){i.timedout=!0}if(!e&&!i.aborted&&200!==t.statusCode&&206!==t.statusCode&&0!==t.statusCode){e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))}a(e,i)}),s=i.abort;i.abort=function(){i.aborted=!0;return s.apply(i,arguments)};i.uri=t.uri;i.requestTime=Date.now();return i}},Xp=function(e){var t=void 0,a=void 0;a=e.offset+e.length-1;t=e.offset;return"bytes="+t+"-"+a},Qp=function(e){var t={};if(e.byterange){t.Range=Xp(e.byterange)}return t},Jp=function(e,t){return e.start(t)+"-"+e.end(t)},Zp=function(t,e){var a=t.toString(16);return"00".substring(0,2-a.length)+a+(e%2?" ":"")},eu=function(t){if(32<=t&&126>t){return String.fromCharCode(t)}return"."},tu=function(e){var t={};Object.keys(e).forEach(function(a){var r=e[a];if(ArrayBuffer.isView(r)){t[a]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}else{t[a]=r}});return t},au=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},ru=function(e){return e.resolvedUri},nu=function(e){for(var t=Array.prototype.slice.call(e),a=16,r="",n=void 0,i=void 0,s=0;s<t.length/a;s++){n=t.slice(s*a,s*a+a).map(Zp).join("");i=t.slice(s*a,s*a+a).map(eu).join("");r+=n+" "+i+"\n"}return r},iu=function(e){var t="",a=void 0;for(a=0;a<e.length;a++){t+=Jp(e,a)+" "}return t},su=Object.freeze({createTransferableMessage:tu,initSegmentId:au,segmentKeyId:ru,hexDump:nu,tagDump:function(e){var t=e.bytes;return nu(t)},textRanges:iu}),ou=.25,lu=function(e,t){if(!t.dateTimeObject){return null}var a=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart;return new Date(t.dateTimeObject.getTime()+1e3*(e-(r+a)))},du=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},pu=function(e,t){var a;try{a=new Date(e)}catch(t){return null}if(!t||!t.segments||0===t.segments.length){return null}var r=t.segments[0];if(a<r.dateTimeObject){return null}for(var n=0;n<t.segments.length-1;n++){r=t.segments[n];var s=t.segments[n+1].dateTimeObject;if(a<s){break}}var o=t.segments[t.segments.length-1],l=o.dateTimeObject,d=o.videoTimingInfo?du(o.videoTimingInfo):o.duration+o.duration*ou,p=new Date(l.getTime()+1e3*d);if(a>p){return null}if(a>l){r=o}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Gp.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"}},uu=function(e,t){if(!t||!t.segments||0===t.segments.length){return null}for(var a=0,r=void 0,n=0;n<t.segments.length;n++){r=t.segments[n];a=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:a+r.duration;if(e<=a){break}}var s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e){return null}if(e>a){if(e>a+s.duration*ou){return null}r=s}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:a-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},cu=function(e,t){var a=void 0,r=void 0;try{a=new Date(e);r=new Date(t)}catch(t){}var n=a.getTime(),i=r.getTime();return(i-n)/1e3},mu=function(e){if(!e.segments||0===e.segments.length){return!1}for(var t=0,a;t<e.segments.length;t++){a=e.segments[t];if(!a.dateTimeObject){return!1}}return!0},gu=function(e){var t=e.playlist,a=e.time,r=a===void 0?void 0:a,n=e.callback;if(!n){throw new Error("getProgramTime: callback must be provided")}if(!t||r===void 0){return n({message:"getProgramTime: playlist and time must be provided"})}var i=uu(r,t);if(!i){return n({message:"valid programTime was not found"})}if("estimate"===i.type){return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart})}var s={mediaSeconds:r},o=lu(r,i.segment);if(o){s.programDateTime=o.toISOString()}return n(null,s)},yu=function e(t){var a=t.programTime,r=t.playlist,n=t.retryCount,i=n===void 0?2:n,s=t.seekTo,o=t.pauseAfterSeek,l=o===void 0?!0:o,d=t.tech,p=t.callback;if(!p){throw new Error("seekToProgramTime: callback must be provided")}if("undefined"==typeof a||!r||!s){return p({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!r.endList&&!d.hasStarted_){return p({message:"player must be playing a live stream to start buffering"})}if(!mu(r)){return p({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri})}var u=pu(a,r);if(!u){return p({message:a+" was not found in the stream"})}var c=u.segment,m=cu(c.dateTimeObject,a);if("estimate"===u.type){if(0===i){return p({message:a+" is not buffered yet. Try again"})}s(u.estimatedStart+m);d.one("seeked",function(){e({programTime:a,playlist:r,retryCount:i-1,seekTo:s,pauseAfterSeek:l,tech:d,callback:p})});return}var g=c.start+m;d.one("seeked",function(){return p(null,d.currentTime())});if(l){d.pause()}s(g)},hu=1/30,_u=3*hu,fu=function(e,t){var a=[],r=void 0;if(e&&e.length){for(r=0;r<e.length;r++){if(t(e.start(r),e.end(r))){a.push([e.start(r),e.end(r)])}}}return it.createTimeRanges(a)},bu=function(e,t){return fu(e,function(e,a){return e-_u<=t&&a+_u>=t})},Tu=function(e,t){return fu(e,function(e){return e-hu>=t})},vu=function(e){if(2>e.length){return it.createTimeRanges()}for(var t=[],a=1;a<e.length;a++){var r=e.end(a-1),n=e.start(a);t.push([r,n])}return it.createTimeRanges(t)},Su=function(e){var t=[];if(!e||!e.length){return""}for(var a=0;a<e.length;a++){t.push(e.start(a)+" => "+e.end(a))}return t.join(", ")},ku=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,r=e.length?e.end(e.length-1):0;return(r-t)/a},Cu=function(e){for(var t=[],a=0;a<e.length;a++){t.push({start:e.start(a),end:e.end(a)})}return t},Eu=function(e,t,a){var r=t.player_;if(a.captions&&a.captions.length){if(!e.inbandTextTracks_){e.inbandTextTracks_={}}for(var n in a.captionStreams){if(!e.inbandTextTracks_[n]){r.tech_.trigger({type:"usage",name:"hls-608"});var i=r.textTracks().getTrackById(n);if(i){e.inbandTextTracks_[n]=i}else{e.inbandTextTracks_[n]=r.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}}}if(a.metadata&&a.metadata.length&&!e.metadataTrack_){e.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track;e.metadataTrack_.inBandMetadataTrackDispatchType=a.metadata.dispatchType}},Pu=function(e,t,a){var r=void 0,n=void 0;if(!a){return}if(!a.cues){return}r=a.cues.length;while(r--){n=a.cues[r];if(n.startTime<=t&&n.endTime>=e){a.removeCue(n)}}},Iu=function(e){Object.defineProperties(e.frame,{id:{get:function(){it.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get:function(){it.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get:function(){it.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})},Lu=function(e){var t;if(isNaN(e)||Math.abs(e)===1/0){t=Number.MAX_VALUE}else{t=e}return t},xu=function(t,a,r){var n=e.WebKitDataCue||e.VTTCue;if(a){a.forEach(function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))},t)}if(r){var s=Lu(t.mediaSource_.duration);r.forEach(function(t){var a=t.cueTime+this.timestampOffset;if("number"!=typeof a||e.isNaN(a)||0>a||!(a<1/0)){return}t.frames.forEach(function(e){var t=new n(a,a,e.value||e.url||e.data||"");t.frame=e;t.value=e;Iu(t);this.metadataTrack_.addCue(t)},this)},t);if(t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var o=t.metadataTrack_.cues,l=[],d=0;d<o.length;d++){if(o[d]){l.push(o[d])}}var p=l.reduce(function(e,t){var a=e[t.startTime]||[];a.push(t);e[t.startTime]=a;return e},{}),u=Object.keys(p).sort(function(e,t){return+e-+t});u.forEach(function(e,t){var a=p[e],r=+u[t+1]||s;a.forEach(function(e){e.endTime=r})})}}},Au="undefined"!=typeof window?window:{},Du="undefined"==typeof Symbol?"__target":Symbol(),wu=Au.BlobBuilder||Au.WebKitBlobBuilder||Au.MozBlobBuilder||Au.MSBlobBuilder,Ou=Au.URL||Au.webkitURL||Ou&&Ou.msURL,Ru=Au.Worker;function ct(e,t){return function(a){var r=this;if(!t){return new Ru(e)}else if(Ru&&!a){var n=t.toString().replace(/^function.+?{/,"").slice(0,-1),i=mt(n);this[Du]=new Ru(i);gt(this[Du],i);return this[Du]}else{var s={postMessage:function(e){if(r.onmessage){setTimeout(function(){r.onmessage({data:e,target:s})})}}};t.call(s);this.postMessage=function(e){setTimeout(function(){s.onmessage({data:e,target:r})})};this.isThisThread=!0}}}if(Ru){var Uu,Mu=mt("self.onmessage = function () {}"),Nu=new Uint8Array(1);try{Uu=new Ru(Mu);Uu.postMessage(Nu,[Nu.buffer])}catch(t){Ru=null}finally{Ou.revokeObjectURL(Mu);if(Uu){Uu.terminate()}}}function mt(t){try{return Ou.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(r){var a=new wu;a.append(t);return Ou.createObjectURL(a.getBlob(type))}}function gt(e,t){if(!e||!t)return;var a=e.terminate;e.objURL=t;e.terminate=function(){if(e.objURL)Ou.revokeObjectURL(e.objURL);a.call(e)}}var Bu=new ct("./transmuxer-worker.worker.js",function(){var e=this,t=function(){var t=function(){this.init=function(){var e={};this.on=function(t,a){if(!e[t]){e[t]=[]}e[t]=e[t].concat(a)};this.off=function(t,a){var r;if(!e[t]){return!1}r=e[t].indexOf(a);e[t]=e[t].slice();e[t].splice(r,1);return-1<r};this.trigger=function(t){var a,r,n,s;a=e[t];if(!a){return}if(2===arguments.length){n=a.length;for(r=0;r<n;++r){a[r].call(this,arguments[1])}}else{s=[];r=arguments.length;for(r=1;r<arguments.length;++r){s.push(arguments[r])}n=a.length;for(r=0;r<n;++r){a[r].apply(this,s)}}};this.dispose=function(){e={}}}};t.prototype.pipe=function(e){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)});return e};t.prototype.push=function(e){this.trigger("data",e)};t.prototype.flush=function(e){this.trigger("done",e)};t.prototype.partialFlush=function(e){this.trigger("partialdone",e)};t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)};t.prototype.reset=function(e){this.trigger("reset",e)};var a=t,r=Math.pow(2,32)-1,n,i,s,o,l,d,p,u,c,m,g,y,h,_,f,b,T,v,S,k,C,E,P,I,L,x,A,D,w,O,R,U,M,N,B,j;(function(){P={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if("undefined"==typeof Uint8Array){return}for(var e in P){if(P.hasOwnProperty(e)){P[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]}}I=new Uint8Array([105,115,111,109]);x=new Uint8Array([97,118,99,49]);L=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]);D=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]);w={video:A,audio:D};U=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]);M=new Uint8Array([0,0,0,0,0,0,0,0]);N=M;B=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);j=M;O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();n=function(e){var t=[],a=0,r,n,s;for(r=1;r<arguments.length;r++){t.push(arguments[r])}r=t.length;while(r--){a+=t[r].byteLength}n=new Uint8Array(a+8);s=new DataView(n.buffer,n.byteOffset,n.byteLength);s.setUint32(0,n.byteLength);n.set(e,4);for(r=0,a=8;r<t.length;r++){n.set(t[r],a);a+=t[r].byteLength}return n};i=function(){return n(P.dinf,n(P.dref,U))};s=function(e){return n(P.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]))};o=function(){return n(P.ftyp,I,L,I,x)};b=function(e){return n(P.hdlr,w[e])};l=function(e){return n(P.mdat,e)};f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,255&e.duration>>>24,255&e.duration>>>16,255&e.duration>>>8,255&e.duration,85,196,0,0]);if(e.samplerate){t[12]=255&e.samplerate>>>24;t[13]=255&e.samplerate>>>16;t[14]=255&e.samplerate>>>8;t[15]=255&e.samplerate}return n(P.mdhd,t)};_=function(e){return n(P.mdia,f(e),b(e.type),p(e))};d=function(e){return n(P.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))};p=function(e){return n(P.minf,"video"===e.type?n(P.vmhd,O):n(P.smhd,R),i(),v(e))};u=function(e,t){var a=[],r=t.length;while(r--){a[r]=k(t[r])}return n.apply(null,[P.moof,d(e)].concat(a))};c=function(e){var t=e.length,a=[];while(t--){a[t]=y(e[t])}return n.apply(null,[P.moov,g(4294967295)].concat(a).concat(m(e)))};m=function(e){var t=e.length,a=[];while(t--){a[t]=C(e[t])}return n.apply(null,[P.mvex].concat(a))};g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return n(P.mvhd,t)};T=function(e){var t=e.samples||[],a=new Uint8Array(4+t.length),r,s;for(s=0;s<t.length;s++){r=t[s].flags;a[s+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy}return n(P.sdtp,a)};v=function(e){return n(P.stbl,S(e),n(P.stts,j),n(P.stsc,N),n(P.stsz,B),n(P.stco,M))};(function(){var e,t;S=function(a){return n(P.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===a.type?e(a):t(a))};e=function(e){var t=e.sps||[],a=e.pps||[],r=[],s=[],o,l;for(o=0;o<t.length;o++){r.push((65280&t[o].byteLength)>>>8);r.push(255&t[o].byteLength);r=r.concat(Array.prototype.slice.call(t[o]))}for(o=0;o<a.length;o++){s.push((65280&a[o].byteLength)>>>8);s.push(255&a[o].byteLength);s=s.concat(Array.prototype.slice.call(a[o]))}l=[P.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]),n(P.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],r,[a.length],s))),n(P.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var d=e.sarRatio[0],p=e.sarRatio[1];l.push(n(P.pasp,new Uint8Array([(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d,(4278190080&p)>>24,(16711680&p)>>16,(65280&p)>>8,255&p])))}return n.apply(null,l)};t=function(e){return n(P.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]),s(e))}})();h=function(e){var t=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 n(P.tkhd,t)};k=function(e){var t,a,i,s,o,l,d;t=n(P.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]));l=Math.floor(e.baseMediaDecodeTime/(r+1));d=Math.floor(e.baseMediaDecodeTime%(r+1));a=n(P.tfdt,new Uint8Array([1,0,0,0,255&l>>>24,255&l>>>16,255&l>>>8,255&l,255&d>>>24,255&d>>>16,255&d>>>8,255&d]));o=92;if("audio"===e.type){i=E(e,o);return n(P.traf,t,a,i)}s=T(e);i=E(e,s.length+o);return n(P.traf,t,a,i,s)};y=function(e){e.duration=e.duration||4294967295;return n(P.trak,h(e),_(e))};C=function(e){var t=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]);if("video"!==e.type){t[t.length-1]=0}return n(P.trex,t)};(function(){var e,t,a;a=function(e,t){var a=0,r=0,n=0,i=0;if(e.length){if(e[0].duration!==void 0){a=1}if(e[0].size!==void 0){r=2}if(e[0].flags!==void 0){n=4}if(e[0].compositionTimeOffset!==void 0){i=8}}return[0,0,a|r|n|i,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]};t=function(e,t){var r,s,o,l;s=e.samples||[];t+=20+16*s.length;r=a(s,t);for(l=0;l<s.length;l++){o=s[l];r=r.concat([(4278190080&o.duration)>>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size,o.flags.isLeading<<2|o.flags.dependsOn,o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,o.flags.degradationPriority&61440,15&o.flags.degradationPriority,(4278190080&o.compositionTimeOffset)>>>24,(16711680&o.compositionTimeOffset)>>>16,(65280&o.compositionTimeOffset)>>>8,255&o.compositionTimeOffset])}return n(P.trun,new Uint8Array(r))};e=function(e,t){var r,s,o,l;s=e.samples||[];t+=20+8*s.length;r=a(s,t);for(l=0;l<s.length;l++){o=s[l];r=r.concat([(4278190080&o.duration)>>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size])}return n(P.trun,new Uint8Array(r))};E=function(a,r){if("audio"===a.type){return e(a,r)}return t(a,r)}})();var F={ftyp:o,mdat:l,moof:u,moov:c,initSegment:function(e){var t=o(),a=c(e),r;r=new Uint8Array(t.byteLength+a.byteLength);r.set(t);r.set(a,t.byteLength);return r}},H=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},q=function(e,t){var a=H();a.dataOffset=t;a.compositionTimeOffset=e.pts-e.dts;a.duration=e.duration;a.size=4*e.length;a.size+=e.byteLength;if(e.keyFrame){a.flags.dependsOn=2;a.flags.isNonSyncSample=0}return a},V={groupNalsIntoFrames:function(e){var t,a,r=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;r.byteLength=0;for(t=0;t<e.length;t++){a=e[t];if("access_unit_delimiter_rbsp"===a.nalUnitType){if(r.length){r.duration=a.dts-r.dts;n.byteLength+=r.byteLength;n.nalCount+=r.length;n.duration+=r.duration;n.push(r)}r=[a];r.byteLength=a.data.byteLength;r.pts=a.pts;r.dts=a.dts}else{if("slice_layer_without_partitioning_rbsp_idr"===a.nalUnitType){r.keyFrame=!0}r.duration=a.dts-r.dts;r.byteLength+=a.data.byteLength;r.push(a)}}if(n.length&&(!r.duration||0>=r.duration)){r.duration=n[n.length-1].duration}n.byteLength+=r.byteLength;n.nalCount+=r.length;n.duration+=r.duration;n.push(r);return n},groupFramesIntoGops:function(e){var t,a,r=[],n=[];r.byteLength=0;r.nalCount=0;r.duration=0;r.pts=e[0].pts;r.dts=e[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=e[0].pts;n.dts=e[0].dts;for(t=0;t<e.length;t++){a=e[t];if(a.keyFrame){if(r.length){n.push(r);n.byteLength+=r.byteLength;n.nalCount+=r.nalCount;n.duration+=r.duration}r=[a];r.nalCount=a.length;r.byteLength=a.byteLength;r.pts=a.pts;r.dts=a.dts;r.duration=a.duration}else{r.duration+=a.duration;r.nalCount+=a.length;r.byteLength+=a.byteLength;r.push(a)}}if(n.length&&0>=r.duration){r.duration=n[n.length-1].duration}n.byteLength+=r.byteLength;n.nalCount+=r.nalCount;n.duration+=r.duration;n.push(r);return n},extendFirstKeyFrame:function(e){var t;if(!e[0][0].keyFrame&&1<e.length){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}return e},generateSampleTable:function(e,t){var a,r,n,s,o,l=t||0,d=[];for(a=0;a<e.length;a++){s=e[a];for(r=0;r<s.length;r++){o=s[r];n=q(o,l);l+=n.size;d.push(n)}}return d},concatenateNalData:function(e){var t,a,r,n,s,o,l=0,d=e.byteLength,p=e.nalCount,u=new Uint8Array(d+4*p),c=new DataView(u.buffer);for(t=0;t<e.length;t++){n=e[t];for(a=0;a<n.length;a++){s=n[a];for(r=0;r<s.length;r++){o=s[r];c.setUint32(l,o.data.byteLength);l+=4;u.set(o.data,l);l+=o.data.byteLength}}}return u},generateSampleTableForFrame:function(e,t){var a,r=[];a=q(e,t||0);r.push(a);return r},concatenateNalDataForFrame:function(e){var t,a,r=0,n=e.byteLength,s=e.length,o=new Uint8Array(n+4*s),l=new DataView(o.buffer);for(t=0;t<e.length;t++){a=e[t];l.setUint32(r,a.data.byteLength);r+=4;o.set(a.data,r);r+=a.data.byteLength}return o}},W=[33,16,5,32,164,27],z=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],G=function(e){var t=[];while(e--){t.push(0)}return t},$={96e3:[W,[227,64],G(154),[56]],88200:[W,[231],G(170),[56]],64e3:[W,[248,192],G(240),[56]],48e3:[W,[255,192],G(268),[55,148,128],G(54),[112]],44100:[W,[255,192],G(268),[55,163,128],G(84),[112]],32e3:[W,[255,192],G(268),[55,234],G(226),[112]],24e3:[W,[255,192],G(268),[55,255,128],G(268),[111,112],G(126),[224]],16e3:[W,[255,192],G(268),[55,255,128],G(268),[111,255],G(269),[223,108],G(195),[1,192]],12e3:[z,G(268),[3,127,248],G(268),[6,255,240],G(268),[13,255,224],G(268),[27,253,128],G(259),[56]],11025:[z,G(268),[3,127,248],G(268),[6,255,240],G(268),[13,255,224],G(268),[27,255,192],G(268),[55,175,128],G(108),[112]],8e3:[z,G(268),[3,121,16],G(47),[7]]},K=function(e){return Object.keys(e).reduce(function(t,a){t[a]=new Uint8Array(e[a].reduce(function(e,t){return e.concat(t)},[]));return t},{})}($),Y=9e4,X,Q,J,Z,ee,te,ae;X=function(e){return e*Y};Q=function(e,t){return e*t};J=function(e){return e/Y};Z=function(e,t){return e/t};ee=function(e,t){return X(Z(e,t))};te=function(e,t){return Q(J(e),t)};ae=function(e,t,a){return J(a?e:e-t)};var re={ONE_SECOND_IN_TS:Y,secondsToVideoTs:X,secondsToAudioTs:Q,videoTsToSeconds:J,audioTsToSeconds:Z,audioTsToVideoTs:ee,videoTsToAudioTs:te,metadataTsToSeconds:ae},ne=function(e){var t,a,r=0;for(t=0;t<e.length;t++){a=e[t];r+=a.data.byteLength}return r},ie={prefixWithSilence:function(e,t,a,r){var n,s=0,o=0,l=0,d=0,p,u,c;if(!t.length){return}n=re.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate);s=Math.ceil(re.ONE_SECOND_IN_TS/(e.samplerate/1024));if(a&&r){o=n-Math.max(a,r);l=Math.floor(o/s);d=l*s}if(1>l||d>re.ONE_SECOND_IN_TS/2){return}p=K[e.samplerate];if(!p){p=t[0].data}for(u=0;u<l;u++){c=t[0];t.splice(0,0,{data:p,dts:c.dts-s,pts:c.pts-s})}e.baseMediaDecodeTime-=Math.floor(re.videoTsToAudioTs(d,e.samplerate))},trimAdtsFramesByEarliestDts:function(e,t,a){if(t.minSegmentDts>=a){return e}t.minSegmentDts=1/0;return e.filter(function(e){if(e.dts>=a){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return!0}return!1})},generateSampleTable:function(e){var t,a,r=[];for(t=0;t<e.length;t++){a=e[t];r.push({size:a.data.byteLength,duration:1024})}return r},concatenateFrameData:function(e){var t,a,r=0,n=new Uint8Array(ne(e));for(t=0;t<e.length;t++){a=e[t];n.set(a.data,r);r+=a.data.byteLength}return n}},se=re.ONE_SECOND_IN_TS,oe={clearDtsInfo:function(e){delete e.minSegmentDts;delete e.maxSegmentDts;delete e.minSegmentPts;delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var a,r,n=e.minSegmentDts;if(!t){n-=e.timelineStartInfo.dts}a=e.timelineStartInfo.baseMediaDecodeTime;a+=n;a=Math.max(0,a);if("audio"===e.type){r=e.samplerate/se;a*=r;a=Math.floor(a)}return a},collectDtsInfo:function(e,t){if("number"==typeof t.pts){if(e.timelineStartInfo.pts===void 0){e.timelineStartInfo.pts=t.pts}if(e.minSegmentPts===void 0){e.minSegmentPts=t.pts}else{e.minSegmentPts=Math.min(e.minSegmentPts,t.pts)}if(e.maxSegmentPts===void 0){e.maxSegmentPts=t.pts}else{e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)}}if("number"==typeof t.dts){if(e.timelineStartInfo.dts===void 0){e.timelineStartInfo.dts=t.dts}if(e.minSegmentDts===void 0){e.minSegmentDts=t.dts}else{e.minSegmentDts=Math.min(e.minSegmentDts,t.dts)}if(e.maxSegmentDts===void 0){e.maxSegmentDts=t.dts}else{e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts)}}}},le=4,de={parseSei:function(e){var t=0,a={payloadType:-1,payloadSize:0},r=0,n=0;while(t<e.byteLength){if(e[t]===128){break}while(255===e[t]){r+=255;t++}r+=e[t++];while(255===e[t]){n+=255;t++}n+=e[t++];if(!a.payload&&r===le){a.payloadType=r;a.payloadSize=n;a.payload=e.subarray(t,t+n);break}t+=n;r=0;n=0}return a},parseUserData:function(e){if(181!==e.payload[0]){return null}if(49!=(e.payload[1]<<8|e.payload[2])){return null}if("GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])){return null}if(3!==e.payload[7]){return null}return e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var a=[],r,n,s,o;if(!(64&t[0])){return a}n=31&t[0];for(r=0;r<n;r++){s=3*r;o={type:3&t[s+2],pts:e};if(4&t[s+2]){o.ccData=t[s+3]<<8|t[s+4];a.push(o)}}return a},discardEmulationPreventionBytes:function(e){var t=e.byteLength,a=[],r=1,n,s;while(r<t-2){if(0===e[r]&&0===e[r+1]&&3===e[r+2]){a.push(r+2);r+=2}else{r++}}if(0===a.length){return e}n=t-a.length;s=new Uint8Array(n);var o=0;for(r=0;r<n;o++,r++){if(o===a[0]){o++;a.shift()}s[r]=e[o]}return s},USER_DATA_REGISTERED_ITU_T_T35:le},pe=function e(){e.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new he(0,0),new he(0,1),new he(1,0),new he(1,1)];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)};pe.prototype=new a;pe.prototype.push=function(e){var t,a,r;if("sei_rbsp"!==e.nalUnitType){return}t=de.parseSei(e.escapedRBSP);if(t.payloadType!==de.USER_DATA_REGISTERED_ITU_T_T35){return}a=de.parseUserData(t);if(!a){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=!1}return}r=de.parseCaptionPackets(e.pts,a);this.captionPackets_=this.captionPackets_.concat(r);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};pe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)};pe.prototype.flushStream=function(e){if(!this.captionPackets_.length){this.flushCCStreams(e);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(2>e.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};pe.prototype.flush=function(){return this.flushStream("flush")};pe.prototype.partialFlush=function(){return this.flushStream("partialFlush")};pe.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};pe.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};pe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};pe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};pe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var ue={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},ce=function(e){if(null===e){return""}e=ue[e]||e;return String.fromCharCode(e)},me=14,ge=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ye=function(){var e=[],t=me+1;while(t--){e.push("")}return e},he=function e(t,a){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=a||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,r,n,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}r=t>>>8;n=255&t;if(t===this.PADDING_){}else 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);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;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_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=ye()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=ye()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=ye()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(r,n)){r=(3&r)<<8;i=ce(r|n);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(r,n)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}r=(3&r)<<8;i=ce(r|n);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(r,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&n)){this.addFormatting(e.pts,["i"])}if(1==(1&n)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(r,n)){this.column_+=3&n}else if(this.isPAC(r,n)){var s=ge.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&n&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(n)){if(14==(14&n)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(r)){if(0===n){n=null}i=ce(r);i+=ce(n);this[this.mode_](e.pts,i);this.column_+=i.length}}};he.prototype=new a;he.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};he.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=ye();this.nonDisplayed_=ye();this.lastControlCode_=null;this.column_=0;this.row_=me;this.rollUpRows_=2;this.formatting_=[]};he.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(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_};he.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};he.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};he.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};he.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};he.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&127>=t};he.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};he.prototype.isNormalChar=function(e){return 32<=e&&127>=e};he.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=me;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=ye();this.displayed_=ye()}if(t!==void 0&&t!==this.row_){for(var a=0;a<this.rollUpRows_;a++){this.displayed_[t-a]=this.displayed_[this.row_-a];this.displayed_[this.row_-a]=""}}if(t===void 0){t=this.row_}this.topRow_=t-this.rollUpRows_+1};he.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var a=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,a)};he.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};he.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};he.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};he.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]=""}for(e=this.row_+1;e<me+1;e++){this.displayed_[e]=""}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]=""};he.prototype.paintOn=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};var _e={CaptionStream:pe,Cea608Stream:he},fe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},be="shared",Te=function(e,t){var a=1;if(e>t){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},ve=function e(t){var a,r;e.prototype.init.call(this);this.type_=t||be;this.push=function(e){if(this.type_!==be&&e.type!==this.type_){return}if(r===void 0){r=e.dts}e.dts=Te(e.dts,r);e.pts=Te(e.pts,r);a=e.dts;this.trigger("data",e)};this.flush=function(){r=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){r=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};ve.prototype=new a;var Se=function(e,t,a){var r,n="";for(r=t;r<a;r++){n+="%"+("00"+e[r].toString(16)).slice(-2)}return n},ke=function(e,t,a){return decodeURIComponent(Se(e,t,a))},Ce=function(e,t,a){return unescape(Se(e,t,a))},Ee=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Pe={TXXX:function(e){var t;if(3!==e.data[0]){return}for(t=1;t<e.data.length;t++){if(0===e.data[t]){e.description=ke(e.data,1,t);e.value=ke(e.data,t+1,e.data.length).replace(/\0*$/,"");break}}e.data=e.value},WXXX:function(e){var t;if(3!==e.data[0]){return}for(t=1;t<e.data.length;t++){if(0===e.data[t]){e.description=ke(e.data,1,t);e.url=ke(e.data,t+1,e.data.length);break}}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++){if(0===e.data[t]){e.owner=Ce(e.data,0,t);break}}e.privateData=e.data.subarray(t+1);e.data=e.privateData}},Ie;Ie=function(e){var t={debug:!!(e&&e.debug),descriptor:e&&e.descriptor},a=0,r=[],n=0,s;Ie.prototype.init.call(this);this.dispatchType=fe.METADATA_STREAM_TYPE.toString(16);if(t.descriptor){for(s=0;s<t.descriptor.length;s++){this.dispatchType+=("00"+t.descriptor[s].toString(16)).slice(-2)}}this.push=function(e){var s,o,l,p,u,c;if("timed-metadata"!==e.type){return}if(e.dataAlignmentIndicator){n=0;r.length=0}if(0===r.length&&(10>e.data.length||e.data[0]!==73||e.data[1]!==68||e.data[2]!==51)){if(t.debug){console.log("Skipping unrecognized metadata packet")}return}r.push(e);n+=e.data.byteLength;if(1===r.length){a=Ee(e.data.subarray(6,10));a+=10}if(n<a){return}s={data:new Uint8Array(a),frames:[],pts:r[0].pts,dts:r[0].dts};for(u=0;u<a;){s.data.set(r[0].data.subarray(0,a-u),u);u+=r[0].data.byteLength;n-=r[0].data.byteLength;r.shift()}o=10;if(64&s.data[5]){o+=4;o+=Ee(s.data.subarray(10,14));a-=Ee(s.data.subarray(16,20))}do{l=Ee(s.data.subarray(o+4,o+8));if(1>l){return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}c=String.fromCharCode(s.data[o],s.data[o+1],s.data[o+2],s.data[o+3]);p={id:c,data:s.data.subarray(o+10,o+l+10)};p.key=p.id;if(Pe[p.id]){Pe[p.id](p);if("com.apple.streaming.transportStreamTimestamp"===p.owner){var m=p.data,d=(1&m[3])<<30|m[4]<<22|m[5]<<14|m[6]<<6|m[7]>>>2;d*=4;d+=3&m[7];p.timeStamp=d;if(s.pts===void 0&&s.dts===void 0){s.pts=p.timeStamp;s.dts=p.timeStamp}this.trigger("timestamp",p)}}s.frames.push(p);o+=10;o+=l}while(o<a);this.trigger("data",s)}};Ie.prototype=new a;var Le=Ie,xe={TimestampRolloverStream:ve,handleRollover:Te}.TimestampRolloverStream,Ae,De,we,Oe=188,Re=71;Ae=function(){var e=new Uint8Array(Oe),t=0;Ae.prototype.init.call(this);this.push=function(a){var r=0,n=Oe,i;if(t){i=new Uint8Array(a.byteLength+t);i.set(e.subarray(0,t));i.set(a,t);t=0}else{i=a}while(n<i.byteLength){if(i[r]===Re&&i[n]===Re){this.trigger("data",i.subarray(r,n));r+=Oe;n+=Oe;continue}r++;n++}if(r<i.byteLength){e.set(i.subarray(r),0);t=i.byteLength-r}};this.flush=function(){if(t===Oe&&e[0]===Re){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")}};Ae.prototype=new a;De=function(){var e,t,a,r;De.prototype.init.call(this);r=this;this.packetsWaitingForPmt=[];this.programMapTable=void 0;e=function(e,r){var n=0;if(r.payloadUnitStartIndicator){n+=e[n]+1}if("pat"===r.type){t(e.subarray(n),r)}else{a(e.subarray(n),r)}};t=function(e,t){t.section_number=e[7];t.last_section_number=e[8];r.pmtPid=(31&e[10])<<8|e[11];t.pmtPid=r.pmtPid};a=function(e,t){var a,n,i,s;if(!(1&e[5])){return}r.programMapTable={video:null,audio:null,"timed-metadata":{}};a=(15&e[1])<<8|e[2];n=3+a-4;i=(15&e[10])<<8|e[11];s=12+i;while(s<n){var o=e[s],l=(31&e[s+1])<<8|e[s+2];if(o===fe.H264_STREAM_TYPE&&null===r.programMapTable.video){r.programMapTable.video=l}else if(o===fe.ADTS_STREAM_TYPE&&null===r.programMapTable.audio){r.programMapTable.audio=l}else if(o===fe.METADATA_STREAM_TYPE){r.programMapTable["timed-metadata"][l]=o}s+=((15&e[s+3])<<8|e[s+4])+5}t.programMapTable=r.programMapTable};this.push=function(t){var a={},r=4;a.payloadUnitStartIndicator=!!(64&t[1]);a.pid=31&t[1];a.pid<<=8;a.pid|=t[2];if(1<(48&t[3])>>>4){r+=t[r]+1}if(0===a.pid){a.type="pat";e(t.subarray(r),a);this.trigger("data",a)}else if(a.pid===this.pmtPid){a.type="pmt";e(t.subarray(r),a);this.trigger("data",a);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===void 0){this.packetsWaitingForPmt.push([t,r,a])}else{this.processPes_(t,r,a)}};this.processPes_=function(e,t,a){if(a.pid===this.programMapTable.video){a.streamType=fe.H264_STREAM_TYPE}else if(a.pid===this.programMapTable.audio){a.streamType=fe.ADTS_STREAM_TYPE}else{a.streamType=this.programMapTable["timed-metadata"][a.pid]}a.type="pes";a.data=e.subarray(t);this.trigger("data",a)}};De.prototype=new a;De.STREAM_TYPES={h264:27,adts:15};we=function(){var e=this,t={data:[],size:0},a={data:[],size:0},r={data:[],size:0},n,s=function(e,t){var a;t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=0!=(4&e[6]);a=e[7];if(192&a){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;if(64&a){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])},o=function(t,a,r){var n=new Uint8Array(t.size),o={type:a},l=0,d=0,p=!1,u;if(!t.data.length||9>t.size){return}o.trackId=t.data[0].pid;for(l=0;l<t.data.length;l++){u=t.data[l];n.set(u.data,d);d+=u.data.byteLength}s(n,o);p="video"===a||o.packetLength<=t.size;if(r||p){t.size=0;t.data.length=0}if(p){e.trigger("data",o)}};we.prototype.init.call(this);this.push=function(i){({pat:function(){},pes:function(){var e,n;switch(i.streamType){case fe.H264_STREAM_TYPE:case fe.H264_STREAM_TYPE:e=t;n="video";break;case fe.ADTS_STREAM_TYPE:e=a;n="audio";break;case fe.METADATA_STREAM_TYPE:e=r;n="timed-metadata";break;default:return;}if(i.payloadUnitStartIndicator){o(e,n,!0)}e.data.push(i);e.size+=i.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]};n=i.programMapTable;if(null!==n.video){t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.video,codec:"avc",type:"video"})}if(null!==n.audio){t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.audio,codec:"adts",type:"audio"})}e.trigger("data",t)}})[i.type]()};this.reset=function(){t.size=0;t.data.length=0;a.size=0;a.data.length=0;this.trigger("reset")};this.flushStreams_=function(){o(t,"video");o(a,"audio");o(r,"timed-metadata")};this.flush=function(){this.flushStreams_();this.trigger("done")}};we.prototype=new a;var Ue={PAT_PID:0,MP2T_PACKET_LENGTH:Oe,TransportPacketStream:Ae,TransportParseStream:De,ElementaryStream:we,TimestampRolloverStream:xe,CaptionStream:_e.CaptionStream,Cea608Stream:_e.Cea608Stream,MetadataStream:Le};for(var Me in fe){if(fe.hasOwnProperty(Me)){Ue[Me]=fe[Me]}}var Ne=Ue,Be=re.ONE_SECOND_IN_TS,je,Fe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];je=function(e){var t,a=0;je.prototype.init.call(this);this.push=function(r){var n=0,s,o,l,d,p,u;if(!e){a=0}if("audio"!==r.type){return}if(t){d=t;t=new Uint8Array(d.byteLength+r.data.byteLength);t.set(d);t.set(r.data,d.byteLength)}else{t=r.data}while(n+5<t.length){if(255!==t[n]||240!=(246&t[n+1])){n++;continue}o=2*(1&~t[n+1]);s=(3&t[n+3])<<11|t[n+4]<<3|(224&t[n+5])>>5;p=1024*((3&t[n+6])+1);u=p*Be/Fe[(60&t[n+2])>>>2];l=n+s;if(t.byteLength<l){return}this.trigger("data",{pts:r.pts+a*u,dts:r.dts+a*u,sampleCount:p,audioobjecttype:(3&t[n+2]>>>6)+1,channelcount:(1&t[n+2])<<2|(192&t[n+3])>>>6,samplerate:Fe[(60&t[n+2])>>>2],samplingfrequencyindex:(60&t[n+2])>>>2,samplesize:16,data:t.subarray(n+7+o,l)});a++;if(t.byteLength===l){t=void 0;return}t=t.subarray(l)}};this.flush=function(){a=0;this.trigger("done")};this.reset=function(){t=void 0;this.trigger("reset")};this.endTimeline=function(){t=void 0;this.trigger("endedtimeline")}};je.prototype=new a;var He=je,qe;qe=function(e){var t=e.byteLength,a=0,r=0;this.length=function(){return 8*t};this.bitsAvailable=function(){return 8*t+r};this.loadWord=function(){var n=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(0===s){throw new Error("no bytes available")}i.set(e.subarray(n,n+s));a=new DataView(i.buffer).getUint32(0);r=8*s;t-=s};this.skipBits=function(e){var n;if(r>e){a<<=e;r-=e}else{e-=r;n=Math.floor(e/8);e-=8*n;t-=n;this.loadWord();a<<=e;r-=e}};this.readBits=function(e){var n=Math.min(r,e),i=a>>>32-n;r-=n;if(0<r){a<<=n}else if(0<t){this.loadWord()}n=e-n;if(0<n){return i<<n|this.readBits(n)}return i};this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e){if(0!=(a&2147483648>>>e)){a<<=e;r-=e;return e}}this.loadWord();return 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();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return 1===this.readBits(1)};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Ve=qe,We,ze,Ge;ze=function(){var e=0,t,a;ze.prototype.init.call(this);this.push=function(r){var n;if(!a){a=r.data}else{n=new Uint8Array(a.byteLength+r.data.byteLength);n.set(a);n.set(r.data,a.byteLength);a=n}var i=a.byteLength;for(;e<i-3;e++){if(1===a[e+2]){t=e+5;break}}while(t<i){switch(a[t]){case 0:if(0!==a[t-1]){t+=2;break}else if(0!==a[t-2]){t++;break}if(e+3!=t-2){this.trigger("data",a.subarray(e+3,t-2))}do{t++}while(1!==a[t]&&t<i);e=t-2;t+=3;break;case 1:if(0!==a[t-1]||0!==a[t-2]){t+=3;break}this.trigger("data",a.subarray(e+3,t-2));e=t-2;t+=3;break;default:t+=3;break;}}a=a.subarray(e);t-=e;e=0};this.reset=function(){a=null;e=0;this.trigger("reset")};this.flush=function(){if(a&&3<a.byteLength){this.trigger("data",a.subarray(e+3))}a=null;e=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};ze.prototype=new a;Ge={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0};We=function(){var e=new ze,t,a,r,n,i,s,o;We.prototype.init.call(this);t=this;this.push=function(t){if("video"!==t.type){return}a=t.trackId;r=t.pts;n=t.dts;e.push(t)};e.on("data",function(e){var o={trackId:a,pts:r,dts:n,data:e};switch(31&e[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp";o.escapedRBSP=i(e.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp";o.escapedRBSP=i(e.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";break;default:break;}t.trigger("data",o)});e.on("done",function(){t.trigger("done")});e.on("partialdone",function(){t.trigger("partialdone")});e.on("reset",function(){t.trigger("reset")});e.on("endedtimeline",function(){t.trigger("endedtimeline")});this.flush=function(){e.flush()};this.partialFlush=function(){e.partialFlush()};this.reset=function(){e.reset()};this.endTimeline=function(){e.endTimeline()};o=function(e,t){var a=8,r=8,n,i;for(n=0;n<e;n++){if(0!=r){i=t.readExpGolomb();r=(a+i+256)%256}a=0==r?a:r}};i=function(e){var t=e.byteLength,a=[],r=1,n,s;while(r<t-2){if(0===e[r]&&0===e[r+1]&&3===e[r+2]){a.push(r+2);r+=2}else{r++}}if(0===a.length){return e}n=t-a.length;s=new Uint8Array(n);var o=0;for(r=0;r<n;o++,r++){if(o===a[0]){o++;a.shift()}s[r]=e[o]}return s};s=function(e){var t=0,a=0,r=0,n=0,s=1,l,d,p,u,c,m,g,y,h,_,f,b,T,v;l=new Ve(e);d=l.readUnsignedByte();u=l.readUnsignedByte();p=l.readUnsignedByte();l.skipUnsignedExpGolomb();if(Ge[d]){c=l.readUnsignedExpGolomb();if(3===c){l.skipBits(1)}l.skipUnsignedExpGolomb();l.skipUnsignedExpGolomb();l.skipBits(1);if(l.readBoolean()){f=3!==c?8:12;for(v=0;v<f;v++){if(l.readBoolean()){if(6>v){o(16,l)}else{o(64,l)}}}}}l.skipUnsignedExpGolomb();m=l.readUnsignedExpGolomb();if(0===m){l.readUnsignedExpGolomb()}else if(1===m){l.skipBits(1);l.skipExpGolomb();l.skipExpGolomb();g=l.readUnsignedExpGolomb();for(v=0;v<g;v++){l.skipExpGolomb()}}l.skipUnsignedExpGolomb();l.skipBits(1);y=l.readUnsignedExpGolomb();h=l.readUnsignedExpGolomb();_=l.readBits(1);if(0===_){l.skipBits(1)}l.skipBits(1);if(l.readBoolean()){t=l.readUnsignedExpGolomb();a=l.readUnsignedExpGolomb();r=l.readUnsignedExpGolomb();n=l.readUnsignedExpGolomb()}if(l.readBoolean()){if(l.readBoolean()){T=l.readUnsignedByte();switch(T){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:{b=[l.readUnsignedByte()<<8|l.readUnsignedByte(),l.readUnsignedByte()<<8|l.readUnsignedByte()];break}}if(b){s=b[0]/b[1]}}}return{profileIdc:d,levelIdc:p,profileCompatibility:u,width:Math.ceil((16*(y+1)-2*t-2*a)*s),height:16*((2-_)*(h+1))-2*r-2*n,sarRatio:b}}};We.prototype=new a;var $e={H264Stream:We,NalByteStream:ze},Ke=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ye=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Xe=function(e,t,a){var r,n="";for(r=t;r<a;r++){n+="%"+("00"+e[r].toString(16)).slice(-2)}return n},Qe=function(e,t,a){return unescape(Xe(e,t,a))},Je={isLikelyAacData:function(e){if(e[0]===73&&e[1]===68&&e[2]===51){return!0}return!1},parseId3TagSize:function(e,t){var a=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],r=e[t+5];if((16&r)>>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,r=e[t+4]<<3,n=e[t+3]&6144;return n|r|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:function(e){var t=0;while(t+5<e.length){if(255!==e[t]||240!=(246&e[t+1])){t++;continue}return Ke[(60&e[t+2])>>>2]}return null},parseAacTimestamp:function(e){var t,a,r,n;t=10;if(64&e[5]){t+=4;t+=Ye(e.subarray(10,14))}do{a=Ye(e.subarray(t+4,t+8));if(1>a){return null}n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===n){r=e.subarray(t+10,t+a+10);for(var s=0;s<r.byteLength;s++){if(0===r[s]){var o=Qe(r,0,s);if("com.apple.streaming.transportStreamTimestamp"===o){var l=r.subarray(s+1),d=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(t<e.byteLength);return null}},Ze;Ze=function(){var e=new Uint8Array,t=0;Ze.prototype.init.call(this);this.setTimestamp=function(e){t=e};this.push=function(a){var r=0,n=0,i,s,o,l;if(e.length){l=e.length;e=new Uint8Array(a.byteLength+l);e.set(e.subarray(0,l));e.set(a,l)}else{e=a}while(3<=e.length-n){if(e[n]===73&&e[n+1]===68&&e[n+2]===51){if(10>e.length-n){break}r=Je.parseId3TagSize(e,n);if(n+r>e.length){break}s={type:"timed-metadata",data:e.subarray(n,n+r)};this.trigger("data",s);n+=r;continue}else if(255==(255&e[n])&&240==(240&e[n+1])){if(7>e.length-n){break}r=Je.parseAdtsSize(e,n);if(n+r>e.length){break}o={type:"audio",data:e.subarray(n,n+r),pts:t,dts:t};this.trigger("data",o);n+=r;continue}n++}i=e.length-n;if(0<i){e=e.subarray(n)}else{e=new Uint8Array}};this.reset=function(){e=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){e=new Uint8Array;this.trigger("endedtimeline")}};Ze.prototype=new a;var et=Ze,tt=$e.H264Stream,at=Je.isLikelyAacData,rt=re.ONE_SECOND_IN_TS,nt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],it=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],st,ot,lt,dt,pt=function(e,t){var a;if(e.length!==t.length){return!1}for(a=0;a<e.length;a++){if(e[a]!==t[a]){return!1}}return!0},ut=function(e,t,a,r,n,i){return{start:{dts:e,pts:e+(a-t)},end:{dts:e+(r-t),pts:e+(n-a)},prependedContentDuration:i,baseMediaDecodeTime:e}};ot=function(e,t){var a=[],r=0,n=0,i=0,s=1/0;t=t||{};ot.prototype.init.call(this);this.push=function(t){oe.collectDtsInfo(e,t);if(e){nt.forEach(function(a){e[a]=t[a]})}a.push(t)};this.setEarliestDts=function(t){n=t-e.timelineStartInfo.baseMediaDecodeTime};this.setVideoBaseMediaDecodeTime=function(e){s=e};this.setAudioAppendStart=function(e){i=e};this.flush=function(){var o,l,d,p,u;if(0===a.length){this.trigger("done","AudioSegmentStream");return}o=ie.trimAdtsFramesByEarliestDts(a,e,n);e.baseMediaDecodeTime=oe.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps);ie.prefixWithSilence(e,o,i,s);e.samples=ie.generateSampleTable(o);d=F.mdat(ie.concatenateFrameData(o));a=[];l=F.moof(r,[e]);p=new Uint8Array(l.byteLength+d.byteLength);r++;p.set(l);p.set(d,l.byteLength);oe.clearDtsInfo(e);u=Math.ceil(1024*rt/e.samplerate);if(o.length){this.trigger("timingInfo",{start:o[0].dts,end:o[0].dts+o.length*u})}this.trigger("data",{track:e,boxes:p});this.trigger("done","AudioSegmentStream")};this.reset=function(){oe.clearDtsInfo(e);a=[];this.trigger("reset")}};ot.prototype=new a;st=function(e,t){var a=0,r=[],n=[],i,s;t=t||{};st.prototype.init.call(this);delete e.minPTS;this.gopCache_=[];this.push=function(t){oe.collectDtsInfo(e,t);if("seq_parameter_set_rbsp"===t.nalUnitType&&!i){i=t.config;e.sps=[t.data];it.forEach(function(t){e[t]=i[t]},this)}if("pic_parameter_set_rbsp"===t.nalUnitType&&!s){s=t.data;e.pps=[t.data]}r.push(t)};this.flush=function(){var i,s,o,l,d,p,u=0,c,m;while(r.length){if("access_unit_delimiter_rbsp"===r[0].nalUnitType){break}r.shift()}if(0===r.length){this.resetStream_();this.trigger("done","VideoSegmentStream");return}i=V.groupNalsIntoFrames(r);o=V.groupFramesIntoGops(i);if(!o[0][0].keyFrame){s=this.getGopForFusion_(r[0],e);if(s){u=s.duration;o.unshift(s);o.byteLength+=s.byteLength;o.nalCount+=s.nalCount;o.pts=s.pts;o.dts=s.dts;o.duration+=s.duration}else{o=V.extendFirstKeyFrame(o)}}if(n.length){var g;if(t.alignGopsAtEnd){g=this.alignGopsAtEnd_(o)}else{g=this.alignGopsAtStart_(o)}if(!g){this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);r=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}oe.clearDtsInfo(e);o=g}oe.collectDtsInfo(e,o);e.samples=V.generateSampleTable(o);d=F.mdat(V.concatenateNalData(o));e.baseMediaDecodeTime=oe.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps);this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}));c=o[0];m=o[o.length-1];this.trigger("segmentTimingInfo",ut(e.baseMediaDecodeTime,c.dts,c.pts,m.dts+m.duration,m.pts+m.duration,u));this.trigger("timingInfo",{start:o[0].dts,end:o[o.length-1].dts+o[o.length-1].duration});this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);r=[];this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime);this.trigger("timelineStartInfo",e.timelineStartInfo);l=F.moof(a,[e]);p=new Uint8Array(l.byteLength+d.byteLength);a++;p.set(l);p.set(d,l.byteLength);this.trigger("data",{track:e,boxes:p});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();r=[];this.gopCache_.length=0;n.length=0;this.trigger("reset")};this.resetStream_=function(){oe.clearDtsInfo(e);i=void 0;s=void 0};this.getGopForFusion_=function(t){var a=1/0,r,n,s,o,l;for(l=0;l<this.gopCache_.length;l++){o=this.gopCache_[l];s=o.gop;if(!(e.pps&&pt(e.pps[0],o.pps[0]))||!(e.sps&&pt(e.sps[0],o.sps[0]))){continue}if(s.dts<e.timelineStartInfo.dts){continue}r=t.dts-s.dts-s.duration;if(r>=-10000&&r<=45000){if(!n||a>r){n=o;a=r}}}if(n){return n.gop}return null};this.alignGopsAtStart_=function(e){var t,a,r,i,s,o,l,d;s=e.byteLength;o=e.nalCount;l=e.duration;t=a=0;while(t<n.length&&a<e.length){r=n[t];i=e[a];if(r.pts===i.pts){break}if(i.pts>r.pts){t++;continue}a++;s-=i.byteLength;o-=i.nalCount;l-=i.duration}if(0===a){return e}if(a===e.length){return null}d=e.slice(a);d.byteLength=s;d.duration=l;d.nalCount=o;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsAtEnd_=function(e){var t,a,r,i,s,o;t=n.length-1;a=e.length-1;s=null;o=!1;while(0<=t&&0<=a){r=n[t];i=e[a];if(r.pts===i.pts){o=!0;break}if(r.pts>i.pts){t--;continue}if(t===n.length-1){s=a}a--}if(!o&&null===s){return null}var l;if(o){l=a}else{l=s}if(0===l){return e}var d=e.slice(l),p=d.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});d.byteLength=p.byteLength;d.duration=p.duration;d.nalCount=p.nalCount;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsWith=function(e){n=e}};st.prototype=new a;dt=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if("undefined"!=typeof e.remux){this.remuxTracks=!!e.remux}else{this.remuxTracks=!0}if("boolean"==typeof e.keepOriginalTimestamps){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=!1}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;dt.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if("video"===e.track.type){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if("audio"===e.track.type){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};dt.prototype=new a;dt.prototype.flush=function(e){var t=0,a={captions:[],captionStreams:{},metadata:[],info:{}},r,n,s,o=0,l;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e){return}else if(this.remuxTracks){return}else if(0===this.pendingTracks.length){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){o=this.videoTrack.timelineStartInfo.pts;it.forEach(function(e){a.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;nt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(1===this.pendingTracks.length){a.type=this.pendingTracks[0].type}else{a.type="combined"}this.emittedTracks+=this.pendingTracks.length;s=F.initSegment(this.pendingTracks);a.initSegment=new Uint8Array(s.byteLength);a.initSegment.set(s);a.data=new Uint8Array(this.pendingBytes);for(l=0;l<this.pendingBoxes.length;l++){a.data.set(this.pendingBoxes[l],t);t+=this.pendingBoxes[l].byteLength}for(l=0;l<this.pendingCaptions.length;l++){r=this.pendingCaptions[l];r.startTime=re.metadataTsToSeconds(r.startPts,o,this.keepOriginalTimestamps);r.endTime=re.metadataTsToSeconds(r.endPts,o,this.keepOriginalTimestamps);a.captionStreams[r.stream]=!0;a.captions.push(r)}for(l=0;l<this.pendingMetadata.length;l++){n=this.pendingMetadata[l];n.cueTime=re.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps);a.metadata.push(n)}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);for(l=0;l<a.captions.length;l++){r=a.captions[l];this.trigger("caption",r)}for(l=0;l<a.metadata.length;l++){n=a.metadata[l];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};dt.prototype.setRemux=function(e){this.remuxTracks=e};lt=function(e){var t=this,a=!0,r,n;lt.prototype.init.call(this);e=e||{};this.baseMediaDecodeTime=e.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="aac";a.metadataStream=new Ne.MetadataStream;a.aacStream=new et;a.audioTimestampRolloverStream=new Ne.TimestampRolloverStream("audio");a.timedMetadataTimestampRolloverStream=new Ne.TimestampRolloverStream("timed-metadata");a.adtsStream=new He;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.aacStream;a.aacStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream);a.aacStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream);a.metadataStream.on("timestamp",function(e){a.aacStream.setTimestamp(e.timeStamp)});a.aacStream.on("data",function(i){if("timed-metadata"===i.type&&!a.audioSegmentStream){n=n||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"};a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(n,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!r})});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="ts";a.metadataStream=new Ne.MetadataStream;a.packetStream=new Ne.TransportPacketStream;a.parseStream=new Ne.TransportParseStream;a.elementaryStream=new Ne.ElementaryStream;a.timestampRolloverStream=new Ne.TimestampRolloverStream;a.adtsStream=new He;a.h264Stream=new tt;a.captionStream=new Ne.CaptionStream;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.packetStream;a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream).pipe(a.timestampRolloverStream);a.timestampRolloverStream.pipe(a.h264Stream);a.timestampRolloverStream.pipe(a.adtsStream);a.timestampRolloverStream.pipe(a.metadataStream).pipe(a.coalesceStream);a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream);a.elementaryStream.on("data",function(s){var o;if("metadata"===s.type){o=s.tracks.length;while(o--){if(!r&&"video"===s.tracks[o].type){r=s.tracks[o];r.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}else if(!n&&"audio"===s.tracks[o].type){n=s.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}}if(r&&!a.videoSegmentStream){a.coalesceStream.numberOfTracks++;a.videoSegmentStream=new st(r,e);a.videoSegmentStream.on("timelineStartInfo",function(e){if(n){n.timelineStartInfo=e;a.audioSegmentStream.setEarliestDts(e.dts)}});a.videoSegmentStream.on("processedGopsInfo",t.trigger.bind(t,"gopInfo"));a.videoSegmentStream.on("segmentTimingInfo",t.trigger.bind(t,"videoSegmentTimingInfo"));a.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(n){a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});a.videoSegmentStream.on("timingInfo",t.trigger.bind(t,"videoTimingInfo"));a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)}if(n&&!a.audioSegmentStream){a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(n,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!r})}});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("id3Frame",function(e){e.dispatchType=a.metadataStream.dispatchType;t.trigger("id3Frame",e)});a.coalesceStream.on("caption",this.trigger.bind(this,"caption"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(t){var a=this.transmuxPipeline_;if(!e.keepOriginalTimestamps){this.baseMediaDecodeTime=t}if(n){n.timelineStartInfo.dts=void 0;n.timelineStartInfo.pts=void 0;oe.clearDtsInfo(n);if(!e.keepOriginalTimestamps){n.timelineStartInfo.baseMediaDecodeTime=t}if(a.audioTimestampRolloverStream){a.audioTimestampRolloverStream.discontinuity()}}if(r){if(a.videoSegmentStream){a.videoSegmentStream.gopCache_=[]}r.timelineStartInfo.dts=void 0;r.timelineStartInfo.pts=void 0;oe.clearDtsInfo(r);a.captionStream.reset();if(!e.keepOriginalTimestamps){r.timelineStartInfo.baseMediaDecodeTime=t}}if(a.timestampRolloverStream){a.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(n){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(t){var a=this.transmuxPipeline_;e.remux=t;if(a&&a.coalesceStream){a.coalesceStream.setRemux(t)}};this.alignGopsWith=function(e){if(r&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.push=function(e){if(a){var t=at(e);if(t&&"aac"!==this.transmuxPipeline_.type){this.setupAacPipeline()}else if(!t&&"ts"!==this.transmuxPipeline_.type){this.setupTsPipeline()}a=!1}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){a=!0;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};lt.prototype=new a;var ct={Transmuxer:lt,VideoSegmentStream:st,AudioSegmentStream:ot,AUDIO_PROPERTIES:nt,VIDEO_PROPERTIES:it,generateVideoSegmentTimingInfo:ut},mt=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},gt=function(){function e(e,t){for(var a=0,r;a<t.length;a++){r=t[a];r.enumerable=r.enumerable||!1;r.configurable=!0;if("value"in r)r.writable=!0;Object.defineProperty(e,r.key,r)}}return function(t,a,r){if(a)e(t.prototype,a);if(r)e(t,r);return t}}(),yt=function(e,t){t.on("data",function(t){var a=t.initSegment;t.initSegment={data:a.buffer,byteOffset:a.byteOffset,byteLength:a.byteLength};var r=t.data;t.data=r.buffer;e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])});if(t.captionStream){t.captionStream.on("data",function(t){e.postMessage({action:"caption",data:t})})}t.on("done",function(){e.postMessage({action:"done"})});t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})});t.on("videoSegmentTimingInfo",function(t){e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})})},ht=function(){function e(t,a){mt(this,e);this.options=a||{};this.self=t;this.init()}gt(e,[{key:"init",value:function(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new ct.Transmuxer(this.options);yt(this.self,this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]);return e}(),_t=new function(e){e.onmessage=function(t){if("init"===t.data.action&&t.data.options){this.messageHandlers=new ht(e,t.data.options);return}if(!this.messageHandlers){this.messageHandlers=new ht(e)}if(t.data&&t.data.action&&"init"!==t.data.action){if(this.messageHandlers[t.data.action]){this.messageHandlers[t.data.action](t.data)}}}}(e);return _t}()}),ju={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Fu=function(e){return e.map(function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,a){var r=("00"+(+t).toString(16)).slice(-2),n=("00"+(+a).toString(16)).slice(-2);return"avc1."+r+"00"+n})})},Hu=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",t={codecCount:0},a=void 0;t.codecCount=e.split(",").length;t.codecCount=t.codecCount||2;a=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e);if(a){t.videoCodec=a[2];t.videoObjectTypeIndicator=a[3]}t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e);t.audioProfile=t.audioProfile&&t.audioProfile[2];return t},qu=function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,function(e){return Fu([e])[0]})},Vu=function(e,t,a){return e+"/"+t+"; codecs=\""+a.filter(function(e){return!!e}).join(", ")+"\""},Wu=function(e){if(e.segments&&e.segments.length&&e.segments[0].map){return"mp4"}return"mp2t"},zu=function(e){var t=e.attributes||{};if(t.CODECS){return Hu(t.CODECS)}return ju},Gu=function(e,t){if(!e.mediaGroups.AUDIO||!t){return null}var a=e.mediaGroups.AUDIO[t];if(!a){return null}for(var r in a){var n=a[r];if(n["default"]&&n.playlists){return Hu(n.playlists[0].attributes.CODECS).audioProfile}}return null},$u=function(e,t){var a=Wu(t),r=zu(t),n=t.attributes||{},i=!0,s=!1;if(!t){return[]}if(e.mediaGroups.AUDIO&&n.AUDIO){var o=e.mediaGroups.AUDIO[n.AUDIO];if(o){s=!0;i=!1;for(var l in o){if(!o[l].uri&&!o[l].playlists){i=!0;break}}}}if(s&&!r.audioProfile){if(!i){r.audioProfile=Gu(e,n.AUDIO)}if(!r.audioProfile){it.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)");r.audioProfile=ju.audioProfile}}var d={};if(r.videoCodec){d.video=""+r.videoCodec+r.videoObjectTypeIndicator}if(r.audioProfile){d.audio="mp4a.40."+r.audioProfile}var p=Vu("audio",a,[d.audio]),u=Vu("video",a,[d.video]),c=Vu("video",a,[d.video,d.audio]);if(s){if(!i&&d.video){return[u,p]}if(!i&&!d.video){return[p,p]}return[c,p]}if(!d.video){return[p]}return[c]},Ku=function(e){var t={type:"",parameters:{}},a=e.trim().split(";");t.type=a.shift().trim();a.forEach(function(e){var a=e.trim().split("=");if(1<a.length){var r=a[0].replace(/"/g,"").trim(),n=a[1].replace(/"/g,"").trim();t.parameters[r]=n}});return t},Yu=function(e){return /mp4a\.\d+.\d+/i.test(e)},Xu=function(e){return /avc1\.[\da-f]+/i.test(e)},Qu=function(e,t,a){if("undefined"==typeof t||null===t||!e.length){return[]}var r=Math.ceil(9e4*(t-a+3)),n=void 0;for(n=0;n<e.length;n++){if(e[n].pts>r){break}}return e.slice(n)},Ju=function(e,t,a){if(!t.length){return e}if(a){return t.slice()}var r=t[0].pts,n=0;for(n;n<e.length;n++){if(e[n].pts>=r){break}}return e.slice(0,n).concat(t)},Zu=function(e,t,a,r){var n=Math.ceil(9e4*(t-r)),s=Math.ceil(9e4*(a-r)),o=e.slice(),l=e.length;while(l--){if(e[l].pts<=s){break}}if(-1==l){return o}var d=l+1;while(d--){if(e[d].pts<=n){break}}d=Math.max(d,0);o.splice(d,l-d+1);return o},ec=function(e,t,a){var r=null,n=null,i=0,s=[],o=[];if(!e&&!t){return it.createTimeRange()}if(!e){return t.buffered}if(!t){return e.buffered}if(a){return e.buffered}if(0===e.buffered.length&&0===t.buffered.length){return it.createTimeRange()}var l=e.buffered,d=t.buffered,p=l.length;while(p--){s.push({time:l.start(p),type:"start"});s.push({time:l.end(p),type:"end"})}p=d.length;while(p--){s.push({time:d.start(p),type:"start"});s.push({time:d.end(p),type:"end"})}s.sort(function(e,t){return e.time-t.time});for(p=0;p<s.length;p++){if("start"===s[p].type){i++;if(2===i){r=s[p].time}}else if("end"===s[p].type){i--;if(1===i){n=s[p].time}}if(null!==r&&null!==n){o.push([r,n]);r=null;n=null}}return it.createTimeRanges(o)},tc=9e4,ac=function(e,t){var a=e.addSourceBuffer(t),r=Object.create(null);r.updating=!1;r.realBuffer_=a;var n=function(e){if("function"==typeof a[e]){r[e]=function(){return a[e].apply(a,arguments)}}else if("undefined"==typeof r[e]){Object.defineProperty(r,e,{get:function(){return a[e]},set:function(t){return a[e]=t}})}};for(var i in a){n(i)}return r},rc=function(e){cp(t,e);function t(e,a){dp(this,t);var r=mp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,it.EventTarget));r.timestampOffset_=0;r.pendingBuffers_=[];r.bufferUpdating_=!1;r.mediaSource_=e;r.codecs_=a;r.audioCodec_=null;r.videoCodec_=null;r.audioDisabled_=!1;r.appendAudioInitSegment_=!0;r.gopBuffer_=[];r.timeMapping_=0;r.safeAppend_=11<=it.browser.IE_VERSION;var n={remux:!1,alignGopsAtEnd:r.safeAppend_};r.codecs_.forEach(function(e){if(Yu(e)){r.audioCodec_=e}else if(Xu(e)){r.videoCodec_=e}});r.transmuxer_=new Bu;r.transmuxer_.postMessage({action:"init",options:n});r.transmuxer_.onmessage=function(e){if("data"===e.data.action){return r.data_(e)}if("done"===e.data.action){return r.done_(e)}if("gopInfo"===e.data.action){return r.appendGopInfo_(e)}if("videoSegmentTimingInfo"===e.data.action){return r.videoSegmentTimingInfo_(e.data.videoSegmentTimingInfo)}};Object.defineProperty(r,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){if("number"==typeof e&&0<=e){this.timestampOffset_=e;this.appendAudioInitSegment_=!0;this.gopBuffer_.length=0;this.timeMapping_=0;this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e})}}});Object.defineProperty(r,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){if(this.videoBuffer_){this.videoBuffer_.appendWindowStart=e}if(this.audioBuffer_){this.audioBuffer_.appendWindowStart=e}}});Object.defineProperty(r,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}});Object.defineProperty(r,"buffered",{get:function(){return ec(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}});return r}pp(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength);t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength);Eu(this,this.mediaSource_,t);this.pendingBuffers_.push(t)}},{key:"done_",value:function(){if("closed"===this.mediaSource_.readyState){this.pendingBuffers_.length=0;return}this.processPendingSegments_()}},{key:"videoSegmentTimingInfo_",value:function(e){var t={start:{decode:e.start.dts/tc,presentation:e.start.pts/tc},end:{decode:e.end.dts/tc,presentation:e.end.pts/tc},baseMediaDecodeTime:e.baseMediaDecodeTime/tc};if(e.prependedContentDuration){t.prependedContentDuration=e.prependedContentDuration/tc}this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach(function(a){if(!e[a+"Codec_"]){return}if(e[a+"Buffer_"]){return}var r=null;if(e.mediaSource_[a+"Buffer_"]){r=e.mediaSource_[a+"Buffer_"];r.updating=!1}else{var n=a+"/mp4;codecs=\""+e[a+"Codec_"]+"\"";r=ac(e.mediaSource_.nativeMediaSource_,n);e.mediaSource_[a+"Buffer_"]=r}e[a+"Buffer_"]=r;["update","updatestart","updateend"].forEach(function(n){r.addEventListener(n,function(){if("audio"===a&&e.audioDisabled_){return}if("updateend"===n){e[a+"Buffer_"].updating=!1}var r=t.every(function(r){if("audio"===r&&e.audioDisabled_){return!0}if(a!==r&&e[r+"Buffer_"]&&e[r+"Buffer_"].updating){return!1}return!0});if(r){return e.trigger(n)}})})})}},{key:"appendBuffer",value:function(e){this.bufferUpdating_=!0;if(this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}if(this.videoBuffer_){this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:Qu(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)})}this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]);this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=Ju(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_){this.videoBuffer_.updating=!0;this.videoBuffer_.remove(e,t);this.gopBuffer_=Zu(this.gopBuffer_,e,t,this.timeMapping_)}if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.updating=!0;this.audioBuffer_.remove(e,t)}Pu(e,t,this.metadataTrack_);if(this.inbandTextTracks_){for(var a in this.inbandTextTracks_){Pu(e,t,this.inbandTextTracks_[a])}}}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};if(!this.pendingBuffers_.length){this.trigger("updateend");this.bufferUpdating_=!1;return}e=this.pendingBuffers_.reduce(function(e,t){var a=t.type,r=t.data,n=t.initSegment;e[a].segments.push(r);e[a].bytes+=r.byteLength;e[a].initSegment=n;if(t.captions){e.captions=e.captions.concat(t.captions)}if(t.info){e[a].info=t.info}if(t.metadata){e.metadata=e.metadata.concat(t.metadata)}return e},e);if(!this.videoBuffer_&&!this.audioBuffer_){if(0===e.video.bytes){this.videoCodec_=null}if(0===e.audio.bytes){this.audioCodec_=null}this.createRealSourceBuffers_()}if(e.audio.info){this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info})}if(e.video.info){this.mediaSource_.trigger({type:"videoinfo",info:e.video.info})}if(this.appendAudioInitSegment_){if(!this.audioDisabled_&&this.audioBuffer_){e.audio.segments.unshift(e.audio.initSegment);e.audio.bytes+=e.audio.initSegment.byteLength}this.appendAudioInitSegment_=!1}var t=!1;if(this.videoBuffer_&&e.video.bytes){e.video.segments.unshift(e.video.initSegment);e.video.bytes+=e.video.initSegment.byteLength;this.concatAndAppendSegments_(e.video,this.videoBuffer_)}else if(this.videoBuffer_&&(this.audioDisabled_||!this.audioBuffer_)){t=!0}xu(this,e.captions,e.metadata);if(!this.audioDisabled_&&this.audioBuffer_){this.concatAndAppendSegments_(e.audio,this.audioBuffer_)}this.pendingBuffers_.length=0;if(t){this.trigger("updateend")}this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var a=0,r=void 0;if(e.bytes){r=new Uint8Array(e.bytes);e.segments.forEach(function(e){r.set(e,a);a+=e.byteLength});try{t.updating=!0;t.appendBuffer(r)}catch(e){if(this.mediaSource_.player_){this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}}},{key:"abort",value:function(){if(this.videoBuffer_){this.videoBuffer_.abort()}if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.abort()}if(this.transmuxer_){this.transmuxer_.postMessage({action:"reset"})}this.pendingBuffers_.length=0;this.bufferUpdating_=!1}}]);return t}(it.EventTarget),nc=function(a){cp(r,a);function r(){dp(this,r);var a=mp(this,(r.__proto__||Object.getPrototypeOf(r)).call(this)),n=void 0;a.nativeMediaSource_=new e.MediaSource;for(n in a.nativeMediaSource_){if(!(n in r.prototype)&&"function"==typeof a.nativeMediaSource_[n]){a[n]=a.nativeMediaSource_[n].bind(a.nativeMediaSource_)}}a.duration_=NaN;Object.defineProperty(a,"duration",{get:function(){if(this.duration_===1/0){return this.duration_}return this.nativeMediaSource_.duration},set:function(e){this.duration_=e;if(e!==1/0){this.nativeMediaSource_.duration=e}}});Object.defineProperty(a,"seekable",{get:function(){if(this.duration_===1/0){return it.createTimeRanges([[0,this.nativeMediaSource_.duration]])}return this.nativeMediaSource_.seekable}});Object.defineProperty(a,"readyState",{get:function(){return this.nativeMediaSource_.readyState}});Object.defineProperty(a,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}});a.sourceBuffers=[];a.activeSourceBuffers_=[];a.updateActiveSourceBuffers_=function(){a.activeSourceBuffers_.length=0;if(1===a.sourceBuffers.length){var e=a.sourceBuffers[0];e.appendAudioInitSegment_=!0;e.audioDisabled_=!e.audioCodec_;a.activeSourceBuffers_.push(e);return}for(var t=!1,r=!0,n=0,s;n<a.player_.audioTracks().length;n++){s=a.player_.audioTracks()[n];if(s.enabled&&"main"!==s.kind){t=!0;r=!1;break}}a.sourceBuffers.forEach(function(e,n){e.appendAudioInitSegment_=!0;if(e.videoCodec_&&e.audioCodec_){e.audioDisabled_=t}else if(e.videoCodec_&&!e.audioCodec_){e.audioDisabled_=!0;r=!1}else if(!e.videoCodec_&&e.audioCodec_){e.audioDisabled_=n?r:!r;if(e.audioDisabled_){return}}a.activeSourceBuffers_.push(e)})};a.onPlayerMediachange_=function(){a.sourceBuffers.forEach(function(e){e.appendAudioInitSegment_=!0})};a.onHlsReset_=function(){a.sourceBuffers.forEach(function(e){if(e.transmuxer_){e.transmuxer_.postMessage({action:"resetCaptions"})}})};a.onHlsSegmentTimeMapping_=function(e){a.sourceBuffers.forEach(function(t){return t.timeMapping_=e.mapping})};["sourceopen","sourceclose","sourceended"].forEach(function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))},a);a.on("sourceopen",function(){var e=t.querySelector("[src=\""+a.url_+"\"]");if(!e){return}a.player_=it(e.parentNode);if(!a.player_){return}a.player_.tech_.on("hls-reset",a.onHlsReset_);a.player_.tech_.on("hls-segment-time-mapping",a.onHlsSegmentTimeMapping_);if(a.player_.audioTracks&&a.player_.audioTracks()){a.player_.audioTracks().on("change",a.updateActiveSourceBuffers_);a.player_.audioTracks().on("addtrack",a.updateActiveSourceBuffers_);a.player_.audioTracks().on("removetrack",a.updateActiveSourceBuffers_)}a.player_.on("mediachange",a.onPlayerMediachange_)});a.on("sourceended",function(){for(var e=Lu(a.duration),t=0;t<a.sourceBuffers.length;t++){var r=a.sourceBuffers[t],n=r.metadataTrack_&&r.metadataTrack_.cues;if(n&&n.length){n[n.length-1].endTime=e}}});a.on("sourceclose",function(){this.sourceBuffers.forEach(function(e){if(e.transmuxer_){e.transmuxer_.terminate()}});this.sourceBuffers.length=0;if(!this.player_){return}if(this.player_.audioTracks&&this.player_.audioTracks()){this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_);this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_);this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)}if(this.player_.el_){this.player_.off("mediachange",this.onPlayerMediachange_)}if(this.player_.tech_&&this.player_.tech_.el_){this.player_.tech_.off("hls-reset",this.onHlsReset_);this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)}});return a}pp(r,[{key:"addSeekableRange_",value:function(e,t){var a;if(this.duration!==1/0){a=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity");a.name="InvalidStateError";a.code=11;throw a}if(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration)){this.nativeMediaSource_.duration=t}}},{key:"addSourceBuffer",value:function(e){var t=void 0,a=Ku(e);if(/^(video|audio)\/mp2t$/i.test(a.type)){var r=[];if(a.parameters&&a.parameters.codecs){r=a.parameters.codecs.split(",");r=Fu(r);r=r.filter(function(e){return Yu(e)||Xu(e)})}if(0===r.length){r=["avc1.4d400d","mp4a.40.2"]}t=new rc(this,r);if(0!==this.sourceBuffers.length){this.sourceBuffers[0].createRealSourceBuffers_();t.createRealSourceBuffers_();this.sourceBuffers[0].audioDisabled_=!0}}else{t=this.nativeMediaSource_.addSourceBuffer(e)}this.sourceBuffers.push(t);return t}}]);return r}(it.EventTarget),ic=0;it.mediaSources={};var sc=function(e,t){var a=it.mediaSources[e];if(a){a.trigger({type:"sourceopen",swfId:t})}else{throw new Error("Media Source not found (Video.js)")}},oc=function(){return!!e.MediaSource&&!!e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported("video/mp4;codecs=\"avc1.4d400d,mp4a.40.2\"")},lc=function(){this.MediaSource={open:sc,supportsNativeMediaSources:oc};if(oc()){return new nc}throw new Error("Cannot use create a virtual MediaSource for this video")};lc.open=sc;lc.supportsNativeMediaSources=oc;var dc={createObjectURL:function(t){var a=void 0;if(t instanceof nc){a=e.URL.createObjectURL(t.nativeMediaSource_);t.url_=a;return a}if(!(t instanceof nc)){a=e.URL.createObjectURL(t);t.url_=a;return a}a="blob:vjs-media-source/"+ic;ic++;it.mediaSources[a]=t;return a}};it.MediaSource=lc;it.URL=dc;var pc=it.EventTarget,uc=it.mergeOptions,cc=function(e,t){for(var a=void 0,r=uc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),n=0,s;n<t.playlists.length;n++){s=vp(r,t.playlists[n]);if(s){r=s}else{a=!0}}fp(t,function(e,t,n,i){if(e.playlists&&e.playlists.length){var s=e.playlists[0].uri,o=vp(r,e.playlists[0]);if(o){r=o;r.mediaGroups[t][n][i].playlists[0]=r.playlists[s];a=!1}}});if(a){return null}return r},mc=function(e){var t=e.byterange.offset+e.byterange.length-1;return e.uri+"-"+e.byterange.offset+"-"+t},gc=function(e,t){var a=!!(!e.map&&!t.map),r=a||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return r&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},yc=function(e,t){var a={};for(var r in e){var n=e[r],i=n.sidx;if(i){var s=mc(i);if(!t[s]){break}var o=t[s].sidxInfo;if(gc(o,i)){a[s]=t[s]}}}return a},hc=function(e,t,a,r){var n=Pl(e,{manifestUri:t,clientOffset:a}),i=yc(n.playlists,r),s=i;fp(n,function(e){if(e.playlists&&e.playlists.length){var t=e.playlists;s=uc(s,yc(t,r))}});return s},_c=function(e,t,a,r,n){var i={uri:lp(r.handleManifestRedirects,e.resolvedUri),byterange:e.byterange,playlist:t},s=it.mergeOptions(i,{responseType:"arraybuffer",headers:Qp(i)});return a(s,n)},fc=function(t){cp(a,t);function a(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},n=arguments[3];dp(this,a);var i=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this)),s=r.withCredentials,o=s===void 0?!1:s,l=r.handleManifestRedirects,d=l===void 0?!1:l;i.hls_=t;i.withCredentials=o;i.handleManifestRedirects=d;if(!e){throw new Error("A non-empty playlist URL or playlist is required")}i.on("minimumUpdatePeriod",function(){i.refreshXml_()});i.on("mediaupdatetimeout",function(){i.refreshMedia_(i.media().uri)});i.state="HAVE_NOTHING";i.loadedPlaylists_={};if("string"==typeof e){i.srcUrl=e;i.sidxMapping_={};return mp(i)}i.setupChildLoader(n,e);return i}pp(a,[{key:"setupChildLoader",value:function(e,t){this.masterPlaylistLoader_=e;this.childPlaylist_=t}},{key:"dispose",value:function(){this.stopRequest();this.loadedPlaylists_={};e.clearTimeout(this.minimumUpdatePeriodTimeout_);e.clearTimeout(this.mediaRequest_);e.clearTimeout(this.mediaUpdateTimeout)}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}},{key:"sidxRequestFinished_",value:function(e,t,a,r){var n=this;return function(i,s){if(!n.request){return}n.request=null;if(i){n.error={status:s.status,message:"DASH playlist request error at URL: "+e.uri,response:s.response,code:2};if(a){n.state=a}n.trigger("error");return r(t,null)}var o=new Uint8Array(s.response),l=zl.parseSidx(o.subarray(8));return r(t,l)}}},{key:"media",value:function(t){var a=this;if(!t){return this.media_}if("HAVE_NOTHING"===this.state){throw new Error("Cannot switch media playlist from "+this.state)}var r=this.state;if("string"==typeof t){if(!this.master.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.master.playlists[t]}var n=!this.media_||t.uri!==this.media_.uri;if(n&&this.loadedPlaylists_[t.uri]&&this.loadedPlaylists_[t.uri].endList){this.state="HAVE_METADATA";this.media_=t;if(n){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!n){return}if(this.media_){this.trigger("mediachanging")}if(!t.sidx){this.mediaRequest_=e.setTimeout(this.haveMetadata.bind(this,{startingState:r,playlist:t}),0);return}var i=void 0,s=void 0;if(this.masterPlaylistLoader_){i=this.masterPlaylistLoader_.master;s=this.masterPlaylistLoader_.sidxMapping_}else{i=this.master;s=this.sidxMapping_}var o=mc(t.sidx);s[o]={sidxInfo:t.sidx};this.request=_c(t.sidx,t,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(t,i,r,function(e,n){if(!e||!n){throw new Error("failed to request sidx")}s[o].sidx=n;a.haveMetadata({startingState:r,playlist:e.playlists[t.uri]})}))}},{key:"haveMetadata",value:function(e){var t=e.startingState,a=e.playlist;this.state="HAVE_METADATA";this.loadedPlaylists_[a.uri]=a;this.mediaRequest_=null;this.refreshMedia_(a.uri);if("HAVE_MASTER"===t){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}},{key:"pause",value:function(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);e.clearTimeout(this.minimumUpdatePeriodTimeout_);if("HAVE_NOTHING"===this.state){this.started=!1}}},{key:"load",value:function(t){var a=this;e.clearTimeout(this.mediaUpdateTimeout);e.clearTimeout(this.minimumUpdatePeriodTimeout_);var r=this.media();if(t){var n=r?1e3*(r.targetDuration/2):5000;this.mediaUpdateTimeout=e.setTimeout(function(){return a.load()},n);return}if(!this.started){this.start();return}this.trigger("loadedplaylist")}},{key:"parseMasterXml",value:function(){var e=Pl(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});e.uri=this.srcUrl;for(var t=0,a;t<e.playlists.length;t++){a="placeholder-uri-"+t;e.playlists[t].uri=a;e.playlists[a]=e.playlists[t]}fp(e,function(t,a,r,n){if(t.playlists&&t.playlists.length){var i="placeholder-uri-"+a+"-"+r+"-"+n;t.playlists[0].uri=i;e.playlists[i]=t.playlists[0]}});Sp(e);kp(e);return e}},{key:"start",value:function(){var t=this;this.started=!0;if(this.masterPlaylistLoader_){this.mediaRequest_=e.setTimeout(this.haveMaster_.bind(this),0);return}this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,a){if(!t.request){return}t.request=null;if(e){t.error={status:a.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:a.responseText,code:2};if("HAVE_NOTHING"===t.state){t.started=!1}return t.trigger("error")}t.masterXml_=a.responseText;if(a.responseHeaders&&a.responseHeaders.date){t.masterLoaded_=Date.parse(a.responseHeaders.date)}else{t.masterLoaded_=Date.now()}t.srcUrl=lp(t.handleManifestRedirects,t.srcUrl,a);t.syncClientServerClock_(t.onClientServerClockSync_.bind(t))})}},{key:"syncClientServerClock_",value:function(e){var t=this,a=Il(this.masterXml_);if(null===a){this.clientOffset_=this.masterLoaded_-Date.now();return e()}if("DIRECT"===a.method){this.clientOffset_=a.value-Date.now();return e()}this.request=this.hls_.xhr({uri:op(this.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(r,n){if(!t.request){return}if(r){t.clientOffset_=t.masterLoaded_-Date.now();return e()}var i;if("HEAD"===a.method){if(!n.responseHeaders||!n.responseHeaders.date){i=t.masterLoaded_}else{i=Date.parse(n.responseHeaders.date)}}else{i=Date.parse(n.responseText)}t.clientOffset_=i-Date.now();e()})}},{key:"haveMaster_",value:function(){this.state="HAVE_MASTER";this.mediaRequest_=null;if(!this.masterPlaylistLoader_){this.master=this.parseMasterXml();this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}},{key:"onClientServerClockSync_",value:function(){var t=this;this.haveMaster_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.master.playlists[0])}if(this.master&&this.master.minimumUpdatePeriod){this.minimumUpdatePeriodTimeout_=e.setTimeout(function(){t.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod)}}},{key:"refreshXml_",value:function(){var t=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(a,r){if(!t.request){return}t.request=null;if(a){t.error={status:r.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:r.responseText,code:2};if("HAVE_NOTHING"===t.state){t.started=!1}return t.trigger("error")}t.masterXml_=r.responseText;t.sidxMapping_=hc(t.masterXml_,t.srcUrl,t.clientOffset_,t.sidxMapping_);var n=t.parseMasterXml(),i=cc(t.master,n),s=t.media().sidx;if(i){if(s){var o=mc(s);if(!t.sidxMapping_[o]){var l=t.media();t.request=_c(l.sidx,l,t.hls_.xhr,{handleManifestRedirects:t.handleManifestRedirects},t.sidxRequestFinished_(l,n,t.state,function(a,r){if(!a||!r){throw new Error("failed to request sidx on minimumUpdatePeriod")}t.sidxMapping_[o].sidx=r;t.minimumUpdatePeriodTimeout_=e.setTimeout(function(){t.trigger("minimumUpdatePeriod")},t.master.minimumUpdatePeriod);t.refreshMedia_(t.media().uri)}))}}else{t.master=i}}t.minimumUpdatePeriodTimeout_=e.setTimeout(function(){t.trigger("minimumUpdatePeriod")},t.master.minimumUpdatePeriod)})}},{key:"refreshMedia_",value:function(t){var a=this;if(!t){throw new Error("refreshMedia_ must take a media uri")}var r=void 0,n=void 0;if(this.masterPlaylistLoader_){r=this.masterPlaylistLoader_.master;n=this.masterPlaylistLoader_.parseMasterXml()}else{r=this.master;n=this.parseMasterXml()}var i=cc(r,n);if(i){if(this.masterPlaylistLoader_){this.masterPlaylistLoader_.master=i}else{this.master=i}this.media_=i.playlists[t]}else{this.media_=n.playlists[t];this.trigger("playlistunchanged")}if(!this.media().endList){this.mediaUpdateTimeout=e.setTimeout(function(){a.trigger("mediaupdatetimeout")},Cp(this.media(),!!i))}this.trigger("loadedplaylist")}}]);return a}(pc),bc=function(e){if(it.log.debug){return it.log.debug.bind(it,"VHS:",e+" >")}return function(){}};function yt(){}var Tc=function(){function e(t,a,r,n){dp(this,e);this.callbacks_=[];this.pendingCallback_=null;this.timestampOffset_=0;this.mediaSource=t;this.processedAppend_=!1;this.type_=r;this.mimeType_=a;this.logger_=bc("SourceUpdater["+r+"]["+a+"]");if("closed"===t.readyState){t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,a,n))}else{this.createSourceBuffer_(a,n)}}pp(e,[{key:"createSourceBuffer_",value:function(e,t){var a=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e);this.logger_("created SourceBuffer");if(t){t.trigger("sourcebufferadded");if(2>this.mediaSource.sourceBuffers.length){t.on("sourcebufferadded",function(){a.start_()});return}}this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0;this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null;e.sourceBuffer_.removing=!1;e.logger_("buffered ["+Su(e.buffered())+"]");if(t){t()}e.runCallback_()};this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_);this.runCallback_()}},{key:"abort",value:function(e){var t=this;if(this.processedAppend_){this.queueCallback_(function(){t.sourceBuffer_.abort()},e)}}},{key:"appendBuffer",value:function(e,t){var a=this;this.processedAppend_=!0;this.queueCallback_(function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.addEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}a.sourceBuffer_.appendBuffer(e.bytes)},function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}t()})}},{key:"buffered",value:function(){if(!this.sourceBuffer_){return it.createTimeRanges()}return this.sourceBuffer_.buffered}},{key:"remove",value:function(e,t){var a=this,r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:yt;if(this.processedAppend_){this.queueCallback_(function(){a.logger_("remove ["+e+" => "+t+"]");a.sourceBuffer_.removing=!0;a.sourceBuffer_.remove(e,t)},r)}}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==yt}},{key:"timestampOffset",value:function(e){var t=this;if("undefined"!=typeof e){this.queueCallback_(function(){t.sourceBuffer_.timestampOffset=e;t.runCallback_()});this.timestampOffset_=e}return this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]);this.runCallback_()}},{key:"runCallback_",value:function(){var e;if(!this.updating()&&this.callbacks_.length&&this.started_){e=this.callbacks_.shift();this.pendingCallback_=e[1];e[0]()}}},{key:"dispose",value:function(){var e=this,t=function t(){if(e.sourceBuffer_&&"open"===e.mediaSource.readyState){e.sourceBuffer_.abort()}e.sourceBuffer_.removeEventListener("updateend",t)};this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_);if(this.sourceBuffer_.removing){this.sourceBuffer_.addEventListener("updateend",t)}else{t()}}}]);return e}(),vc={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},Sc={FAILURE:2,TIMEOUT:-101,ABORTED:-102},kc=function(e){e.forEach(function(e){e.abort()})},Cc=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},Ec=function(e){var t=e.target,a=Date.now()-t.requestTime,r={bandwidth:1/0,bytesReceived:0,roundTripTime:a||0};r.bytesReceived=e.loaded;r.bandwidth=Math.floor(1e3*(8*(r.bytesReceived/r.roundTripTime)));return r},Pc=function(e,t){if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Sc.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Sc.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Sc.FAILURE,xhr:t}}return null},Ic=function(e,t){return function(a,r){var n=r.response,i=Pc(a,r);if(i){return t(i,e)}if(16!==n.byteLength){return t({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Sc.FAILURE,xhr:r},e)}var s=new DataView(n);e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);return t(null,e)}},Lc=function(e,t,a){return function(r,n){var i=n.response,s=Pc(r,n);if(s){return a(s,e)}if(0===i.byteLength){return a({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:Sc.FAILURE,xhr:n},e)}e.map.bytes=new Uint8Array(n.response);if(t&&!t.isInitialized()){t.init()}e.map.timescales=Nl.timescale(e.map.bytes);e.map.videoTrackIds=Nl.videoTrackIds(e.map.bytes);return a(null,e)}},xc=function(e,t,a){return function(r,n){var i=n.response,s=Pc(r,n),o=void 0;if(s){return a(s,e)}if(0===i.byteLength){return a({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:Sc.FAILURE,xhr:n},e)}e.stats=Cc(n);if(e.key){e.encryptedBytes=new Uint8Array(n.response)}else{e.bytes=new Uint8Array(n.response)}if(t&&e.map&&e.map.bytes){if(!t.isInitialized()){t.init()}o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales);if(o&&o.captions){e.captionStreams=o.captionStreams;e.fmp4Captions=o.captions}}return a(null,e)}},Ac=function(e,t,a){e.addEventListener("message",function r(n){if(n.data.source===t.requestId){e.removeEventListener("message",r);var i=n.data.decrypted;t.bytes=new Uint8Array(i.bytes,i.byteOffset,i.byteLength);return a(null,t)}});var r;if(t.key.bytes.slice){r=t.key.bytes.slice()}else{r=new Uint32Array(Array.prototype.slice.call(t.key.bytes))}e.postMessage(tu({source:t.requestId,encrypted:t.encryptedBytes,key:r,iv:t.key.iv}),[t.encryptedBytes.buffer,r.buffer])},Dc=function(e,t,a){var r=0,n=!1;return function(i,s){if(n){return}if(i){n=!0;kc(e);return a(i,s)}r+=1;if(r===e.length){s.endOfAllRequests=Date.now();if(s.encryptedBytes){return Ac(t,s,a)}return a(null,s)}}},wc=function(e,t){return function(a){e.stats=it.mergeOptions(e.stats,Ec(a));if(!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived){e.stats.firstBytesReceivedAt=Date.now()}return t(a,e)}},Oc=function(e,t,a,r,n,i,s){var o=[],l=Dc(o,a,s);if(n.key&&!n.key.bytes){var d=it.mergeOptions(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),p=Ic(n,l),u=e(d,p);o.push(u)}if(n.map&&!n.map.bytes){var c=it.mergeOptions(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Qp(n.map)}),m=Lc(n,r,l),g=e(c,m);o.push(g)}var y=it.mergeOptions(t,{uri:n.resolvedUri,responseType:"arraybuffer",headers:Qp(n)}),h=xc(n,r,l),_=e(y,h);_.addEventListener("progress",wc(n,i));o.push(_);return function(){return kc(o)}},Rc=function(t,a){var r;if(!t){return""}r=e.getComputedStyle(t);if(!r){return""}return r[a]},Uc=function(e,t){var a=e.slice();e.sort(function(e,r){var n=t(e,r);if(0===n){return a.indexOf(e)-a.indexOf(r)}return n})},Mc=function(t,a){var r=void 0,n=void 0;if(t.attributes.BANDWIDTH){r=t.attributes.BANDWIDTH}r=r||e.Number.MAX_VALUE;if(a.attributes.BANDWIDTH){n=a.attributes.BANDWIDTH}n=n||e.Number.MAX_VALUE;return r-n},Nc=function(t,a){var r=void 0,n=void 0;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){r=t.attributes.RESOLUTION.width}r=r||e.Number.MAX_VALUE;if(a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width){n=a.attributes.RESOLUTION.width}n=n||e.Number.MAX_VALUE;if(r===n&&t.attributes.BANDWIDTH&&a.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-a.attributes.BANDWIDTH}return r-n},Bc=function(t,a,r,n,i){var s=t.playlists.map(function(t){var a=void 0,r=void 0,n=void 0;a=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;r=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;n=t.attributes.BANDWIDTH;n=n||e.Number.MAX_VALUE;return{bandwidth:n,width:a,height:r,playlist:t}});Uc(s,function(e,t){return e.bandwidth-t.bandwidth});s=s.filter(function(e){return!Gp.isIncompatible(e.playlist)});var o=s.filter(function(e){return Gp.isEnabled(e.playlist)});if(!o.length){o=s.filter(function(e){return!Gp.isDisabled(e.playlist)})}var l=o.filter(function(e){return e.bandwidth*vc.BANDWIDTH_VARIANCE<a}),d=l[l.length-1],p=l.filter(function(e){return e.bandwidth===d.bandwidth})[0];if(!1===i){var u=p||o[0]||s[0];return u?u.playlist:null}var c=l.filter(function(e){return e.width&&e.height});Uc(c,function(e,t){return e.width-t.width});var m=c.filter(function(e){return e.width===r&&e.height===n});d=m[m.length-1];var g=m.filter(function(e){return e.bandwidth===d.bandwidth})[0],y=void 0,h=void 0,_=void 0;if(!g){y=c.filter(function(e){return e.width>r||e.height>n});h=y.filter(function(e){return e.width===y[0].width&&e.height===y[0].height});d=h[h.length-1];_=h.filter(function(e){return e.bandwidth===d.bandwidth})[0]}var f=_||g||p||o[0]||s[0];return f?f.playlist:null},jc=function(e){var t=e.master,a=e.currentTime,r=e.bandwidth,n=e.duration,i=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,l=e.syncController,d=t.playlists.filter(function(e){return!Gp.isIncompatible(e)}),p=d.filter(Gp.isEnabled);if(!p.length){p=d.filter(function(e){return!Gp.isDisabled(e)})}var u=p.filter(Gp.hasAttribute.bind(null,"BANDWIDTH")),c=u.map(function(e){var t=l.getSyncPoint(e,n,o,a),d=t?1:2,p=Gp.estimateSegmentRequestTime(i,r,e);return{playlist:e,rebufferingImpact:p*d-s}}),m=c.filter(function(e){return 0>=e.rebufferingImpact});Uc(m,function(e,t){return Mc(t.playlist,e.playlist)});if(m.length){return m[0]}Uc(c,function(e,t){return e.rebufferingImpact-t.rebufferingImpact});return c[0]||null},Fc=function(e,t,a){for(var r in a){if(!e[r]){t.trigger({type:"usage",name:"hls-608"});var n=t.textTracks().getTrackById(r);if(n){e[r]=n}else{e[r]=t.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}}}},Hc=function(e){var t=e.inbandTextTracks,a=e.captionArray,r=e.timestampOffset;if(!a){return}var n=window.WebKitDataCue||window.VTTCue;a.forEach(function(e){var a=e.stream,i=e.startTime,s=e.endTime;if(!t[a]){return}i+=r;s+=r;t[a].addCue(new n(i,s,e.text))})},qc=function(e,t,a){if(!e||!t){return!1}var r=e.segments,n=a===r.length;return e.endList&&"open"===t.readyState&&n},Vc=function(e){return"number"==typeof e&&isFinite(e)},Wc=function(e,t,a){if("main"!==e||!t||!a){return null}if(!a.containsAudio&&!a.containsVideo){return"Neither audio nor video found in segment."}if(t.containsVideo&&!a.containsVideo){return"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest."}if(!t.containsVideo&&a.containsVideo){return"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest."}return null},zc=function(e,t,a){var r;if(e.length&&0<e.start(0)&&e.start(0)<t){r=e.start(0)}else{r=t-30}return Math.min(r,t-a)},Gc=function(e){var t=e.segment,a=t.start,r=t.end,n=e.playlist,i=n.mediaSequence,s=n.id,o=n.segments,l=o===void 0?[]:o,d=e.mediaIndex,p=e.timeline;return["appending ["+d+"] of ["+i+", "+(i+l.length)+"] from playlist ["+s+"]","["+a+" => "+r+"] in timeline ["+p+"]"].join(" ")},$c=function(t){cp(a,t);function a(e){dp(this,a);var t=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));if(!e){throw new TypeError("Initialization settings are required")}if("function"!=typeof e.currentTime){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}t.bandwidth=e.bandwidth;t.throughput={rate:0,count:0};t.roundTrip=NaN;t.resetStats_();t.mediaIndex=null;t.hasPlayed_=e.hasPlayed;t.currentTime_=e.currentTime;t.seekable_=e.seekable;t.seeking_=e.seeking;t.duration_=e.duration;t.mediaSource_=e.mediaSource;t.hls_=e.hls;t.loaderType_=e.loaderType;t.startingMedia_=void 0;t.segmentMetadataTrack_=e.segmentMetadataTrack;t.goalBufferLength_=e.goalBufferLength;t.sourceType_=e.sourceType;t.inbandTextTracks_=e.inbandTextTracks;t.state_="INIT";t.checkBufferTimeout_=null;t.error_=void 0;t.currentTimeline_=-1;t.pendingSegment_=null;t.mimeType_=null;t.sourceUpdater_=null;t.xhrOptions_=null;t.activeInitSegmentId_=null;t.initSegments_={};t.cacheEncryptionKeys_=e.cacheEncryptionKeys;t.keyCache_={};if("main"===t.loaderType_){t.captionParser_=new md}else{t.captionParser_=null}t.decrypter_=e.decrypter;t.syncController_=e.syncController;t.syncPoint_={segmentIndex:0,time:0};t.syncController_.on("syncinfoupdate",function(){return t.trigger("syncinfoupdate")});t.mediaSource_.addEventListener("sourceopen",function(){return t.ended_=!1});t.fetchAtBuffer_=!1;t.logger_=bc("SegmentLoader["+t.loaderType_+"]");Object.defineProperty(t,"state",{get:function(){return this.state_},set:function(e){if(e!==this.state_){this.logger_(this.state_+" -> "+e);this.state_=e}}});return t}pp(a,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED";this.pause();this.abort_();if(this.sourceUpdater_){this.sourceUpdater_.dispose()}this.resetStats_();if(this.captionParser_){this.captionParser_.reset()}}},{key:"abort",value:function(){if("WAITING"!==this.state){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}},{key:"abort_",value:function(){if(this.pendingSegment_){this.pendingSegment_.abortRequests()}this.pendingSegment_=null}},{key:"error",value:function(e){if("undefined"!=typeof e){this.error_=e}this.pendingSegment_=null;return this.error_}},{key:"endOfStream",value:function(){this.ended_=!0;this.pause();this.trigger("ended")}},{key:"buffered_",value:function(){if(!this.sourceUpdater_){return it.createTimeRanges()}return this.sourceUpdater_.buffered()}},{key:"initSegment",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;if(!e){return null}var a=au(e),r=this.initSegments_[a];if(t&&!r&&e.bytes){this.initSegments_[a]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}}return r||e}},{key:"segmentKey",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;if(!e){return null}var a=ru(e),r=this.keyCache_[a];if(this.cacheEncryptionKeys_&&t&&!r&&e.bytes){this.keyCache_[a]=r={resolvedUri:e.resolvedUri,bytes:e.bytes}}var n={resolvedUri:(r||e).resolvedUri};if(r){n.bytes=r.bytes}return n}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){this.monitorBuffer_();if(!this.playlist_){return}this.syncController_.setDateTimeMapping(this.playlist_);if("INIT"===this.state&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state){return}this.state="READY"}},{key:"init_",value:function(){this.state="READY";this.sourceUpdater_=new Tc(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_);this.resetEverything();return this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(!e){return}var a=this.playlist_,r=this.pendingSegment_;this.playlist_=e;this.xhrOptions_=t;if(!this.hasPlayed_()){e.syncInfo={mediaSequence:e.mediaSequence,time:0}}var n=null;if(a){if(a.id){n=a.id}else if(a.uri){n=a.uri}}this.logger_("playlist update ["+n+" => "+(e.id||e.uri)+"]");this.trigger("syncinfoupdate");if("INIT"===this.state&&this.couldBeginLoading_()){return this.init_()}if(!a||a.uri!==e.uri){if(null!==this.mediaIndex){this.resyncLoader()}return}var i=e.mediaSequence-a.mediaSequence;this.logger_("live window shift ["+i+"]");if(null!==this.mediaIndex){this.mediaIndex-=i}if(r){r.mediaIndex-=i;if(0<=r.mediaIndex){r.segment=e.segments[r.mediaIndex]}}this.syncController_.saveExpiredSegmentInfo(a,e)}},{key:"pause",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){if(this.mimeType_){return}this.mimeType_=e;this.sourceBufferEmitter_=t;if("INIT"===this.state&&this.couldBeginLoading_()){this.init_()}}},{key:"resetEverything",value:function(e){this.ended_=!1;this.resetLoader();this.remove(0,this.duration_(),e);if(this.captionParser_){this.captionParser_.clearAllCaptions()}this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1;this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null;this.syncPoint_=null;this.abort()}},{key:"remove",value:function(e,t,a){if(this.sourceUpdater_){this.sourceUpdater_.remove(e,t,a)}Pu(e,t,this.segmentMetadataTrack_);if(this.inbandTextTracks_){for(var r in this.inbandTextTracks_){Pu(e,t,this.inbandTextTracks_[r])}}}},{key:"monitorBuffer_",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){if("READY"===this.state){this.fillBuffer_()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(this.sourceUpdater_.updating()){return}if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(!e){return}if(this.isEndOfStream_(e.mediaIndex)){this.endOfStream();return}if(e.mediaIndex===this.playlist_.segments.length-1&&"ended"===this.mediaSource_.readyState&&!this.seeking_()){return}if(e.timeline!==this.currentTimeline_){this.syncController_.reset();e.timestampOffset=e.startOfSegment;if(this.captionParser_){this.captionParser_.clearAllCaptions()}}this.loadSegment_(e)}},{key:"isEndOfStream_",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:this.playlist_;return qc(t,this.mediaSource_,e)&&!this.sourceUpdater_.updating()}},{key:"checkBuffer_",value:function(e,t,a,r,n,i){var s=0,o=void 0;if(e.length){s=e.end(e.length-1)}var l=Math.max(0,s-n);if(!t.segments.length){return null}if(l>=this.goalBufferLength_()){return null}if(!r&&1<=l){return null}if(null===i){a=this.getSyncSegmentCandidate_(t);return this.generateSegmentInfo_(t,a,null,!0)}if(null!==a){t.segments[a];o=s;return this.generateSegmentInfo_(t,a+1,o,!1)}if(this.fetchAtBuffer_){var d=Gp.getMediaInfoForTime(t,s,i.segmentIndex,i.time);a=d.mediaIndex;o=d.startTime}else{var p=Gp.getMediaInfoForTime(t,n,i.segmentIndex,i.time);a=p.mediaIndex;o=p.startTime}return this.generateSegmentInfo_(t,a,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_){return 0}var a=e.segments.map(function(e,t){return{timeline:e.timeline,segmentIndex:t}}).filter(function(e){return e.timeline===t.currentTimeline_});if(a.length){return a[Math.min(a.length-1,1)].segmentIndex}return Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,a,r){if(0>t||t>=e.segments.length){return null}var n=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:n.resolvedUri,mediaIndex:t,isSyncRequest:r,startOfSegment:a,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:n.timeline,duration:n.duration,segment:n}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return!1}if(1e3>Date.now()-(e.firstBytesReceivedAt||Date.now())){return!1}var t=this.currentTime_(),a=e.bandwidth,r=this.pendingSegment_.duration,n=Gp.estimateSegmentRequestTime(r,a,this.playlist_,e.bytesReceived),i=ku(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(n<=i){return!1}var s=jc({master:this.hls_.playlists.master,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:i,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!s){return}var o=n-i-s.rebufferingImpact,l=.5;if(i<=hu){l=1}if(!s.playlist||s.playlist.uri===this.playlist_.uri||o<l){return!1}this.bandwidth=s.playlist.attributes.BANDWIDTH*vc.BANDWIDTH_VARIANCE+1;this.abort();this.trigger("earlyabort");return!0}},{key:"handleProgress_",value:function(e,t){if(!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId||this.abortRequestEarly_(t.stats)){return}this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING";this.pendingSegment_=e;this.trimBackBuffer_(e);e.abortRequests=Oc(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(){var e=zc(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(0<e){this.remove(0,e)}}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,a={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key);a.key.iv=r}if(t.map){a.map=this.initSegment(t.map)}return a}},{key:"segmentRequestFinished_",value:function(e,t){this.mediaRequests+=1;if(t.stats){this.mediaBytesTransferred+=t.stats.bytesReceived;this.mediaTransferDuration+=t.stats.roundTripTime}if(!this.pendingSegment_){this.mediaRequestsAborted+=1;return}if(t.requestId!==this.pendingSegment_.requestId){return}if(e){this.pendingSegment_=null;this.state="READY";if(e.code===Sc.ABORTED){this.mediaRequestsAborted+=1;return}this.pause();if(e.code===Sc.TIMEOUT){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");return}this.mediaRequestsErrored+=1;this.error(e);this.trigger("error");return}this.bandwidth=t.stats.bandwidth;this.roundTrip=t.stats.roundTripTime;if(t.map){t.map=this.initSegment(t.map,!0)}if(t.key){this.segmentKey(t.key,!0)}this.processSegmentResponse_(t)}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes;if(e.map){t.segment.map.bytes=e.map.bytes}t.endOfAllRequests=e.endOfAllRequests;if(e.fmp4Captions){Fc(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams);Hc({inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0});if(this.captionParser_){this.captionParser_.clearParsedCaptions()}}this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(!this.pendingSegment_){this.state="READY";return}var t=this.pendingSegment_,a=t.segment,r=this.syncController_.probeSegmentInfo(t);if("undefined"==typeof this.startingMedia_&&r&&(r.containsAudio||r.containsVideo)){this.startingMedia_={containsAudio:r.containsAudio,containsVideo:r.containsVideo}}var n=Wc(this.loaderType_,this.startingMedia_,r);if(n){this.error({message:n,blacklistDuration:1/0});this.trigger("error");return}if(t.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}if(null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()){if(r&&r.segmentTimestampInfo){var i=r.segmentTimestampInfo[0].ptsTime,s=r.segmentTimestampInfo[0].dtsTime;t.timestampOffset-=i-s}this.sourceUpdater_.timestampOffset(t.timestampOffset);this.trigger("timestampoffset")}var o=this.syncController_.mappingForTimeline(t.timeline);if(null!==o){this.trigger({type:"segmenttimemapping",mapping:o})}this.state="APPENDING";if(a.map){var l=au(a.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==l){var d=this.initSegment(a.map);this.sourceUpdater_.appendBuffer({bytes:d.bytes},function(){e.activeInitSegmentId_=l})}}t.byteLength=t.bytes.byteLength;if("number"==typeof a.start&&"number"==typeof a.end){this.mediaSecondsLoaded+=a.end-a.start}else{this.mediaSecondsLoaded+=a.duration}this.logger_(Gc(t));this.sourceUpdater_.appendBuffer({bytes:t.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,t.requestId)},this.handleUpdateEnd_.bind(this))}},{key:"handleVideoSegmentTimingInfo_",value:function(e,t){if(!this.pendingSegment_||e!==this.pendingSegment_.requestId){return}var a=this.pendingSegment_.segment;if(!a.videoTimingInfo){a.videoTimingInfo={}}a.videoTimingInfo.transmuxerPrependedSeconds=t.videoSegmentTimingInfo.prependedContentDuration||0;a.videoTimingInfo.transmuxedPresentationStart=t.videoSegmentTimingInfo.start.presentation;a.videoTimingInfo.transmuxedPresentationEnd=t.videoSegmentTimingInfo.end.presentation;a.videoTimingInfo.baseMediaDecodeTime=t.videoSegmentTimingInfo.baseMediaDecodeTime}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}var e=this.pendingSegment_,t=e.segment,a=null!==this.mediaIndex;this.pendingSegment_=null;this.recordThroughput_(e);this.addSegmentMetadataCue_(e);this.state="READY";this.mediaIndex=e.mediaIndex;this.fetchAtBuffer_=!0;this.currentTimeline_=e.timeline;this.trigger("syncinfoupdate");if(t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration){this.resetEverything();return}if(a){this.trigger("bandwidthupdate")}this.trigger("progress");if(this.isEndOfStream_(e.mediaIndex+1,e.playlist)){this.endOfStream()}if(!this.paused()){this.monitorBuffer_()}}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,r=Math.floor(1e3*(8*(e.byteLength/a)));this.throughput.rate+=(r-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(!this.segmentMetadataTrack_){return}var a=t.segment,r=a.start,n=a.end;if(!Vc(r)||!Vc(n)){return}Pu(r,n,this.segmentMetadataTrack_);var i=e.WebKitDataCue||e.VTTCue,s={custom:a.custom,dateTimeObject:a.dateTimeObject,dateTimeString:a.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.uri,start:r,end:n},o=JSON.stringify(s),l=new i(r,n,o);l.value=s;this.segmentMetadataTrack_.addCue(l)}}]);return a}(it.EventTarget),Kc=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Yc=new Uint8Array(["\n","\n"].map(function(e){return e.charCodeAt(0)})),Xc=function(t){cp(a,t);function a(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};dp(this,a);var r=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));r.mediaSource_=null;r.subtitlesTrack_=null;return r}pp(a,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length){return it.createTimeRanges()}var e=this.subtitlesTrack_.cues,t=e[0].startTime,a=e[e.length-1].startTime;return it.createTimeRanges([[t,a]])}},{key:"initSegment",value:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;if(!e){return null}var a=au(e),r=this.initSegments_[a];if(t&&!r&&e.bytes){var n=Yc.byteLength+e.bytes.byteLength,i=new Uint8Array(n);i.set(e.bytes);i.set(Yc,e.bytes.byteLength);this.initSegments_[a]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}},{key:"track",value:function(e){if("undefined"==typeof e){return this.subtitlesTrack_}this.subtitlesTrack_=e;if("INIT"===this.state&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}},{key:"remove",value:function(e,t){Pu(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);t=this.skipEmptySegments_(t);if(!t){return}if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var a=function(){e.state="READY";if(!e.paused()){e.monitorBuffer_()}};this.syncController_.one("timestampoffset",a);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}},{key:"skipEmptySegments_",value:function(e){while(e&&e.segment.empty){e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest)}return e}},{key:"handleSegment_",value:function(){var t=this;if(!this.pendingSegment_||!this.subtitlesTrack_){this.state="READY";return}this.state="APPENDING";var a=this.pendingSegment_,r=a.segment;if("function"!=typeof e.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=void 0,i=function(){t.subtitlesTrack_.tech_.off("vttjsloaded",n);t.error({message:"Error loading vtt.js"});t.state="READY";t.pause();t.trigger("error")};n=function(){t.subtitlesTrack_.tech_.off("vttjserror",i);t.handleSegment_()};this.state="WAITING_ON_VTTJS";this.subtitlesTrack_.tech_.one("vttjsloaded",n);this.subtitlesTrack_.tech_.one("vttjserror",i);return}r.requested=!0;try{this.parseVTTCues_(a)}catch(t){this.error({message:t.message});this.state="READY";this.pause();return this.trigger("error")}this.updateTimeMapping_(a,this.syncController_.timelines[a.timeline],this.playlist_);if(a.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}a.byteLength=a.bytes.byteLength;this.mediaSecondsLoaded+=r.duration;if(a.cues.length){this.remove(a.cues[0].endTime,a.cues[a.cues.length-1].endTime)}a.cues.forEach(function(e){t.subtitlesTrack_.addCue(e)});this.handleUpdateEnd_()}},{key:"parseVTTCues_",value:function(t){var a=void 0,r=!1;if("function"==typeof e.TextDecoder){a=new e.TextDecoder("utf8")}else{a=e.WebVTT.StringDecoder();r=!0}var n=new e.WebVTT.Parser(e,e.vttjs,a);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};n.oncue=t.cues.push.bind(t.cues);n.ontimestampmap=function(e){return t.timestampmap=e};n.onparsingerror=function(e){it.log.warn("Error encountered when parsing cues: "+e.message)};if(t.segment.map){var i=t.segment.map.bytes;if(r){i=Kc(i)}n.parse(i)}var s=t.bytes;if(r){s=Kc(s)}n.parse(s);n.flush()}},{key:"updateTimeMapping_",value:function(e,t,a){var r=e.segment;if(!t){return}if(!e.cues.length){r.empty=!0;return}var n=e.timestampmap,i=n.MPEGTS/9e4-n.LOCAL+t.mapping;e.cues.forEach(function(e){e.startTime+=i;e.endTime+=i});if(!a.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(s,o-r.duration)}}}}]);return a}($c),Qc=function(e,t){for(var a=e.cues,r=0,n;r<a.length;r++){n=a[r];if(t>=n.adStartTime&&t<=n.adEndTime){return n}}return null},Jc=function(t,a){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!t.segments){return}for(var n=r,s=void 0,o=0,l;o<t.segments.length;o++){l=t.segments[o];if(!s){s=Qc(a,n+l.duration/2)}if(s){if("cueIn"in l){s.endTime=n;s.adEndTime=n;n+=l.duration;s=null;continue}if(n<s.endTime){n+=l.duration;continue}s.endTime+=l.duration}else{if("cueOut"in l){s=new e.VTTCue(n,n+l.duration,l.cueOut);s.adStartTime=n;s.adEndTime=n+parseFloat(l.cueOut);a.addCue(s)}if("cueOutCont"in l){var d=void 0,p=void 0,u=l.cueOutCont.split("/").map(parseFloat),c=gp(u,2);d=c[0];p=c[1];s=new e.VTTCue(n,n+l.duration,"");s.adStartTime=n-d;s.adEndTime=s.adStartTime+p;a.addCue(s)}}n+=l.duration}},Zc={inspect:function(e,t){var a=jd.aac.isLikelyAacData(e),r;if(a){r=$d(e)}else{r=Kd(e)}if(!r||!r.audio&&!r.video){return null}Gd(r,t);return r},parseAudioPes_:Wd}.inspect,em=[{name:"VOD",run:function(e,t,a){if(a!==1/0){return{time:0,segmentIndex:0}}return null}},{name:"ProgramDateTime",run:function(e,t,a,r,n){if(!e.datetimeToDisplayTime){return null}var s=t.segments||[],o=null,l=null;n=n||0;for(var d=0,p;d<s.length;d++){p=s[d];if(p.dateTimeObject){var u=p.dateTimeObject.getTime()/1e3,c=u+e.datetimeToDisplayTime,m=Math.abs(n-c);if(null!==l&&(0===m||l<m)){break}l=m;o={time:c,segmentIndex:d}}}return o}},{name:"Segment",run:function(e,t,a,r,n){var s=t.segments||[],o=null,l=null;n=n||0;for(var d=0,p;d<s.length;d++){p=s[d];if(p.timeline===r&&"undefined"!=typeof p.start){var u=Math.abs(n-p.start);if(null!==l&&l<u){break}if(!o||null===l||l>=u){l=u;o={time:p.start,segmentIndex:d}}}}return o}},{name:"Discontinuity",run:function(e,t,a,r,n){var s=null;n=n||0;if(t.discontinuityStarts&&t.discontinuityStarts.length){for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var d=t.discontinuityStarts[l],p=t.discontinuitySequence+l+1,u=e.discontinuities[p];if(u){var c=Math.abs(n-u.time);if(null!==o&&o<c){break}if(!s||null===o||o>=c){o=c;s={time:u.time,segmentIndex:d}}}}}return s}},{name:"Playlist",run:function(e,t){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence};return a}return null}}],tm=function(e){cp(t,e);function t(){dp(this,t);var e=mp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.inspectCache_=void 0;e.timelines=[];e.discontinuities=[];e.datetimeToDisplayTime=null;e.logger_=bc("SyncController");return e}pp(t,[{key:"getSyncPoint",value:function(e,t,a,r){var n=this.runStrategies_(e,t,a,r);if(!n.length){return null}return this.selectSyncPoint_(n,{key:"time",value:r})}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments){return null}var a=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!a.length){return null}var r=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});if(0<r.segmentIndex){r.time*=-1}return Math.abs(r.time+Dp(e,r.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,a,r){for(var n=[],s=0;s<em.length;s++){var o=em[s],l=o.run(this,e,t,a,r);if(l){l.strategy=o.name;n.push({strategy:o.name,syncPoint:l})}}return n}},{key:"selectSyncPoint_",value:function(e,t){for(var a=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy,s=1,o;s<e.length;s++){o=Math.abs(e[s].syncPoint[t.key]-t.value);if(o<r){r=o;a=e[s].syncPoint;n=e[s].strategy}}this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy"+(" ["+n+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex+"]"));return a}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var a=t.mediaSequence-e.mediaSequence,r=a-1,n;0<=r;r--){n=e.segments[r];if(n&&"undefined"!=typeof n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start};this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+","+(" mediaSequence: "+t.syncInfo.mediaSequence+"]"));this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,a=e.playlist,r=void 0;if(t.map){r=this.probeMp4Segment_(e)}else{r=this.probeTsSegment_(e)}if(r){if(this.calculateSegmentTimeMapping_(e,r)){this.saveDiscontinuitySyncInfo_(e);if(!a.syncInfo){a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:t.start}}}}return r}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,a=Nl.timescale(t.map.bytes),r=Nl.startTime(a,e.bytes);if(null!==e.timestampOffset){e.timestampOffset-=r}return{start:r,end:r+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=Zc(e.bytes,this.inspectCache_),a=void 0,r=void 0,n=void 0;if(!t){return null}if(t.video&&2===t.video.length){this.inspectCache_=t.video[1].dts;a=t.video[0].dtsTime;r=t.video[1].dtsTime;n=t.video}else if(t.audio&&2===t.audio.length){this.inspectCache_=t.audio[1].dts;a=t.audio[0].dtsTime;r=t.audio[1].dtsTime;n=t.audio}var i={segmentTimestampInfo:n,start:a,end:r,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length};return i}},{key:"timestampOffsetForTimeline",value:function(e){if("undefined"==typeof this.timelines[e]){return null}return this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){if("undefined"==typeof this.timelines[e]){return null}return this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var a=e.segment,r=this.timelines[e.timeline];if(null!==e.timestampOffset){r={time:e.startOfSegment,mapping:e.startOfSegment-t.start};this.timelines[e.timeline]=r;this.trigger("timestampoffset");this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+r.time+"] [mapping: "+r.mapping+"]"));a.start=e.startOfSegment;a.end=t.end+r.mapping}else if(r){a.start=t.start+r.mapping;a.end=t.end+r.mapping}else{return!1}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,a=e.segment;if(a.discontinuity){this.discontinuities[a.timeline]={time:a.start,accuracy:0}}else if(t.discontinuityStarts&&t.discontinuityStarts.length){for(var r=0;r<t.discontinuityStarts.length;r++){var n=t.discontinuityStarts[r],s=t.discontinuitySequence+r+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>l){var d=void 0;if(0>o){d=a.start-Dp(t,e.mediaIndex,n)}else{d=a.end+Dp(t,e.mediaIndex+1,n)}this.discontinuities[s]={time:d,accuracy:l}}}}}}]);return t}(it.EventTarget),am=new ct("./decrypter-worker.worker.js",function(){var e=this,t=function(){function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var a=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},r=function(){function e(e,t){for(var a=0,r;a<t.length;a++){r=t[a];r.enumerable=r.enumerable||!1;r.configurable=!0;if("value"in r)r.writable=!0;Object.defineProperty(e,r.key,r)}}return function(t,a,r){if(a)e(t.prototype,a);if(r)e(t,r);return t}}(),n=function(e,t){if("function"!=typeof t&&null!==t){throw new TypeError("Super expression must either be null or a function, not "+_typeof(t))}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t},i=function(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&("object"===_typeof(t)||"function"==typeof t)?t:e},s=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],a=e[1],r=t[4],n=a[4],o=void 0,l=void 0,p=void 0,u=[],d=[],c=void 0,m=void 0,g=void 0,y=void 0,h=void 0,_=void 0;for(o=0;256>o;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!r[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);r[l]=y;n[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},o=null,l=function(){function e(t){a(this,e);if(!o){o=s()}this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var r=void 0,n=void 0,l=void 0,d=void 0,p=void 0,u=this._tables[0][4],c=this._tables[1],m=t.length,g=1;if(4!==m&&6!==m&&8!==m){throw new Error("Invalid aes key size")}d=t.slice(0);p=[];this._key=[d,p];for(r=m;r<4*m+28;r++){l=d[r-1];if(0==r%m||8===m&&4==r%m){l=u[l>>>24]<<24^u[255&l>>16]<<16^u[255&l>>8]<<8^u[255&l];if(0==r%m){l=l<<8^l>>>24^g<<24;g=g<<1^283*(g>>7)}}d[r]=d[r-m]^l}for(n=0;r;n++,r--){l=d[3&n?r:r-4];if(4>=r||4>n){p[n]=l}else{p[n]=c[0][u[l>>>24]]^c[1][u[255&l>>16]]^c[2][u[255&l>>8]]^c[3][u[255&l]]}}}e.prototype.decrypt=function(e,t,r,n,s,o){var l=this._key[1],p=e^l[0],u=n^l[1],m=r^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],P=S[3],I=S[4];for(T=0;T<f;T++){y=k[p>>>24]^C[255&u>>16]^E[255&m>>8]^P[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^P[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^P[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^P[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=I[p>>>24]<<24^I[255&u>>16]<<16^I[255&m>>8]<<8^I[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),d=function(){function e(){a(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1<a};e.prototype.trigger=function(e){var t=this.listeners[e];if(!t){return}if(2===arguments.length){for(var a=t.length,r=0;r<a;++r){t[r].call(this,arguments[1])}}else{for(var n=Array.prototype.slice.call(arguments,1),s=t.length,o=0;o<s;++o){t[o].apply(this,n)}}};e.prototype.dispose=function(){this.listeners={}};e.prototype.pipe=function(e){this.on("data",function(t){e.push(t)})};return e}(),p=function(e){n(t,e);function t(){a(this,t);var r=i(this,e.call(this,d));r.jobs=[];r.delay=1;r.timeout_=null;return r}t.prototype.processJob_=function(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}};t.prototype.push=function(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}};return t}(d),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},c=function(e,t,a){var r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),n=new l(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,d=void 0,p=void 0,c=void 0,m=void 0,g=void 0,y=void 0,h=void 0,_=void 0;o=a[0];d=a[1];p=a[2];c=a[3];for(_=0;_<r.length;_+=4){m=u(r[_]);g=u(r[_+1]);y=u(r[_+2]);h=u(r[_+3]);n.decrypt(m,g,y,h,s,_);s[_]=u(s[_]^o);s[_+1]=u(s[_+1]^d);s[_+2]=u(s[_+2]^p);s[_+3]=u(s[_+3]^c);o=m;d=g;p=y;c=h}return i},m=function(){function e(r,n,s,o){a(this,e);var l=e.STEP,d=new Int32Array(r.buffer),c=new Uint8Array(r.byteLength),m=0;this.asyncStream_=new p;this.asyncStream_.push(this.decryptChunk_(d.subarray(m,m+l),n,s,c));for(m=l;m<d.length;m+=l){s=new Uint32Array([u(d[m-4]),u(d[m-3]),u(d[m-2]),u(d[m-1])]);this.asyncStream_.push(this.decryptChunk_(d.subarray(m,m+l),n,s,c))}this.asyncStream_.push(function(){o(null,t(c))})}e.prototype.decryptChunk_=function(e,t,a,r){return function(){var n=c(e,t,a);r.set(n,e.byteOffset)}};r(e,null,[{key:"STEP",get:function(){return 32e3}}]);return e}(),g=function(e){var t={};Object.keys(e).forEach(function(a){var r=e[a];if(ArrayBuffer.isView(r)){t[a]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}else{t[a]=r}});return t},y=new function(e){e.onmessage=function(t){var a=t.data,r=new Uint8Array(a.encrypted.bytes,a.encrypted.byteOffset,a.encrypted.byteLength),n=new Uint32Array(a.key.bytes,a.key.byteOffset,a.key.byteLength/4),i=new Uint32Array(a.iv.bytes,a.iv.byteOffset,a.iv.byteLength/4);new m(r,n,i,function(t,r){e.postMessage(g({source:a.source,decrypted:r}),[r.buffer])})}}(e);return y}()}),rm=function(e){var t=e["default"]?"main":"alternative";if(e.characteristics&&0<=e.characteristics.indexOf("public.accessibility.describes-video")){t="main-desc"}return t},nm=function(e,t){e.abort();e.pause();if(t&&t.activePlaylistLoader){t.activePlaylistLoader.pause();t.activePlaylistLoader=null}},im=function(e,t){t.activePlaylistLoader=e;e.load()},sm=function(e,t){return function(){var a=t.segmentLoaders,r=a[e],n=a.main,i=t.mediaTypes[e],s=i.activeTrack(),o=i.activeGroup(s),l=i.activePlaylistLoader;nm(r,i);if(!o){return}if(!o.playlistLoader){if(l){n.resetEverything()}return}r.resyncLoader();im(o.playlistLoader,i)}},om=function(e,t){return function(){var a=t.segmentLoaders,r=a[e],n=a.main,i=t.mediaTypes[e],s=i.activeTrack(),o=i.activeGroup(s),l=i.activePlaylistLoader;nm(r,i);if(!o){return}if(!o.playlistLoader){n.resetEverything();return}if(l===o.playlistLoader){im(o.playlistLoader,i);return}if(r.track){r.track(s)}r.resetEverything();im(o.playlistLoader,i)}},lm={AUDIO:function(e,t){return function(){var a=t.segmentLoaders[e],r=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;nm(a,r);var i=r.activeTrack(),s=r.activeGroup(),o=(s.filter(function(e){return e["default"]})[0]||s[0]).id,l=r.tracks[o];if(i===l){n({message:"Problem encountered loading the default audio track."});return}it.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var d in r.tracks){r.tracks[d].enabled=r.tracks[d]===l}r.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var a=t.segmentLoaders[e],r=t.mediaTypes[e];it.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");nm(a,r);var n=r.activeTrack();if(n){n.mode="disabled"}r.onTrackChanged()}}},dm={AUDIO:function(e,t,a){if(!t){return}var r=a.tech,n=a.requestOptions,i=a.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();i.playlist(e,n);if(!r.paused()||e.endList&&"none"!==r.preload()){i.load()}});t.on("loadedplaylist",function(){i.playlist(t.media(),n);if(!r.paused()){i.load()}});t.on("error",lm[e](e,a))},SUBTITLES:function(e,t,a){var r=a.tech,n=a.requestOptions,i=a.segmentLoaders[e],s=a.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();i.playlist(e,n);i.track(s.activeTrack());if(!r.paused()||e.endList&&"none"!==r.preload()){i.load()}});t.on("loadedplaylist",function(){i.playlist(t.media(),n);if(!r.paused()){i.load()}});t.on("error",lm[e](e,a))}},pm={AUDIO:function(e,t){var a=t.hls,r=t.sourceType,n=t.segmentLoaders[e],i=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],l=o.groups,d=o.tracks,p=t.masterPlaylistLoader;if(!s[e]||0===Object.keys(s[e]).length){s[e]={main:{default:{default:!0}}}}for(var u in s[e]){if(!l[u]){l[u]=[]}for(var c in s[e][u]){var m=s[e][u][c],g=void 0;if(m.resolvedUri){g=new Ep(m.resolvedUri,a,i)}else if(m.playlists&&"dash"===r){g=new fc(m.playlists[0],a,i,p)}else{g=null}m=it.mergeOptions({id:c,playlistLoader:g},m);dm[e](e,m.playlistLoader,t);l[u].push(m);if("undefined"==typeof d[c]){var y=new it.AudioTrack({id:c,kind:rm(m),enabled:!1,language:m.language,default:m["default"],label:c});d[c]=y}}}n.on("error",lm[e](e,t))},SUBTITLES:function(e,t){var a=t.tech,r=t.hls,n=t.sourceType,i=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],d=l.groups,p=l.tracks,u=t.masterPlaylistLoader;for(var c in o[e]){if(!d[c]){d[c]=[]}for(var m in o[e][c]){if(o[e][c][m].forced){continue}var g=o[e][c][m],y=void 0;if("hls"===n){y=new Ep(g.resolvedUri,r,s)}else if("dash"===n){y=new fc(g.playlists[0],r,s,u)}g=it.mergeOptions({id:m,playlistLoader:y},g);dm[e](e,g.playlistLoader,t);d[c].push(g);if("undefined"==typeof p[m]){var h=a.addRemoteTextTrack({id:m,kind:"subtitles",default:g["default"]&&g.autoselect,language:g.language,label:m},!1).track;p[m]=h}}}i.on("error",lm[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var a=t.tech,r=t.master.mediaGroups,n=t.mediaTypes[e],i=n.groups,s=n.tracks;for(var o in r[e]){if(!i[o]){i[o]=[]}for(var l in r[e][o]){var d=r[e][o][l];if(!d.instreamId.match(/CC\d/)){continue}i[o].push(it.mergeOptions({id:l},d));if("undefined"==typeof s[l]){var p=a.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d["default"]&&d.autoselect,language:d.language,label:l},!1).track;s[l]=p}}}}},um=function(e,t){return function(a){var r=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,i=r.media();if(!i){return null}var s=null;if(i.attributes[e]){s=n[i.attributes[e]]}s=s||n.main;if("undefined"==typeof a){return s}if(null===a){return null}return s.filter(function(e){return e.id===a.id})[0]||null}},cm={AUDIO:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var r in a){if(a[r].enabled){return a[r]}}return null}},SUBTITLES:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var r in a){if("showing"===a[r].mode){return a[r]}}return null}}},mm=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){pm[t](t,e)});var t=e.mediaTypes,a=e.masterPlaylistLoader,r=e.tech,n=e.hls;["AUDIO","SUBTITLES"].forEach(function(a){t[a].activeGroup=um(a,e);t[a].activeTrack=cm[a](a,e);t[a].onGroupChanged=sm(a,e);t[a].onTrackChanged=om(a,e)});var i=t.AUDIO.activeGroup(),s=(i.filter(function(e){return e["default"]})[0]||i[0]).id;t.AUDIO.tracks[s].enabled=!0;t.AUDIO.onTrackChanged();a.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return t[e].onGroupChanged()})});var o=function(){t.AUDIO.onTrackChanged();r.trigger({type:"usage",name:"hls-audio-change"})};r.audioTracks().addEventListener("change",o);r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged);n.on("dispose",function(){r.audioTracks().removeEventListener("change",o);r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)});r.clearTracks("audio");for(var l in t.AUDIO.tracks){r.audioTracks().addTrack(t.AUDIO.tracks[l])}},gm=function(){var e={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:yt,activeTrack:yt,onGroupChanged:yt,onTrackChanged:yt}});return e},ym=void 0,hm=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],_m=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},fm=function(t){cp(a,t);function a(e){dp(this,a);var t=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this)),r=e.url,n=e.handleManifestRedirects,i=e.withCredentials,s=e.tech,o=e.bandwidth,l=e.externHls,d=e.useCueTags,p=e.blacklistDuration,u=e.enableLowInitialPlaylist,c=e.sourceType,m=e.seekTo,g=e.cacheEncryptionKeys;if(!r){throw new Error("A non-empty playlist URL is required")}ym=l;t.withCredentials=i;t.tech_=s;t.hls_=s.hls;t.seekTo_=m;t.sourceType_=c;t.useCueTags_=d;t.blacklistDuration=p;t.enableLowInitialPlaylist=u;if(t.useCueTags_){t.cueTagsTrack_=t.tech_.addTextTrack("metadata","ad-cues");t.cueTagsTrack_.inBandMetadataTrackDispatchType=""}t.requestOptions_={withCredentials:i,handleManifestRedirects:n,timeout:null};t.mediaTypes_=gm();t.mediaSource=new it.MediaSource;t.mediaSource.addEventListener("sourceopen",t.handleSourceOpen_.bind(t));t.seekable_=it.createTimeRanges();t.hasPlayed_=function(){return!1};t.syncController_=new tm(e);t.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track;t.decrypter_=new am;t.inbandTextTracks_={};var y={hls:t.hls_,mediaSource:t.mediaSource,currentTime:t.tech_.currentTime.bind(t.tech_),seekable:function(){return t.seekable()},seeking:function(){return t.tech_.seeking()},duration:function(){return t.mediaSource.duration},hasPlayed:function(){return t.hasPlayed_()},goalBufferLength:function(){return t.goalBufferLength()},bandwidth:o,syncController:t.syncController_,decrypter:t.decrypter_,sourceType:t.sourceType_,inbandTextTracks:t.inbandTextTracks_,cacheEncryptionKeys:g};t.masterPlaylistLoader_="dash"===t.sourceType_?new fc(r,t.hls_,t.requestOptions_):new Ep(r,t.hls_,t.requestOptions_);t.setupMasterPlaylistLoaderListeners_();t.mainSegmentLoader_=new $c(it.mergeOptions(y,{segmentMetadataTrack:t.segmentMetadataTrack_,loaderType:"main"}),e);t.audioSegmentLoader_=new $c(it.mergeOptions(y,{loaderType:"audio"}),e);t.subtitleSegmentLoader_=new Xc(it.mergeOptions(y,{loaderType:"vtt"}),e);t.setupSegmentLoaderListeners_();hm.forEach(function(e){t[e+"_"]=_m.bind(t,e)});t.logger_=bc("MPC");t.masterPlaylistLoader_.load();return t}pp(a,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var e=t.masterPlaylistLoader_.media(),a=1e3*(1.5*e.targetDuration);if(zp(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())){t.requestOptions_.timeout=0}else{t.requestOptions_.timeout=a}if(e.endList&&"none"!==t.tech_.preload()){t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.mainSegmentLoader_.load()}mm({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,hls:t.hls_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)});t.triggerPresenceUsage_(t.master(),e);try{t.setupSourceBuffers_()}catch(a){it.log.warn("Failed to create SourceBuffers",a);return t.mediaSource.endOfStream("decode")}t.setupFirstPlay();if(!t.mediaTypes_.AUDIO.activePlaylistLoader||t.mediaTypes_.AUDIO.activePlaylistLoader.media()){t.trigger("selectedinitialmedia")}else{t.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){t.trigger("selectedinitialmedia")})}});this.masterPlaylistLoader_.on("loadedplaylist",function(){var e=t.masterPlaylistLoader_.media();if(!e){t.excludeUnsupportedVariants_();var a;if(t.enableLowInitialPlaylist){a=t.selectInitialPlaylist()}if(!a){a=t.selectPlaylist()}t.initialMedia_=a;t.masterPlaylistLoader_.media(t.initialMedia_);return}if(t.useCueTags_){t.updateAdCues_(e)}t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.updateDuration();if(!t.tech_.paused()){t.mainSegmentLoader_.load();if(t.audioSegmentLoader_){t.audioSegmentLoader_.load()}}if(!e.endList){var r=function(){var e=t.seekable();if(0!==e.length){t.mediaSource.addSeekableRange_(e.start(0),e.end(0))}};if(t.duration()!==1/0){var n=function e(){if(t.duration()===1/0){r()}else{t.tech_.one("durationchange",e)}};t.tech_.one("durationchange",n)}else{r()}}});this.masterPlaylistLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)});this.masterPlaylistLoader_.on("mediachanging",function(){t.mainSegmentLoader_.abort();t.mainSegmentLoader_.pause()});this.masterPlaylistLoader_.on("mediachange",function(){var e=t.masterPlaylistLoader_.media(),a=1e3*(1.5*e.targetDuration);if(zp(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())){t.requestOptions_.timeout=0}else{t.requestOptions_.timeout=a}t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.mainSegmentLoader_.load();t.tech_.trigger({type:"mediachange",bubbles:!0})});this.masterPlaylistLoader_.on("playlistunchanged",function(){var e=t.masterPlaylistLoader_.media(),a=t.stuckAtPlaylistEnd_(e);if(a){t.blacklistCurrentPlaylist({message:"Playlist no longer updating."});t.tech_.trigger("playliststuck")}});this.masterPlaylistLoader_.on("renditiondisabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})});this.masterPlaylistLoader_.on("renditionenabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function(e,t){var a=e.mediaGroups||{},r=!0,n=Object.keys(a.AUDIO);for(var i in a.AUDIO){for(var s in a.AUDIO[i]){var o=a.AUDIO[i][s];if(!o.uri){r=!1}}}if(r){this.tech_.trigger({type:"usage",name:"hls-demuxed"})}if(Object.keys(a.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"hls-webvtt"})}if(ym.Playlist.isAes(t)){this.tech_.trigger({type:"usage",name:"hls-aes"})}if(ym.Playlist.isFmp4(t)){this.tech_.trigger({type:"usage",name:"hls-fmp4"})}if(n.length&&1<Object.keys(a.AUDIO[n[0]]).length){this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist(),a=e.masterPlaylistLoader_.media(),r=e.tech_.buffered(),n=r.length?r.end(r.length-1)-e.tech_.currentTime():0,i=e.bufferLowWaterLine();if(!a.endList||e.duration()<vc.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<a.attributes.BANDWIDTH||n>=i){e.masterPlaylistLoader_.media(t)}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("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("ended",function(){e.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)});this.mainSegmentLoader_.on("reseteverything",function(){e.tech_.trigger("hls-reset")});this.mainSegmentLoader_.on("segmenttimemapping",function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})});this.audioSegmentLoader_.on("ended",function(){e.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();if(e!==this.masterPlaylistLoader_.media()){this.masterPlaylistLoader_.media(e);this.mainSegmentLoader_.resetLoader()}}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();if(t===this.masterPlaylistLoader_.media()){return}this.masterPlaylistLoader_.media(t);this.mainSegmentLoader_.resetEverything(function(){if(it.browser.IE_VERSION||it.browser.IS_EDGE){e.tech_.setCurrentTime(e.tech_.currentTime()+.04)}else{e.tech_.setCurrentTime(e.tech_.currentTime())}})}},{key:"play",value:function(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.seekTo_(0)}if(this.hasPlayed_()){this.load()}var e=this.tech_.seekable();if(this.tech_.duration()===1/0){if(this.tech_.currentTime()<e.start(0)){return this.seekTo_(e.end(e.length-1))}}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_()){return!1}if(!t.endList){var a=this.seekable();if(!a.length){return!1}if(it.browser.IE_VERSION&&0===this.tech_.readyState()){this.tech_.one("loadedmetadata",function(){e.trigger("firstplay");e.seekTo_(a.end(0));e.hasPlayed_=function(){return!0}});return!1}this.trigger("firstplay");this.seekTo_(a.end(0))}this.hasPlayed_=function(){return!0};this.load();return!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(t){it.log.warn("Failed to create Source Buffers",t);return this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();if("undefined"!=typeof e&&"function"==typeof e.then){e.then(null,function(){})}}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo){e=e&&this.audioSegmentLoader_.ended_}else{e=this.audioSegmentLoader_.ended_}}if(!e){return}this.logger_("calling mediaSource.endOfStream()");try{this.mediaSource.endOfStream()}catch(t){it.log.warn("Failed to call media source endOfStream",t)}}},{key:"stuckAtPlaylistEnd_",value:function(e){var t=this.seekable();if(!t.length){return!1}var a=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===a){return!1}var r=ym.Playlist.playlistEnd(e,a),n=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length){return r-n<=_u}var s=i.end(i.length-1);return s-n<=_u&&r-s<=_u}},{key:"blacklistCurrentPlaylist",value:function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=arguments[1],a=void 0,r=void 0;a=e.playlist||this.masterPlaylistLoader_.media();t=t||e.blacklistDuration||this.blacklistDuration;if(!a){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(t){return this.trigger("error")}}var n=1===this.masterPlaylistLoader_.master.playlists.filter(Hp).length,i=this.masterPlaylistLoader_.master.playlists;if(1===i.length){it.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.masterPlaylistLoader_.load(n)}if(n){it.log.warn("Removing all playlists from the blacklist because the last rendition is about to be blacklisted.");i.forEach(function(e){if(e.excludeUntil!==1/0){delete e.excludeUntil}});this.tech_.trigger("retryplaylist")}a.excludeUntil=Date.now()+1e3*t;this.tech_.trigger("blacklistplaylist");this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});r=this.selectPlaylist();it.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist.");return this.masterPlaylistLoader_.media(r,n)}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause()}}},{key:"setCurrentTime",value:function(e){var t=bu(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())){return 0}if(!this.masterPlaylistLoader_.media().segments){return 0}if(t&&t.length){return e}this.mainSegmentLoader_.resetEverything();this.mainSegmentLoader_.abort();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything();this.audioSegmentLoader_.abort()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything();this.subtitleSegmentLoader_.abort()}this.load()}},{key:"duration",value:function(){if(!this.masterPlaylistLoader_){return 0}if(this.mediaSource){return this.mediaSource.duration}return ym.Playlist.duration(this.masterPlaylistLoader_.media())}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(!this.masterPlaylistLoader_){return}var a=this.masterPlaylistLoader_.media();if(!a){return}var r=this.syncController_.getExpiredTime(a,this.mediaSource.duration);if(null===r){return}e=ym.Playlist.seekable(a,r);if(0===e.length){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){a=this.mediaTypes_.AUDIO.activePlaylistLoader.media();r=this.syncController_.getExpiredTime(a,this.mediaSource.duration);if(null===r){return}t=ym.Playlist.seekable(a,r);if(0===t.length){return}}var n=void 0,i=void 0;if(this.seekable_&&this.seekable_.length){n=this.seekable_.end(0);i=this.seekable_.start(0)}if(!t){this.seekable_=e}else if(t.start(0)>e.end(0)||e.start(0)>t.end(0)){this.seekable_=e}else{this.seekable_=it.createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===n&&this.seekable_.start(0)===i){return}}this.logger_("seekable updated ["+Su(this.seekable_)+"]");this.tech_.trigger("seekablechanged")}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,a=ym.Playlist.duration(this.masterPlaylistLoader_.media()),r=this.tech_.buffered(),n=function t(){e.logger_("Setting duration from "+e.mediaSource.duration+" => "+a);try{e.mediaSource.duration=a}catch(t){it.log.warn("Failed to set media source duration",t)}e.tech_.trigger("durationchange");e.mediaSource.removeEventListener("sourceopen",t)};if(0<r.length){a=Math.max(a,r.end(r.length-1))}if(t!==a){if("open"!==this.mediaSource.readyState){this.mediaSource.addEventListener("sourceopen",n)}else{n()}}}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate();this.masterPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();["AUDIO","SUBTITLES"].forEach(function(t){var a=e.mediaTypes_[t].groups;for(var r in a){a[r].forEach(function(e){if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e=this.masterPlaylistLoader_.media(),t=void 0;if(!e||"open"!==this.mediaSource.readyState){return}t=$u(this.masterPlaylistLoader_.master,e);if(1>t.length){this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri;return this.mediaSource.endOfStream("decode")}this.configureLoaderMimeTypes_(t);this.excludeIncompatibleVariants_(e)}},{key:"configureLoaderMimeTypes_",value:function(e){var t=1<e.length&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new it.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t);if(e[1]){this.audioSegmentLoader_.mimeType(e[1],t)}}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach(function(t){if(t.attributes.CODECS&&e.MediaSource&&e.MediaSource.isTypeSupported&&!e.MediaSource.isTypeSupported("video/mp4; codecs=\""+qu(t.attributes.CODECS)+"\"")){t.excludeUntil=1/0}})}},{key:"excludeIncompatibleVariants_",value:function(e){var t=2,a=null,r=void 0;if(e.attributes.CODECS){r=Hu(e.attributes.CODECS);a=r.videoCodec;t=r.codecCount}this.master().playlists.forEach(function(e){var r={codecCount:2,videoCodec:null};if(e.attributes.CODECS){r=Hu(e.attributes.CODECS)}if(r.codecCount!==t){e.excludeUntil=1/0}if(r.videoCodec!==a){e.excludeUntil=1/0}})}},{key:"updateAdCues_",value:function(e){var t=0,a=this.seekable();if(a.length){t=a.start(0)}Jc(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=vc.GOAL_BUFFER_LENGTH,a=vc.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,vc.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*a,r)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=vc.BUFFER_LOW_WATER_LINE,a=vc.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,vc.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*a,r)}}]);return a}(it.EventTarget),bm=function(e,t,a){return function(r){var n=e.master.playlists[t],i=Fp(n),s=Hp(n);if("undefined"==typeof r){return s}if(r){delete n.disabled}else{n.disabled=!0}if(r!==s&&!i){a();if(r){e.trigger("renditionenabled")}else{e.trigger("renditiondisabled")}}return r}},Tm=function e(t,a,r){dp(this,e);var n=t.masterPlaylistController_,i=t.options_.smoothQualityChange,s=i?"smooth":"fast",o=n[s+"QualityChange_"].bind(n);if(a.attributes.RESOLUTION){var l=a.attributes.RESOLUTION;this.width=l.width;this.height=l.height}this.bandwidth=a.attributes.BANDWIDTH;this.id=r;this.enabled=bm(t.playlists,a.uri,o)},vm=function(t){var a=t.playlists;t.representations=function(){return a.master.playlists.filter(function(e){return!Fp(e)}).map(function(a){return new Tm(t,a,a.uri)})}},Sm=["seeking","seeked","pause","playing","error"],km=function(){function t(a){var r=this;dp(this,t);this.tech_=a.tech;this.seekable=a.seekable;this.seekTo=a.seekTo;this.allowSeeksWithinUnsafeLiveWindow=a.allowSeeksWithinUnsafeLiveWindow;this.media=a.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.timer_=null;this.checkCurrentTimeTimeout_=null;this.logger_=bc("PlaybackWatcher");this.logger_("initialize");var n=function(){return r.monitorCurrentTime_()},i=function(){return r.techWaiting_()},s=function(){return r.cancelTimer_()},o=function(){return r.fixesBadSeeks_()};this.tech_.on("seekablechanged",o);this.tech_.on("waiting",i);this.tech_.on(Sm,s);this.tech_.on("canplay",n);this.dispose=function(){r.logger_("dispose");r.tech_.off("seekablechanged",o);r.tech_.off("waiting",i);r.tech_.off(Sm,s);r.tech_.off("canplay",n);if(r.checkCurrentTimeTimeout_){e.clearTimeout(r.checkCurrentTimeTimeout_)}r.cancelTimer_()}}pp(t,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){e.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=e.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();return}if(this.tech_.paused()||this.tech_.seeking()){return}var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+_u>=t.end(t.length-1))){return this.techWaiting_()}if(5<=this.consecutiveUpdates&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=e}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0;if(this.timer_){this.logger_("cancelTimer_");clearTimeout(this.timer_)}this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking();if(!e){return!1}var t=this.seekable(),a=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow),n=void 0;if(r){var i=t.end(t.length-1);n=i}if(this.beforeSeekableWindow_(t,a)){var s=t.start(0);n=s+_u}if("undefined"!=typeof n){this.logger_("Trying to seek outside of seekable at time "+a+" with "+("seekable range "+Su(t)+". Seeking to ")+(n+"."));this.seekTo(n);return!0}return!1}},{key:"waiting_",value:function(){if(this.techWaiting_()){return}var e=this.tech_.currentTime(),t=this.tech_.buffered(),a=bu(t,e);if(a.length&&e+3<=a.end(0)){this.cancelTimer_();this.seekTo(e);this.logger_("Stopped at "+e+" while inside a buffered region "+("["+a.start(0)+" -> "+a.end(0)+"]. Attempting to resume playback by seeking to the current time."));this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}}},{key:"techWaiting_",value: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 a=e.end(e.length-1);this.logger_("Fell out of live window at time "+t+". Seeking to "+("live point (seekable end) "+a));this.cancelTimer_();this.seekTo(a);this.tech_.trigger({type:"usage",name:"hls-live-resync"});return!0}var r=this.tech_.buffered(),n=Tu(r,t);if(this.videoUnderflow_(n,r,t)){this.cancelTimer_();this.seekTo(t);this.tech_.trigger({type:"usage",name:"hls-video-underflow"});return!0}if(0<n.length){var i=n.start(0)-t;this.logger_("Stopped at "+t+", setting timer for "+i+", seeking "+("to "+n.start(0)));this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*i,t);return!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:!1;if(!e.length){return!1}var n=e.end(e.length-1)+_u,i=!a.endList;if(i&&r){n=e.end(e.length-1)+3*a.targetDuration}if(t>n){return!0}return!1}},{key:"beforeSeekableWindow_",value:function(e,t){if(e.length&&0<e.start(0)&&t<e.start(0)-_u){return!0}return!1}},{key:"videoUnderflow_",value:function(e,t,a){if(0===e.length){var r=this.gapFromVideoUnderflow_(t,a);if(r){this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". "+("Seeking to current time "+a));return!0}}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),a=this.tech_.currentTime(),r=Tu(t,a);this.cancelTimer_();if(0===r.length||a!==e){return}this.logger_("skipTheGap_:","currentTime:",a,"scheduled currentTime:",e,"nextRange start:",r.start(0));this.seekTo(r.start(0)+hu);this.tech_.trigger({type:"usage",name:"hls-gap-skip"})}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var a=vu(e),r=0;r<a.length;r++){var n=a.start(r),s=a.end(r);if(4>t-n&&2<t-n){return{start:n,end:s}}}return null}}]);return t}(),Cm={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),a=t.currentSource_;return e(a)}},Em=function e(t,a){var r=0,n=0,i=it.mergeOptions(Cm,a);t.ready(function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){if(n){t.currentTime(n)}},o=function(e){if(null===e||e===void 0){return}n=t.duration()!==1/0&&t.currentTime()||0;t.one("loadedmetadata",s);t.src(e);t.trigger({type:"usage",name:"hls-error-reload"});t.play()},l=function(){if(Date.now()-r<1e3*i.errorInterval){t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!i.getSource||"function"!=typeof i.getSource){it.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}r=Date.now();return i.getSource.call(t,o)},d=function e(){t.off("loadedmetadata",s);t.off("error",l);t.off("dispose",e)};t.on("error",l);t.on("dispose",d);t.reloadSourceOnError=function(a){d();e(t,a)}},Pm=function(e){Em(this,e)};it.use("*",function(e){return{setSource:function(e,t){t(null,e)},setCurrentTime:function(t){if(e.vhs&&e.currentSource().src===e.vhs.source_.src){e.vhs.setCurrentTime(t)}return t},play:function(){if(e.vhs&&e.currentSource().src===e.vhs.source_.src){e.vhs.setCurrentTime(e.tech_.currentTime())}}}});var Im={PlaylistLoader:Ep,Playlist:Gp,Decrypter:sp,AsyncStream:rp,decrypt:ip,utils:su,STANDARD_PLAYLIST_SELECTOR:function(){return Bc(this.playlists.master,this.systemBandwidth,parseInt(Rc(this.tech_.el(),"width"),10),parseInt(Rc(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(Gp.isEnabled);Uc(e,function(e,t){return Mc(e,t)});var t=e.filter(function(e){return Hu(e.attributes.CODECS).videoCodec});return t[0]||null},comparePlaylistBandwidth:Mc,comparePlaylistResolution:Nc,xhr:Yp()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(e){Object.defineProperty(Im,e,{get:function(){it.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing");return vc[e]},set:function(t){it.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing");if("number"!=typeof t||0>t){it.log.warn("value of Hls."+e+" must be greater than or equal to 0");return}vc[e]=t}})});var Lm=function(e){var t=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;if(t.test(e)){return"hls"}var a=/^application\/dash\+xml/i;if(a.test(e)){return"dash"}return null},xm=function(e,t){for(var a=t.media(),r=-1,n=0;n<e.length;n++){if(e[n].id===a.uri){r=n;break}}e.selectedIndex_=r;e.trigger({selectedIndex:r,type:"change"})},Am=function(e,t){t.representations().forEach(function(t){e.addQualityLevel(t)});xm(e,t.playlists)};Im.canPlaySource=function(){return it.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Dm=function(e,t,a){if(!e){return e}var r={};for(var n in e){r[n]={audioContentType:"audio/mp4; codecs=\""+a.attributes.CODECS+"\"",videoContentType:"video/mp4; codecs=\""+t.attributes.CODECS+"\""};if(t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh){r[n].pssh=t.contentProtection[n].pssh}if("string"==typeof e[n]){r[n].url=e[n]}}return it.mergeOptions(e,r)},wm=function(e){if("dash"!==e.options_.sourceType){return}var t=it.players[e.tech_.options_.playerId];if(t.eme){var a=Dm(e.source_.keySystems,e.playlists.media(),e.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());if(a){t.currentSource().keySystems=a;if(t.eme.initializeMediaKeys){t.eme.initializeMediaKeys()}}}},Om=function(){if(!window.localStorage){return null}var e=window.localStorage.getItem("videojs-vhs");if(!e){return null}try{return JSON.parse(e)}catch(t){return null}},Rm=function(e){if(!window.localStorage){return!1}var t=Om();t=t?it.mergeOptions(t,e):e;try{window.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(t){return!1}return t};Im.supportsNativeHls=function(){var e=t.createElement("video");if(!it.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))})}();Im.supportsNativeDash=function(){if(!it.getTech("Html5").isSupported()){return!1}return /maybe|probably/i.test(t.createElement("video").canPlayType("application/dash+xml"))}();Im.supportsTypeNatively=function(e){if("hls"===e){return Im.supportsNativeHls}if("dash"===e){return Im.supportsNativeDash}return!1};Im.isSupported=function(){return it.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Um=it.getComponent("Component"),Mm=function(e){cp(a,e);function a(e,r,n){dp(this,a);var i=mp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,r,n.hls));if(r.options_&&r.options_.playerId){var s=it(r.options_.playerId);if(!s.hasOwnProperty("hls")){Object.defineProperty(s,"hls",{get:function(){it.log.warn("player.hls is deprecated. Use player.tech().hls instead.");r.trigger({type:"usage",name:"hls-player-access"});return i},configurable:!0})}s.vhs=i;s.dash=i;i.player_=s}i.tech_=r;i.source_=e;i.stats={};i.setOptions_();if(i.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks){r.overrideNativeAudioTracks(!0);r.overrideNativeVideoTracks(!0)}else if(i.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks)){throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB")}i.on(t,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(){var e=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;if(e&&e.contains(i.tech_.el())){i.masterPlaylistController_.smoothQualityChange_()}});i.on(i.tech_,"seeking",function(){if(0===this.tech_.currentTime()&&this.tech_.player_.loop()){this.setCurrentTime(0)}});i.on(i.tech_,"error",function(){if(this.masterPlaylistController_){this.masterPlaylistController_.pauseLoading()}});i.on(i.tech_,"play",i.play);return i}pp(a,[{key:"setOptions_",value:function(){var e=this;this.options_.withCredentials=this.options_.withCredentials||!1;this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||!1;this.options_.limitRenditionByPlayerDimensions=!1===this.options_.limitRenditionByPlayerDimensions?!1:!0;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;if("number"!=typeof this.options_.blacklistDuration){this.options_.blacklistDuration=300}if("number"!=typeof this.options_.bandwidth){if(this.options_.useBandwidthFromLocalStorage){var t=Om();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"})}}}if("number"!=typeof this.options_.bandwidth){this.options_.bandwidth=vc.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===vc.INITIAL_BANDWIDTH;["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys"].forEach(function(t){if("undefined"!=typeof e.source_[t]){e.options_[t]=e.source_[t]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(e,t){var a=this;if(!e){return}this.setOptions_();this.options_.url=this.source_.src;this.options_.tech=this.tech_;this.options_.externHls=Im;this.options_.sourceType=Lm(t);this.options_.seekTo=function(e){a.tech_.setCurrentTime(e);a.setCurrentTime(e)};this.masterPlaylistController_=new fm(this.options_);this.playbackWatcher_=new km(it.mergeOptions(this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()}}));this.masterPlaylistController_.on("error",function(){var e=it.players[a.tech_.options_.playerId];e.error(a.masterPlaylistController_.error)});this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):Im.STANDARD_PLAYLIST_SELECTOR.bind(this);this.masterPlaylistController_.selectInitialPlaylist=Im.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.masterPlaylistController_.masterPlaylistLoader_;this.mediaSource=this.masterPlaylistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e;this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e;this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;if(0<this.throughput){t=1/this.throughput}else{t=0}var a=Math.floor(1/(e+t));return a},set:function(){it.log.error("The \"systemBandwidth\" property is read-only")}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Cu(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Cu(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}});this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));this.tech_.on("bandwidthupdate",function(){if(a.options_.useBandwidthFromLocalStorage){Rm({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}});this.masterPlaylistController_.on("selectedinitialmedia",function(){vm(a);wm(a)});this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")});this.tech_.ready(function(){return a.setupQualityLevels_()});if(!this.tech_.el()){return}this.tech_.src(it.URL.createObjectURL(this.masterPlaylistController_.mediaSource))}},{key:"setupQualityLevels_",value:function(){var e=this,t=it.players[this.tech_.options_.playerId];if(t&&t.qualityLevels){this.qualityLevels_=t.qualityLevels();this.masterPlaylistController_.on("selectedinitialmedia",function(){Am(e.qualityLevels_,e)});this.playlists.on("mediachange",function(){xm(e.qualityLevels_,e.playlists)})}}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.masterPlaylistController_){this.masterPlaylistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.player_){delete this.player_.vhs;delete this.player_.dash;delete this.player_.hls}if(this.tech_&&this.tech_.hls){delete this.tech_.hls}up(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"dispose",this).call(this)}},{key:"convertToProgramTime",value:function(e,t){return gu({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToProgramTime",value:function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:2;return yu({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:r,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]);return a}(Um),Nm={name:"videojs-http-streaming",VERSION:"1.10.6",canHandleSource:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=it.mergeOptions(it.options,t);return Nm.canPlayType(e.type,a)},handleSource:function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},r=it.mergeOptions(it.options,a);t.hls=new Mm(e,t,r);t.hls.xhr=Yp();t.hls.src(e.src,e.type);return t.hls},canPlayType:function(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=it.mergeOptions(it.options,t),r=a.hls.overrideNative,n=Lm(e),i=n&&(!Im.supportsTypeNatively(n)||r);return i?"maybe":""}};if("undefined"==typeof it.MediaSource||"undefined"==typeof it.URL){it.MediaSource=lc;it.URL=dc}if(lc.supportsNativeMediaSources()){it.getTech("Html5").registerSourceHandler(Nm,0)}it.HlsHandler=Mm;it.HlsSourceHandler=Nm;it.Hls=Im;if(!it.use){it.registerComponent("Hls",Im)}it.options.hls=it.options.hls||{};if(it.registerPlugin){it.registerPlugin("reloadSourceOnError",Pm)}else{it.plugin("reloadSourceOnError",Pm)}return it});
//# sourceMappingURL=video-lazy.min.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit