!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.videojs=t()}(this,function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}function t(e){return e.replace(/\n\r?\s*/g,"")}function i(e,t){it(e).forEach(function(i){return t(e[i],i)})}function r(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],n=Ge.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(We.warn(Ve(rt,e,i)),n.setAttribute(e,i)):"textContent"===e?p(n,i):n[e]=i}),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),r&&O(n,r),n}function p(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function A(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function g(e,t){return u(t),e.classList?e.classList.contains(t):function(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}(t).test(e.className)}function m(e,t){return e.classList?e.classList.add(t):g(e,t)||(e.className=(e.className+" "+t).trim()),e}function y(e,t){return e.classList?e.classList.remove(t):(u(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function v(e,t,i){var r=g(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!r),i!==r)return i?m(e,t):y(e,t),e}function E(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var r=t[i];null===r||void 0===r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function w(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,r=i.length-1;r>=0;r--){var n=i[r].name,o=i[r].value;"boolean"!=typeof e[n]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+n+",")||(o=null!==o),t[n]=o}return t}function b(e,t){return e.getAttribute(t)}function C(e,t,i){e.setAttribute(t,i)}function I(e,t){e.removeAttribute(t)}function S(){Ge.body.focus(),Ge.onselectstart=function(){return!1}}function M(){Ge.onselectstart=function(){return!0}}function k(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(a(e,"height"))),i.width||(i.width=parseFloat(a(e,"width"))),i}}function T(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=Ge.documentElement,r=Ge.body,n=i.clientLeft||r.clientLeft||0,o=Ue.pageXOffset||r.scrollLeft,a=t.left+o-n,s=i.clientTop||r.clientTop||0,u=Ue.pageYOffset||r.scrollTop,l=t.top+u-s;return{left:Math.round(a),top:Math.round(l)}}function D(e,t){var i={},r=T(e),n=e.offsetWidth,o=e.offsetHeight,a=r.top,s=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(a-u+o)/o)),i.x=Math.max(0,Math.min(1,(l-s)/n)),i}function B(e){return n(e)&&3===e.nodeType}function R(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Q(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),c(e)||B(e)?e:"string"==typeof e&&/\S/.test(e)?Ge.createTextNode(e):void 0}).filter(function(e){return e})}function O(e,t){return Q(t).forEach(function(t){return e.appendChild(t)}),e}function L(e,t){return O(R(e),t)}function x(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons}function q(){return st++}function K(e){var t=e[lt];return t||(t=e[lt]=q()),ut[t]||(ut[t]={}),ut[t]}function U(e){var t=e[lt];return!!t&&!!Object.getOwnPropertyNames(ut[t]).length}function F(e){var t=e[lt];if(t){delete ut[t];try{delete e[lt]}catch(t){e.removeAttribute?e.removeAttribute(lt):e[lt]=null}}}function j(e,t){var i=K(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&F(e)}function N(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function J(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var r=e||Ue.event;for(var n in e={},r)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&r.preventDefault||(e[n]=r[n]));if(e.target||(e.target=e.srcElement||Ge),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=Ge.documentElement,a=Ge.body;e.pageX=e.clientX+(o&&o.scrollLeft||a&&a.scrollLeft||0)-(o&&o.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||a&&a.scrollTop||0)-(o&&o.clientTop||a&&a.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}function G(e,t,i){if(Array.isArray(t))return N(G,e,t,i);var r=K(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=q()),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(!r.disabled){t=J(t);var n=r.handlers[t.type];if(n)for(var o=n.slice(0),a=0,s=o.length;a-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Y(e,t,i){if(U(e)){var r=K(e);if(r.handlers){if(Array.isArray(t))return N(Y,e,t,i);var n=function(e,t){r.handlers[t]=[],j(e,t)};if(void 0!==t){var o=r.handlers[t];if(o){if(!i)return void n(e,t);if(i.guid)for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(t){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=f("span",{className:"vjs-event-bus"});return r(e,Bt),e.on("dispose",function(){e.off(),Ue.setTimeout(function(){e.eventBusEl_=null},0)}),e}function V(e,t){return r(e,Rt),e.state=r({},e.state,t),"function"==typeof e.handleStateChanged&&Ct(e)&&e.on("statechanged",e.handleStateChanged),e}function H(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function X(){for(var e={},t=arguments.length,r=Array(t),n=0;ni)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,r,i.length-1),i[r][t]}function $(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:_.bind(null,"start",0,e),end:_.bind(null,"end",1,e)}}function ee(e,t){return Array.isArray(e)?$(e):void 0===e||void 0===t?$():$([[e,t]])}function te(e,t){var i=0,r=void 0,n=void 0;if(!t)return 0;e&&e.length||(e=ee(0,0));for(var o=0;ot&&(n=t),i+=n-r;return i/t}function ie(e){if(e instanceof ie)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:n(e)&&("number"==typeof e.code&&(this.code=e.code),r(this,e)),this.message||(this.message=ie.defaultMessages[this.code]||"")}function re(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function ne(e){re(e)&&e.then(null,function(e){})}function oe(e,t,i){var r=e;return Ui(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=Xi(t,{uri:e}),r.callback=i,r}function ae(e,t,i){return se(t=oe(e,t,i))}function se(e){function t(e){return clearTimeout(u),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,A)}function i(){if(!s){var t;clearTimeout(u),t=e.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var i=A,r=null;return 0!==t?(i={body:function(){var e=void 0;if(e=o.response?o.response:o.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}(o),p)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:c,headers:{},url:l,rawRequest:o},o.getAllResponseHeaders&&(i.headers=Hi(o.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),n(r,i,i.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var r=!1,n=function(t,i,n){r||(r=!0,e.callback(t,i,n))},o=e.xhr||null;o||(o=e.cors||e.useXDR?new ae.XDomainRequest:new ae.XMLHttpRequest);var a,s,u,l=o.url=e.uri||e.url,c=o.method=e.method||"GET",h=e.body||e.data,d=o.headers=e.headers||{},f=!!e.sync,p=!1,A={body:void 0,headers:{},statusCode:0,method:c,url:l,rawRequest:o};if("json"in e&&!1!==e.json&&(p=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),o.onreadystatechange=function(){4===o.readyState&&setTimeout(i,0)},o.onload=i,o.onerror=t,o.onprogress=function(){},o.onabort=function(){s=!0},o.ontimeout=t,o.open(c,l,!f,e.username,e.password),f||(o.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(u=setTimeout(function(){if(!s){s=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",t(e)}},e.timeout)),o.setRequestHeader)for(a in d)d.hasOwnProperty(a)&&o.setRequestHeader(a,d[a]);else e.headers&&function(e){for(var t in e)if(e.hasOwnProperty(t))return!1}(e.headers);return"responseType"in e&&(o.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(o),o.send(h||null),o}function ue(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function le(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+(0|r)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function ce(){this.values=cr(null)}function he(e,t,i,r){var n=r?e.split(r):[e];for(var o in n)if("string"==typeof n[o]){var a=n[o].split(i);if(2===a.length)t(a[0],a[1])}}function de(e,t,i){function r(){var t=le(e);if(null===t)throw new ue(ue.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function n(){e=e.replace(/^\s+/,"")}var o=e;if(n(),t.startTime=r(),n(),"--\x3e"!==e.substr(0,3))throw new ue(ue.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),n(),t.endTime=r(),n(),function(e,t){var r=new ce;he(e,function(e,t){switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){r.set(e,i[n].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var o=t.split(","),a=o[0];r.integer(e,a),r.percent(e,a)&&r.set("snapToLines",!1),r.alt(e,a,["auto"]),2===o.length&&r.alt("lineAlign",o[1],["start","middle","end"]);break;case"position":o=t.split(","),r.percent(e,o[0]),2===o.length&&r.alt("positionAlign",o[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}},/:/,/\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)}(e,t)}function fe(e,t){function i(e){return hr[e]}for(var r,n=e.document.createElement("div"),o=n,a=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])o.appendChild(e.document.createTextNode(function(e){for(;l=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(l[0],i);return e}(r)));else{if("/"===r[1]){a.length&&a[a.length-1]===r.substr(2).replace(">","")&&(a.pop(),o=o.parentNode);continue}var s,u=le(r.substr(1,r.length-2));if(u){s=e.document.createProcessingInstruction("timestamp",u),o.appendChild(s);continue}var l=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(s=function(t,i){var r=dr[t];if(!r)return null;var n=e.document.createElement(r);n.localName=r;var o=fr[t];return o&&i&&(n[o]=i.trim()),n}(l[1],l[3])))continue;if(!function(e,t){return!pr[t.localName]||pr[t.localName]===e.localName}(o,s))continue;l[2]&&(s.className=l[2].substr(1).replace("."," ")),a.push(l[1]),o.appendChild(s),o=s}return n}function pe(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Ae(){}function ge(e,t,i){Ae.call(this),this.cue=t,this.cueDiv=fe(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:function(e){function t(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function i(e){if(!e||!e.length)return null;var r=e.pop(),n=r.textContent||r.innerText;if(n){var o=n.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):n}return"ruby"===r.tagName?i(e):r.childNodes?(t(e,r),i(e)):void 0}var r=[],n="";if(!e||!e.childNodes)return"ltr";for(t(r,e);n=i(r);)for(var o=0;o=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,r=0,n=0;nh&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),a<0&&(c+=""===o.vertical?i.height:i.width,s=s.reverse()),n.move(d,c)}else{var f=n.lineHeight/i.height*100;switch(o.lineAlign){case"middle":a-=f/2;break;case"end":a-=f}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],n=new me(t)}var p=function(e,t){for(var n,o=new me(e),a=1,s=0;su&&(n=new me(e),a=u),e=new me(o)}return n||o}(n,s);t.move(p.toCSSCompatValues(i))}function ve(){}function Ee(e){return"string"==typeof e&&!!Er[e.toLowerCase()]&&e.toLowerCase()}function we(e,t,i){this.hasBeenReset=!1;var r="",n=!1,o=e,a=t,s=i,u=null,l="",c=!0,h="auto",d="start",f=50,p="middle",A=50,g="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 o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return s},set:function(e){s=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=function(e){return"string"==typeof e&&!!vr[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&e!==yr)throw new SyntaxError("An invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(e){var t=Ee(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");d=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");f=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=Ee(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return A},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");A=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=Ee(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function be(e){return"number"==typeof e&&e>=0&&e<=100}function Ce(e,t,i){e.setTimeout(function(){return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],o=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=i[0],l=i.slice(1);if("string"==typeof u)e(t,Rr[u],n,o,a,s);else if(u){var c=function(e,t){var i=Qr[e.id()],r=null;if(void 0===i||null===i)return r=t(e),Qr[e.id()]=[[t,r]],r;for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:null,n="call"+H(i),o=e.reduce(Se(n),r),a=o===Or,s=a?null:t[i](o);return function(e,t,i,r){for(var n=e.length-1;n>=0;n--){var o=e[n];o[t]&&o[t](r,i)}}(e,i,s,a),s}function Se(e){return function(t,i){return t===Or?Or:i[e]?i[e](t):t}}function Me(e){var t=Ur(e.src);return!e.type&&t&&(e.type=t),e}function ke(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Te(e,t,i){try{e.style[t]=i}catch(e){return}}function De(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Hr(e,t)}function Be(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Re(e,t,i){var r=Re.getPlayer(e);if(r)return t&&We.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&r.ready(i),r;var o="string"==typeof e?nt("#"+Mo(e)):e;if(!c(o))throw new TypeError("The element or ID supplied is not valid. (videojs)");Ge.body.contains(o)||We.warn("The element supplied is not included in the DOM"),t=t||{},Re.hooks("beforesetup").forEach(function(e){var i=e(o,X(t));n(i)&&!Array.isArray(i)?t=X(t,i):We.error("please return an object in beforesetup hooks")});var a=Qt.getComponent("Player");return r=new a(o,t,i),Re.hooks("setup").forEach(function(e){return e(r)}),r}function Qe(e,t){return function(i){var r=this;if(!t)return new Vh(e);if(Vh&&!i){var n=Oe(t.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Ph]=new Vh(n),function(e,t){if(e&&t){var i=e.terminate;e.objURL=t,e.terminate=function(){e.objURL&&Wh.revokeObjectURL(e.objURL),i.call(e)}}}(this[Ph],n),this[Ph]}var o={postMessage:function(e){r.onmessage&&setTimeout(function(){r.onmessage({data:e,target:o})})}};t.call(o),this.postMessage=function(e){setTimeout(function(){o.onmessage({data:e,target:r})})},this.isThisThread=!0}}function Oe(e){try{return Wh.createObjectURL(new Blob([e],{type:zh}))}catch(i){var t=new Zh;return t.append(e),Wh.createObjectURL(t.getBlob(type))}}function Le(){}var xe,qe="7.2.4",Ke="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ue="undefined"!=typeof window?window:void 0!==Ke?Ke:"undefined"!=typeof self?self:{},Fe={},je=Object.freeze({default:Fe}),Ne=je&&Fe||je,Je=void 0!==Ke?Ke:"undefined"!=typeof window?window:{};"undefined"!=typeof document?xe=document:(xe=Je["__GLOBAL_DOCUMENT_CACHE@4"])||(xe=Je["__GLOBAL_DOCUMENT_CACHE@4"]=Ne);var Ge=xe,Ye=void 0,Pe="info",ze=[],Ze=function(e,t){var i=Ye.levels[Pe],r=new RegExp("^("+i+")$");if("log"!==e&&t.unshift(e.toUpperCase()+":"),ze&&ze.push([].concat(t)),t.unshift("VIDEOJS:"),Ue.console){var n=Ue.console[e];n||"debug"!==e||(n=Ue.console.info||Ue.console.log),!n||!i||r.test(e)}};(Ye=function(){for(var e=arguments.length,t=Array(e),i=0;i0)for(var n=0,o=r.length;n=t&&(e.apply(void 0,arguments),i=r)}},Et=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ue,n=void 0,o=function(){var o=this,a=arguments,s=function(){n=null,s=null,i||e.apply(o,a)};!n&&i&&e.apply(o,a),r.clearTimeout(n),n=r.setTimeout(s,t)};return o.cancel=function(){r.clearTimeout(n),n=null},o},wt=function(){};wt.prototype.allowedEvents_={},wt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},G(this,e,t),this.addEventListener=i},wt.prototype.addEventListener=wt.prototype.on,wt.prototype.off=function(e,t){Y(this,e,t)},wt.prototype.removeEventListener=wt.prototype.off,wt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},z(this,e,t),this.addEventListener=i},wt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=J(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),P(this,e)},wt.prototype.dispatchEvent=wt.prototype.trigger;var bt=void 0;wt.prototype.queueTrigger=function(e){var t=this;bt||(bt=new Map);var i=e.type||e,r=bt.get(this);r||(r=new Map,bt.set(this,r));var n=r.get(i);r.delete(i),Ue.clearTimeout(n);var o=Ue.setTimeout(function(){0===r.size&&(r=null,bt.delete(t)),t.trigger(e)},0);r.set(i,o)};var Ct=function(e){return e instanceof wt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},It=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},St=function(e){if(!e.nodeName&&!Ct(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Mt=function(e){if(!It(e))throw new Error("Invalid event type; must be a non-empty string or array.")},kt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Tt=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,r=void 0,n=void 0,o=void 0;return i?(r=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],o=t[1]):(r=t[0],n=t[1],o=t[2]),St(r),Mt(n),kt(o),{isTargetingSelf:i,target:r,type:n,listener:o=yt(e,o)}},Dt=function(e,t,i,r){St(e),e.nodeName?dt[t](e,i,r):e[t](i,r)},Bt={on:function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),F(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return We.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=X(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return f(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),o=n&&n[r],a=r&&r.split("-")[0],s=n&&n[a],u=i;return o&&o[e]?u=o[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var r=t[i-1],n=r;return void 0===r&&(n=e),n})),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=H(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,n=void 0,o=void 0;if("string"==typeof t){o=H(t);var a=i.componentClass||o;i.name=o;var s=e.getComponent(a);if(!s)throw new Error("Component "+a+" does not exist");if("function"!=typeof s)return null;n=new s(this.player_||this,i)}else n=t;if(this.children_.splice(r,0,n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(o=o||n.name&&H(n.name()))&&(this.childNameIndex_[o]=n),"function"==typeof n.el&&n.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(n.el(),u)}return n},e.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var r=this.options_,n=void 0,o=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var r=void 0,n=void 0;return"string"==typeof e?n=i[r=e]||t.options_[r]||{}:(r=e.name,n=e),{name:r,opts:n}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||H(t.name));return i&&!o.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var o=t.addChild(i,n);o&&(t[i]=o)}})}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.prototype.$=function(e,t){return nt(e,t||this.contentEl())},e.prototype.$$=function(e,t){return ot(e,t||this.contentEl())},e.prototype.hasClass=function(e){return g(this.el_,e)},e.prototype.addClass=function(e){m(this.el_,e)},e.prototype.removeClass=function(e){y(this.el_,e)},e.prototype.toggleClass=function(e,t){v(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return b(this.el_,e)},e.prototype.setAttribute=function(e,t){C(this.el_,e,t)},e.prototype.removeAttribute=function(e){I(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],n=r.indexOf("px");return-1!==n?parseInt(r.slice(0,n),10):parseInt(this.el_["offset"+H(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof Ue.getComputedStyle){var i=Ue.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var r="offset"+H(e);t=this.el_[r]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=void 0;this.on("touchstart",function(r){1===r.touches.length&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=(new Date).getTime(),i=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)i=!1;else if(t){var r=e.touches[0].pageX-t.pageX,n=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+n*n)>10&&(i=!1)}});var r=function(){i=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){t=null,!0===i&&(new Date).getTime()-e<200&&(r.preventDefault(),this.trigger("tap"))})},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=yt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,r,n=this;return e=yt(this,e),i=Ue.setTimeout(function(){n.off("dispose",r),e()},t),(r=function(){return n.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",r),i},e.prototype.clearTimeout=function(e){Ue.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=yt(this,e);var r=Ue.setInterval(e,t),n=function(){return i.clearInterval(r)};return n.guid="vjs-interval-"+r,this.on("dispose",n),r},e.prototype.clearInterval=function(e){Ue.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,r=this;return this.supportsRaf_?(e=yt(this,e),t=Ue.requestAnimationFrame(function(){r.off("dispose",i),e()}),(i=function(){return r.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){Ue.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r=e.getComponent("Tech"),n=r&&r.isTech(i),o=e===i||e.prototype.isPrototypeOf(i.prototype);if(n||!o){throw new Error('Illegal component, "'+t+'"; '+(n?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".")}t=H(t),e.components_||(e.components_={});var a=e.getComponent("Player");if("Player"===t&&a&&a.players){var s=a.players,u=Object.keys(s);if(s&&u.length>0&&u.map(function(e){return s[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=H(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();Qt.prototype.supportsRaf_="function"==typeof Ue.requestAnimationFrame&&"function"==typeof Ue.cancelAnimationFrame,Qt.registerComponent("Component",Qt);for(var Ot=Ue.navigator&&Ue.navigator.userAgent||"",Lt=/AppleWebKit\/([\d.]+)/i.exec(Ot),xt=Lt?parseFloat(Lt.pop()):null,qt=/iPad/i.test(Ot),Kt=/iPhone/i.test(Ot)&&!qt,Ut=/iPod/i.test(Ot),Ft=Kt||qt||Ut,jt=function(){var e=Ot.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Nt=/Android/i.test(Ot),Jt=function(){var e=Ot.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Gt=Nt&&Jt<5&&xt<537,Yt=/Firefox/i.test(Ot),Pt=/Edge/i.test(Ot),zt=!Pt&&(/Chrome/i.test(Ot)||/CriOS/i.test(Ot)),Zt=function(){var e=Ot.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Wt=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ot),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Ot)&&/rv:11.0/.test(Ot)&&(t=11),t}(),Vt=/Safari/i.test(Ot)&&!zt&&!Nt&&!Pt,Ht=(Vt||Ft)&&!zt,Xt=(l()&&("ontouchstart"in Ue||Ue.navigator.maxTouchPoints||Ue.DocumentTouch&&Ue.document instanceof Ue.DocumentTouch)),_t=Object.freeze({IS_IPAD:qt,IS_IPHONE:Kt,IS_IPOD:Ut,IS_IOS:Ft,IOS_VERSION:jt,IS_ANDROID:Nt,ANDROID_VERSION:Jt,IS_NATIVE_ANDROID:Gt,IS_FIREFOX:Yt,IS_EDGE:Pt,IS_CHROME:zt,CHROME_VERSION:Zt,IE_VERSION:Wt,IS_SAFARI:Vt,IS_ANY_SAFARI:Ht,TOUCH_ENABLED:Xt}),$t={},ei=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],ti=ei[0],ii=void 0,ri=0;ri0&&void 0!==arguments[0]?arguments[0]:[];Xe(this,t);var r=$e(this,e.call(this));r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];Xe(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].enabled){pi(i,i[r]);break}var n=$e(this,e.call(this,i));return n.changing_=!1,n}return _e(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&pi(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){i.changing_||(i.changing_=!0,pi(i,t),i.changing_=!1,i.trigger("change"))})},t}(di),gi=function(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];Xe(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].selected){gi(i,i[r]);break}var n=$e(this,e.call(this,i));return n.changing_=!1,Object.defineProperty(n,"selectedIndex",{get:function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:[];Xe(this,e),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,r=t.length;i0&&void 0!==arguments[0]?arguments[0]:{};Xe(this,t);var r=$e(this,e.call(this)),n={id:i.id||"vjs_track_"+q(),kind:i.kind||"",label:i.label||"",language:i.language||""};for(var o in n)!function(e){Object.defineProperty(r,e,{get:function(){return n[e]},set:function(){}})}(o);return r}return _e(t,e),t}(wt),Mi=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=Ge.createElement("a");i.href=e;var r=""===i.host&&"file:"!==i.protocol,n=void 0;r&&((n=Ge.createElement("div")).innerHTML='',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),Ge.body.appendChild(n));for(var o={},a=0;ax',e=t.firstChild.href}return e},Ti=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},Di=function(e){var t=Ue.location,i=Mi(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},Bi=Object.freeze({parseUrl:Mi,getAbsoluteURL:ki,getFileExtension:Ti,isCrossOrigin:Di}),Ri=function(e){var t=Qi.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)},Qi=Object.prototype.toString,Oi=Object.freeze({default:Ri,__moduleExports:Ri}),Li=e(function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}}),xi=Li.left,qi=Li.right,Ki=Object.freeze({default:Li,__moduleExports:Li,left:xi,right:qi}),Ui=Oi&&Ri||Oi,Fi=function(e,t,i){if(!Ui(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this),"[object Array]"===ji.call(e)?function(e,t,i){for(var r=0,n=e.length;r0&&(Ue.console&&Ue.console.groupCollapsed&&Ue.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(e){return We.error(e)}),Ue.console&&Ue.console.groupEnd&&Ue.console.groupEnd()),i.flush()},er=function(e,t){var i={uri:e},r=Di(e);r&&(i.cors=r),_i(i,yt(this,function(e,i,r){if(e)return We.error(e,i);if(t.loaded_=!0,"function"!=typeof Ue.WebVTT){if(t.tech_){var n=function(){return $i(r,t)};t.tech_.on("vttjsloaded",n),t.tech_.on("vttjserror",function(){We.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",n)})}}else $i(r,t)}))},tr=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Xe(this,t),!i.tech)throw new Error("A tech was not provided.");var r=X(i,{kind:Ci[i.kind]||"subtitles",language:i.language||i.srclang||""}),n=Ii[r.mode]||"disabled",o=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(n="hidden");var a=$e(this,e.call(this,r));a.tech_=r.tech,a.cues_=[],a.activeCues_=[];var s=new Ei(a.cues_),u=new Ei(a.activeCues_),l=!1,c=yt(a,function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==n&&a.tech_.ready(function(){a.tech_.on("timeupdate",c)},!0),Object.defineProperties(a,{default:{get:function(){return o},set:function(){}},mode:{get:function(){return n},set:function(e){var t=this;Ii[e]&&("disabled"!==(n=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",c)},!0):this.tech_.off("timeupdate",c),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var e=this.tech_.currentTime(),t=[],i=0,r=this.cues.length;i=e?t.push(n):n.startTime===n.endTime&&n.startTime<=e&&n.startTime+.5>=e&&t.push(n)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};Xe(this,t);var r=X(i,{kind:bi[i.kind]||""}),n=$e(this,e.call(this,r)),o=!1;return Object.defineProperty(n,"enabled",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return _e(t,e),t}(Si),rr=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Xe(this,t);var r=X(i,{kind:wi[i.kind]||""}),n=$e(this,e.call(this,r)),o=!1;return Object.defineProperty(n,"selected",{get:function(){return o},set:function(e){"boolean"==typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),r.selected&&(n.selected=r.selected),n}return _e(t,e),t}(Si),nr=0,or=2,ar=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Xe(this,t);var r=$e(this,e.call(this)),n=void 0,o=new tr(i);return r.kind=o.kind,r.src=o.src,r.srclang=o.language,r.label=o.label,r.default=o.default,Object.defineProperties(r,{readyState:{get:function(){return n}},track:{get:function(){return o}}}),n=nr,o.addEventListener("loadeddata",function(){n=or,r.trigger({type:"load",target:r})}),r}return _e(t,e),t}(wt);ar.prototype.allowedEvents_={load:"load"},ar.NONE=nr,ar.LOADING=1,ar.LOADED=or,ar.ERROR=3;var sr={audio:{ListClass:Ai,TrackClass:ir,capitalName:"Audio"},video:{ListClass:mi,TrackClass:rr,capitalName:"Video"},text:{ListClass:yi,TrackClass:tr,capitalName:"Text"}};Object.keys(sr).forEach(function(e){sr[e].getterName=e+"Tracks",sr[e].privateName=e+"Tracks_"});var ur={remoteText:{ListClass:yi,TrackClass:tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:vi,TrackClass:ar,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},lr=X(sr,ur);ur.names=Object.keys(ur),sr.names=Object.keys(sr),lr.names=[].concat(ur.names).concat(sr.names);var cr=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();ue.prototype=cr(Error.prototype),ue.prototype.constructor=ue,ue.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ce.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var r=0;r=0&&t<=100)&&(this.set(e,t),!0)}};var hr={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},dr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},fr={v:"title",lang:"lang"},pr={rt:"ruby"},Ar=[[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]];Ae.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Ae.prototype.formatStyle=function(e,t){return 0===e?0:e+t},ge.prototype=cr(Ae.prototype),ge.prototype.constructor=ge,me.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},me.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},me.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},me.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},me.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},me.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}},me.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i}},ve.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},ve.convertCueToDOMTree=function(e,t){return e&&t?fe(e,t):null},ve.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",i.appendChild(r),function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Xe(this,t),i.reportTouchActivity=!1;var n=$e(this,e.call(this,null,i,r));return n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),lr.names.forEach(function(e){var t=lr[e];i&&i[t.getterName]&&(n[t.privateName]=i[t.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===i["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)}),!1===i.nativeCaptions||!1===i.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new lr.text.ListClass,n.initTrackListeners(),i.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}return _e(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(yt(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return ee(0,0)},t.prototype.bufferedPercent=function(){return te(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(sr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach(function(e){for(var i=t[e+"Tracks"]()||[],r=i.length;r--;){var n=i[r];"text"===e&&t.removeRemoteTextTrack(n),i.removeTrack(n)}})},t.prototype.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new ie(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?ee(0,0):ee()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;sr.names.forEach(function(t){var i=sr[t],r=function(){e.trigger(t+"trackchange")},n=e[i.getterName]();n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),e.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r)})})},t.prototype.addWebVttScript_=function(){var e=this;if(!Ue.WebVTT)if(Ge.body.contains(this.el())){if(!this.options_["vtt.js"]&&o(Dr)&&Object.keys(Dr).length>0)return void this.trigger("vttjsloaded");var t=Ge.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),Ue.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},n=function(e){return t.removeTrack(e.track)};i.on("addtrack",r),i.on("removetrack",n),this.addWebVttScript_();var o=function(){return e.trigger("texttrackchange")},a=function(){o();for(var e=0;e4&&void 0!==arguments[4]?arguments[4]:{},o=e.textTracks();n.kind=t,i&&(n.label=i),r&&(n.language=r),n.tech=e;var a=new lr.text.TrackClass(n);return o.addTrack(a),a}(this,e,t,i)},t.prototype.createRemoteTextTrack=function(e){var t=X(e,{tech:this});return new ur.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],r=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&(We.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==i&&this.ready(function(){return e.autoRemoteTextTracks_.addTrack(r.track)}),r},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.overrideNativeAudioTracks=function(){},t.prototype.overrideNativeVideoTracks=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=H(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=H(e),t.techs_&&t.techs_[e]?t.techs_[e]:Ue&&Ue.videojs&&Ue.videojs[e]?(We.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),Ue.videojs[e]):void 0},t}(Qt));lr.names.forEach(function(e){var t=lr[e];Br.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),Br.prototype.featuresVolumeControl=!0,Br.prototype.featuresMuteControl=!0,Br.prototype.featuresFullscreenResize=!1,Br.prototype.featuresPlaybackRate=!1,Br.prototype.featuresProgressEvents=!1,Br.prototype.featuresSourceset=!1,Br.prototype.featuresTimeupdateEvents=!1,Br.prototype.featuresNativeTextTracks=!1,Br.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===i&&(i=r.length),r.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],r=void 0,n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=Ti(e);return Kr[t.toLowerCase()]||""},Fr=function(e){function t(i,r,n){Xe(this,t);var o=X({createEl:!1},r),a=$e(this,e.call(this,i,o,n));if(r.playerOptions.sources&&0!==r.playerOptions.sources.length)i.src(r.playerOptions.sources);else for(var s=0,u=r.playerOptions.techOrder;s0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=r({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&We.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=r({role:"button"},n),this.tabIndex_=i.tabIndex;var o=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(o),o},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=f("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,p(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){G(Ge,"keydown",yt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){Y(Ge,"keydown",yt(this,this.handleKeyPress))},t}(Qt);Qt.registerComponent("ClickableComponent",jr);var Nr=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.update(),i.on("posterchange",yt(n,n.update)),n}return _e(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){return f("div",{className:"vjs-poster",tabIndex:-1})},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?ne(this.player_.play()):this.player_.pause())},t}(jr);Qt.registerComponent("PosterImage",Nr);var Jr={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'},Gr=function(e){function t(i,r,n){Xe(this,t);var o=$e(this,e.call(this,i,r,n)),a=yt(o,o.updateDisplay);return i.on("loadstart",yt(o,o.toggleDisplay)),i.on("texttrackchange",a),i.on("loadstart",yt(o,o.preselectTrack)),i.ready(yt(o,function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",a),i.on("playerresize",a),Ue.addEventListener("orientationchange",a),i.on("dispose",function(){return Ue.removeEventListener("orientationchange",a)});for(var e=this.options_.playerOptions.tracks||[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=r({innerHTML:'',className:this.buildCSSClass()},t),i=r({type:"button"},i);var n=Qt.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return We.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),Qt.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(jr);Qt.registerComponent("Button",Pr);var zr=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)ne(t);else{var i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(r){var n=function(){return r.focus()};re(t)?t.then(n,function(){}):this.setTimeout(n,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(Pr);zr.prototype.controlText_="Play Video",Qt.registerComponent("BigPlayButton",zr);var Zr=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.controlText(r&&r.controlText||n.localize("Close")),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(Pr);Qt.registerComponent("CloseButton",Zr);var Wr=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on(i,"play",n.handlePlay),n.on(i,"pause",n.handlePause),n.on(i,"ended",n.handleEnded),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(Pr);Wr.prototype.controlText_="Play",Qt.registerComponent("PlayToggle",Wr);var Vr=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=r=i="-"),(n=n>0||a>0?n+":":"")+(r=((n||o>=10)&&r<10?"0"+r:r)+":")+(i=i<10?"0"+i:i)},Hr=Vr,Xr=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.throttledUpdateContent=vt(yt(n,n.updateContent),25),n.on(i,"timeupdate",n.throttledUpdateContent),n}return _e(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),r=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});return this.contentEl_=f("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),r.appendChild(this.contentEl_),r},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=Ge.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return De(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(Qt);Xr.prototype.labelText_="Time",Xr.prototype.controlText_="Time",Qt.registerComponent("TimeDisplay",Xr);var _r=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on(i,"ended",n.handleEnded),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(Xr);_r.prototype.labelText_="Current Time",_r.prototype.controlText_="Current Time",Qt.registerComponent("CurrentTimeDisplay",_r);var $r=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on(i,"durationchange",n.updateContent),n.on(i,"loadedmetadata",n.throttledUpdateContent),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(Xr);$r.prototype.labelText_="Duration",$r.prototype.controlText_="Duration",Qt.registerComponent("DurationDisplay",$r);var en=function(e){function t(){return Xe(this,t),$e(this,e.apply(this,arguments))}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},t}(Qt);Qt.registerComponent("TimeDivider",en);var tn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on(i,"durationchange",n.throttledUpdateContent),n.on(i,"ended",n.handleEnded),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(Xr);tn.prototype.labelText_="Remaining Time",tn.prototype.controlText_="Remaining Time",Qt.registerComponent("RemainingTimeDisplay",tn);var rn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}return _e(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=f("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Qt);Qt.registerComponent("LiveDisplay",rn);var nn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}return _e(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=r({tabIndex:0},i),n=r({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||zt||e.preventDefault(),S(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;M(),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()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",r=t.el().style;return this.vertical()?r.height=i:r.width=i,e}}},t.prototype.calculateDistance=function(e){var t=D(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(Qt);Qt.registerComponent("Slider",nn);var on=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.partEls_=[],n.on(i,"progress",n.update),n}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),r=this.player_.bufferedEnd(),n=this.partEls_,o=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=o(r,i);for(var a=0;at.length;c--)this.el_.removeChild(n[c-1]);n.length=t.length},t}(Qt);Qt.registerComponent("LoadProgressBar",on);var an=function(e){function t(){return Xe(this,t),$e(this,e.apply(this,arguments))}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var r=k(this.el_),n=k(this.player_.el()),o=e.width*t;if(n&&r){var a=e.left-n.left+o,s=e.width-o+(n.right-e.right),u=r.width/2;ar.width&&(u=r.width),this.el_.style.right="-"+u+"px",p(this.el_,i)}},t}(Qt);Qt.registerComponent("TimeTooltip",an);var sn=function(e){function t(){return Xe(this,t),$e(this,e.apply(this,arguments))}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=De(i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),i.player_.duration()),n=i.getChild("timeTooltip");n&&n.update(e,t,r)})},t}(Qt);sn.prototype.options_={children:[]},Ft||Nt||sn.prototype.options_.children.push("timeTooltip"),Qt.registerComponent("PlayProgressBar",sn);var un=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.update=vt(yt(n,n.update),25),n}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=i.player_.duration(),n=De(t*r,r);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,n)})},t}(Qt);un.prototype.options_={children:["timeTooltip"]},Qt.registerComponent("MouseTimeDisplay",un);var ln=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.setEventHandlers_(),n}return _e(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=vt(yt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval(function(){e.requestAnimationFrame(function(){e.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){e.clearInterval(e.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[De(e,i),De(i,i)],"{1} of {2}")),this.bar.update(k(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e||0},t.prototype.handleMouseDown=function(t){x(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(x(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&ne(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(nn);ln.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Ft||Nt||ln.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ln.prototype.playerEvent="timeupdate",Qt.registerComponent("SeekBar",ln);var cn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.handleMouseMove=vt(yt(n,n.handleMouseMove),25),n.throttledHandleMouseSeek=vt(yt(n,n.handleMouseSeek),25),n.enable(),n}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),r=t.el(),n=k(r),o=D(r,e).x;o>1?o=1:o<0&&(o=0),i&&i.update(n,o)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.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)},t}(Qt);cn.prototype.options_={children:["seekBar"]},Qt.registerComponent("ProgressControl",cn);var hn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on(i,"fullscreenchange",n.handleFullscreenChange),!1===Ge[$t.fullscreenEnabled]&&n.disable(),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Pr);hn.prototype.controlText_="Fullscreen",Qt.registerComponent("FullscreenToggle",hn);var dn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},fn=function(e){function t(){return Xe(this,t),$e(this,e.apply(this,arguments))}return _e(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t}(Qt);Qt.registerComponent("VolumeLevel",fn);var pn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.on("slideractive",n.updateLastVolume_),n.on(i,"volumechange",n.updateARIAAttributes),i.ready(function(){return n.updateARIAAttributes()}),n}return _e(t,e),t.prototype.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"})},t.prototype.handleMouseDown=function(t){x(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){x(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(nn);pn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},pn.prototype.playerEvent="volumechange",Qt.registerComponent("VolumeBar",pn);var An=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xe(this,t),r.vertical=r.vertical||!1,(void 0===r.volumeBar||o(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical);var n=$e(this,e.call(this,i,r));return dn(n,i),n.throttledHandleMouseMove=vt(yt(n,n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}return _e(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Qt);An.prototype.options_={children:["volumeBar"]},Qt.registerComponent("VolumeControl",An);var gn=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},mn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return gn(n,i),n.on(i,["loadstart","volumechange"],n.update),n}return _e(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;Ft&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)y(this.el_,"vjs-vol-"+i);m(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Pr);mn.prototype.controlText_="Mute",Qt.registerComponent("MuteToggle",mn);var yn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xe(this,t),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumeControl||o(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline);var n=$e(this,e.call(this,i,r));return n.on(i,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}return _e(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(Qt);yn.prototype.options_={children:["muteToggle","volumeControl"]},Qt.registerComponent("VolumePanel",yn);var vn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}return _e(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",yt(this,function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())}))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=f(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),G(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(Qt);Qt.registerComponent("Menu",vn);var En=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xe(this,t);var n=$e(this,e.call(this,i,r));n.menuButton_=new Pr(i,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var o=Pr.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+o,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_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on("keydown",n.handleSubmenuKeyPress),n}return _e(t,e),t.prototype.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.prototype.createMenu=function(){var e=new vn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=f("li",{className:"vjs-menu-title",innerHTML:H(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),A(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",yt(this,function(e){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){G(Ge,"keydown",yt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){Y(Ge,"keydown",yt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ft&&h())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(Qt);Qt.registerComponent("MenuButton",En);var wn=function(e){function t(i,r){Xe(this,t);var n=r.tracks,o=$e(this,e.call(this,i,r));if(o.items.length<=1&&o.hide(),!n)return $e(o);var a=yt(o,o.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),o.player_.on("ready",a),o.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a)}),o}return _e(t,e),t}(En);Qt.registerComponent("TrackButton",wn);var bn=function(e){function t(i,r){Xe(this,t);var n=$e(this,e.call(this,i,r));return n.selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}return _e(t,e),t.prototype.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",r({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},i),n)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(jr);Qt.registerComponent("MenuItem",bn);var Cn=function(e){function t(i,r){Xe(this,t);var n=r.track,o=i.textTracks();r.label=n.label||n.language||"Unknown",r.selected="showing"===n.mode;var a=$e(this,e.call(this,i,r));a.track=n;var s=function(){for(var e=arguments.length,t=Array(e),i=0;i-1?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(bn);Qt.registerComponent("TextTrackMenuItem",Cn);var In=function(e){function t(i,r){return Xe(this,t),r.track={player:i,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,$e(this,e.call(this,i,r))}return _e(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,r=0,n=t.length;r-1&&"showing"===o.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,r=0,n=t.length;r-1&&"showing"===o.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Cn);Qt.registerComponent("OffTextTrackMenuItem",In);var Sn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe(this,t),r.tracks=i.textTracks(),$e(this,e.call(this,i,r))}return _e(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cn,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new In(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var n=0;n-1){var a=new t(this.player_,{track:o,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+o.kind+"-menu-item"),e.push(a)}}return e},t}(wn);Qt.registerComponent("TextTrackButton",Sn);var Mn=function(e){function t(i,r){Xe(this,t);var n=r.track,o=r.cue,a=i.currentTime();r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=a&&a=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(H(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,r=t.length;i