vendor: 22,158 bytes, lines 1-2
1/*! For license information please see videopress.js.LICENSE.txt */ 2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.videopress=t():e.videopress=t()}(this,()=>(()=>{var e={495(e,t,i){"use strict";var s=i(840);e.exports=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var a=r;if(t)if(s.TextDecoder){var o=(void 0===(l=n.headers&&n.headers["content-type"])&&(l=""),l.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),s=i[0],n=i[1];return"charset"===s.trim()?n.trim():e},"utf-8"));try{a=new TextDecoder(o).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r);var l}}},36(e,t,i){"use strict";var s=i(840),n=i(634),r=i(56),a=i(162),o=i(670);function l(e,t,i){var s=e;return r(t)?(i=t,"string"==typeof e&&(s={uri:e})):s=n({},t,{uri:e}),s.callback=i,s}function c(e,t,i){return u(t=l(e,t,i))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&c.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},i=c.requestInterceptorsStorage.execute(e.requestType,t);e.uri=i.uri,e.headers=i.headers,e.body=i.body,e.metadata=i.metadata,e.retry=i.retry,e.timeout=i.timeout}var s=!1,n=function(t,i,n){s||(s=!0,e.callback(t,i,n))};function r(){var e=void 0;if(e=h.response?h.response:h.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(h),v)try{e=JSON.parse(e)}catch(e){}return e}function a(t){if(clearTimeout(p),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,d||!c.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&c.responseInterceptorsStorage.getIsEnabled()){var i={headers:b.headers||{},body:b.body,responseUrl:h.responseURL,responseType:h.responseType},s=c.responseInterceptorsStorage.execute(e.requestType,i);b.body=s.body,b.headers=s.headers}return n(t,b)}e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=h,u(e)},e.retry.getCurrentFuzzedDelay())}function o(){if(!d){var t;clearTimeout(p),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===h.status?200:1223===h.status?204:h.status;var i=b,s=null;if(0!==t?(i={body:r(),statusCode:t,method:g,headers:{},url:m,rawRequest:h},h.getAllResponseHeaders&&(i.headers=function(e){var t={};return e?(e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),s=e.slice(0,i).trim().toLowerCase(),n=e.slice(i+1).trim();void 0===t[s]?t[s]=n:Array.isArray(t[s])?t[s].push(n):t[s]=[t[s],n]}),t):t}(h.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),e.requestType&&c.responseInterceptorsStorage.getIsEnabled()){var a={headers:i.headers||{},body:i.body,responseUrl:h.responseURL,responseType:h.responseType},o=c.responseInterceptorsStorage.execute(e.requestType,a);i.body=o.body,i.headers=o.headers}return n(s,i,i.body)}}var l,d,h=e.xhr||null;h||(h=e.cors||e.useXDR?new c.XDomainRequest:new c.XMLHttpRequest);var p,m=h.url=e.uri||e.url,g=h.method=e.method||"GET",f=e.body||e.data,y=h.headers=e.headers||{},_=!!e.sync,v=!1,b={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:h};if("json"in e&&!1!==e.json&&(v=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==g&&"HEAD"!==g&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),h.onreadystatechange=function(){4!==h.readyState||c.responseInterceptorsStorage.getIsEnabled()||setTimeout(o,0)},h.onload=o,h.onerror=a,h.onprogress=function(){},h.onabort=function(){d=!0,clearTimeout(e.retryTimeout)},h.ontimeout=a,h.open(g,m,!_,e.username,e.password),_||(h.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(p=setTimeout(function(){if(!d){d=!0,h.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}},e.timeout)),h.setRequestHeader)for(l in y)y.hasOwnProperty(l)&&h.setRequestHeader(l,y[l]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(h.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(h),h.send(f||null),h}c.httpHandler=i(495),c.requestInterceptorsStorage=new a,c.responseInterceptorsStorage=new a,c.retryManager=new o,e.exports=c,e.exports.default=c,c.XMLHttpRequest=s.XMLHttpRequest||function(){},c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:s.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){c["delete"===e?"del":e]=function(t,i,s){return(i=l(t,i,s)).method=e.toUpperCase(),u(i)}})},162(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}var i=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var i=e.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},i.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},i.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!(!i||!i.has(t)||(i.delete(t),0))},i.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},i.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},i.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},i.execute=function(e,i){for(var s,n=function(e,i){var s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return(s=s.call(e)).next.bind(s);if(Array.isArray(e)||(s=function(e,i){if(e){if("string"==typeof e)return t(e,i);var s=Object.prototype.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?t(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){s&&(e=s);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.getForType(e));!(s=n()).done;){var r=s.value;try{i=r(i)}catch(e){}}return i},e}();e.exports=i},670(e){"use strict";var t=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,s=t.maxAttempts,n=t.delayFactor,r=t.fuzzFactor,a=t.initialDelay;return new i({maxAttempts:s||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:r||this.fuzzFactor_,initialDelay:a||this.initialDelay_})},e}(),i=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();e.exports=t},582(e,t){"use strict";function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var s=i({HTML:"text/html",isHTML:function(e){return e===s.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var s=0;s<e.length;s++)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];if(t.call(void 0,n,s,e))return n}},t.freeze=i,t.MIME_TYPE=s,t.NAMESPACE=n},752(e,t,i){var s=i(582),n=i(722),r=i(559),a=i(466),o=n.DOMImplementation,l=s.NAMESPACE,c=a.ParseError,u=a.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function h(e){this.options=e||{locator:{}}}function p(){this.cdata=!1}function m(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function g(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function f(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}h.prototype.parseFromString=function(e,t){var i=this.options,s=new u,n=i.domBuilder||new p,a=i.errorHandler,o=i.locator,c=i.xmlns||{},h=/\/x?html?$/.test(t),m=h?r.HTML_ENTITIES:r.XML_ENTITIES;o&&n.setDocumentLocator(o),s.errorHandler=function(e,t,i){if(!e){if(t instanceof p)return t;e=t}var s={},n=e instanceof Function;function r(t){var r=e[t];!r&&n&&(r=2==e.length?function(i){e(t,i)}:e),s[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+g(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),s}(a,n,o),s.domBuilder=i.domBuilder||n,h&&(c[""]=l.HTML),c.xml=c.xml||l.XML;var f=i.normalizeLineEndings||d;return e&&"string"==typeof e?s.parse(f(e),c,m):s.errorHandler.error("invalid doc source"),n.doc},p.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,s){var n=this.doc,r=n.createElementNS(e,i||t),a=s.length;y(this,r),this.currentElement=r,this.locator&&m(this.locator,r);for(var o=0;o<a;o++){e=s.getURI(o);var l=s.getValue(o),c=(i=s.getQName(o),n.createAttributeNS(e,i));this.locator&&m(s.getLocator(o),c),c.value=c.nodeValue=l,r.setAttributeNode(c)}},endElement:function(e,t,i){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&m(this.locator,i),y(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=f.apply(this,arguments)){if(this.cdata)var s=this.doc.createCDATASection(e);else s=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(e)&&this.doc.appendChild(s),this.locator&&m(this.locator,s)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=f.apply(this,arguments);var s=this.doc.createComment(e);this.locator&&m(this.locator,s),y(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(e,t,i);this.locator&&m(this.locator,n),y(this,n),this.doc.doctype=n}},warning:function(e){console.warn("[xmldom warning]\t"+e,g(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,g(this.locator))},fatalError:function(e){throw new c(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){p.prototype[e]=function(){return null}}),t.DOMParser=h},722(e,t,i){var s=i(582),n=s.find,r=s.NAMESPACE;function a(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(o,{}))}function c(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function u(e,t){var i=e.prototype;if(!(i instanceof t)){function s(){}s.prototype=t.prototype,c(i,s=new s),e.prototype=i=s}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var d={},h=d.ELEMENT_NODE=1,p=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,g=d.CDATA_SECTION_NODE=4,f=d.ENTITY_REFERENCE_NODE=5,y=d.ENTITY_NODE=6,_=d.PROCESSING_INSTRUCTION_NODE=7,v=d.COMMENT_NODE=8,b=d.DOCUMENT_NODE=9,T=d.DOCUMENT_TYPE_NODE=10,S=d.DOCUMENT_FRAGMENT_NODE=11,C=d.NOTATION_NODE=12,w={},k={},E=(w.INDEX_SIZE_ERR=(k[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(k[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(k[3]="Hierarchy request error",3)),x=(w.WRONG_DOCUMENT_ERR=(k[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(k[5]="Invalid character",5)),I=(w.NO_DATA_ALLOWED_ERR=(k[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(k[7]="No modification allowed",7),w.NOT_FOUND_ERR=(k[8]="Not found",8)),A=(w.NOT_SUPPORTED_ERR=(k[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(k[10]="Attribute in use",10)),P=w.INVALID_STATE_ERR=(k[11]="Invalid state",11);function D(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,k[e]),this.message=k[e],Error.captureStackTrace&&Error.captureStackTrace(this,D);return i.code=e,t&&(this.message=this.message+": "+t),i}function L(){}function M(e,t){this._node=e,this._refresh=t,N(this)}function N(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(Te(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var s=i.length;s in e;s++)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s];c(i,e),e._inc=t}}function O(){}function R(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function U(e,t,i,s){if(s?t[R(t,s)]=i:t[t.length++]=i,e){i.ownerElement=e;var n=e.ownerDocument;n&&(s&&V(n,e,s),function(e,t,i){e&&e._inc++,i.namespaceURI===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(n,e,i))}}function B(e,t,i){var s=R(t,i);if(!(s>=0))throw new D(I,new Error(e.tagName+"@"+i));for(var n=t.length-1;s<n;)t[s]=t[++s];if(t.length=n,e){var r=e.ownerDocument;r&&(V(r,e,i),i.ownerElement=null)}}function F(){}function j(){}function q(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function $(e,t){return H(e,null,{enter:function(e){return!t(e)||H.STOP}})===H.STOP}function H(e,t,i){for(var s=[{node:e,context:t,phase:H.ENTER}];s.length>0;){var n=s.pop();if(n.phase===H.ENTER){var r=i.enter(n.node,n.context);if(r===H.STOP)return H.STOP;if(s.push({node:n.node,context:r,phase:H.EXIT}),null==r)continue;for(var a=n.node.lastChild;a;)s.push({node:a,context:r,phase:H.ENTER}),a=a.previousSibling}else i.exit&&i.exit(n.node,n.context)}}function z(){this.ownerDocument=this}function V(e,t,i,s){e&&e._inc++,i.namespaceURI===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function W(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i)s[s.length++]=i;else{for(var n=t.firstChild,r=0;n;)s[r++]=n,n=n.nextSibling;s.length=r,delete s[s.length]}}}function G(e,t){var i=t.previousSibling,s=t.nextSibling;return i?i.nextSibling=s:e.firstChild=s,s?s.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,W(e.ownerDocument,e),t}function X(e){return e&&e.nodeType===j.DOCUMENT_TYPE_NODE}function K(e){return e&&e.nodeType===j.ELEMENT_NODE}function Y(e){return e&&e.nodeType===j.TEXT_NODE}function Q(e,t){var i=e.childNodes||[];if(n(i,K)||X(t))return!1;var s=n(i,X);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function Z(e,t){var i=e.childNodes||[];if(n(i,function(e){return K(e)&&e!==t}))return!1;var s=n(i,X);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function J(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===j.DOCUMENT_FRAGMENT_NODE){var a=r.filter(K);if(a.length>1||n(r,Y))throw new D(E,"More than one element or text in fragment");if(1===a.length&&!Q(e,i))throw new D(E,"Element in fragment can not be inserted before doctype")}if(K(t)&&!Q(e,i))throw new D(E,"Only one element can be added and only after doctype");if(X(t)){if(n(s,X))throw new D(E,"Only one doctype is allowed");var o=n(s,K);if(i&&s.indexOf(o)<s.indexOf(i))throw new D(E,"Doctype can only be inserted before an element");if(!i&&o)throw new D(E,"Doctype can not be appended since element is present")}}function ee(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===j.DOCUMENT_FRAGMENT_NODE){var a=r.filter(K);if(a.length>1||n(r,Y))throw new D(E,"More than one element or text in fragment");if(1===a.length&&!Z(e,i))throw new D(E,"Element in fragment can not be inserted before doctype")}if(K(t)&&!Z(e,i))throw new D(E,"Only one element can be added and only after doctype");if(X(t)){if(n(s,function(e){return X(e)&&e!==i}))throw new D(E,"Only one doctype is allowed");var o=n(s,K);if(i&&s.indexOf(o)<s.indexOf(i))throw new D(E,"Doctype can only be inserted before an element")}}function te(e,t,i,s){(function(e,t,i){if(!function(e){return e&&(e.nodeType===j.DOCUMENT_NODE||e.nodeType===j.DOCUMENT_FRAGMENT_NODE||e.nodeType===j.ELEMENT_NODE)}(e))throw new D(E,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new D(I,"child not in parent");if(!function(e){return e&&(K(e)||Y(e)||X(e)||e.nodeType===j.DOCUMENT_FRAGMENT_NODE||e.nodeType===j.COMMENT_NODE||e.nodeType===j.PROCESSING_INSTRUCTION_NODE)}(t)||X(t)&&e.nodeType!==j.DOCUMENT_NODE)throw new D(E,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,i),e.nodeType===j.DOCUMENT_NODE&&(s||J)(e,t,i);var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===S){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e,ie(r,e.ownerDocument||e)}while(r!==a&&(r=r.nextSibling));return W(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function ie(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===h&&e.attributes)for(var i=0;i<e.attributes.length;i++){var s=e.attributes.item(i);s&&(s.ownerDocument=t)}for(var n=e.firstChild;n;)ie(n,t),n=n.nextSibling}}function se(){this._nsMap={}}function ne(){}function re(){}function ae(){}function oe(){}function le(){}function ce(){}function ue(){}function de(){}function he(){}function pe(){}function me(){}function ge(){}function fe(e,t,i){var s=!!i&&!!i.requireWellFormed,n=[],r=9==this.nodeType&&this.documentElement||this,a=r.prefix,o=r.namespaceURI;if(o&&null==a&&null==(a=r.lookupPrefix(o)))var l=[{namespace:o,prefix:null}];return ve(this,n,e,t,l,s),n.join("")}function ye(e,t,i){var s=e.prefix||"",n=e.namespaceURI;if(!n)return!1;if("xml"===s&&n===r.XML||n===r.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===s)return o.namespace!==n}return!0}function _e(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,q),'"')}function ve(e,t,i,s,n,a){n||(n=[]),H(e,{ns:n,isHTML:i},{enter:function(e,i){var n=i.ns,o=i.isHTML;if(s){if(!(e=s(e)))return null;if("string"==typeof e)return t.push(e),null}switch(e.nodeType){case h:var l=e.attributes,c=l.length,u=e.tagName,d=u;if(!(o=r.isHTML(e.namespaceURI)||o)&&!e.prefix&&e.namespaceURI){for(var y,C=0;C<l.length;C++)if("xmlns"===l.item(C).name){y=l.item(C).value;break}if(!y)for(var w=n.length-1;w>=0;w--)if(""===(k=n[w]).prefix&&k.namespace===e.namespaceURI){y=k.namespace;break}if(y!==e.namespaceURI)for(w=n.length-1;w>=0;w--){var k;if((k=n[w]).namespace===e.namespaceURI){k.prefix&&(d=k.prefix+":"+u);break}}}t.push("<",d);for(var E=n.slice(),x=0;x<c;x++)"xmlns"==(I=l.item(x)).prefix?E.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&E.push({prefix:"",namespace:I.value});for(x=0;x<c;x++){var I;if(ye(I=l.item(x),0,E)){var A=I.prefix||"",L=I.namespaceURI;_e(t,A?"xmlns:"+A:"xmlns",L),E.push({prefix:A,namespace:L})}var M=s?s(I):I;M&&("string"==typeof M?t.push(M):_e(t,M.name,M.value))}if(u===d&&ye(e,0,E)){var N=e.prefix||"";L=e.namespaceURI,_e(t,N?"xmlns:"+N:"xmlns",L),E.push({prefix:N,namespace:L})}var O=e.firstChild;if(O||o&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),o&&/^script$/i.test(u)){for(;O;)O.data?t.push(O.data):ve(O,t,o,s,E.slice(),a),O=O.nextSibling;return t.push("</",u,">"),null}return{ns:E,isHTML:o,tag:d}}return t.push("/>"),null;case b:case S:return{ns:n.slice(),isHTML:o,tag:null};case p:return _e(t,e.name,e.value),null;case m:return t.push(e.data.replace(/[<&>]/g,q)),null;case g:if(a&&-1!==e.data.indexOf("]]>"))throw new D(P,'The CDATASection data contains "]]>"');
vendor: 4,543 bytes, line 2
2return t.push("<![CDATA[",e.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case v:if(a&&-1!==e.data.indexOf("--\x3e"))throw new D(P,'The comment node data contains "--\x3e"');return t.push("\x3c!--",e.data,"--\x3e"),null;case T:if(a){if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new D(P,"DocumentType publicId is not a valid PubidLiteral");if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new D(P,"DocumentType systemId is not a valid SystemLiteral");if(e.internalSubset&&-1!==e.internalSubset.indexOf("]>"))throw new D(P,'DocumentType internalSubset contains "]>"')}var R=e.publicId,U=e.systemId;if(t.push("<!DOCTYPE ",e.name),R)t.push(" PUBLIC ",R),U&&"."!=U&&t.push(" ",U),t.push(">");else if(U&&"."!=U)t.push(" SYSTEM ",U,">");else{var B=e.internalSubset;B&&t.push(" [",B,"]"),t.push(">")}return null;case _:if(a&&-1!==e.data.indexOf("?>"))throw new D(P,'The ProcessingInstruction data contains "?>"');return t.push("<?",e.target," ",e.data,"?>"),null;case f:return t.push("&",e.nodeName,";"),null;default:return t.push("??",e.nodeName),null}},exit:function(e,i){i&&i.tag&&t.push("</",i.tag,">")}})}function be(e,t,i){var s;return H(t,null,{enter:function(t,n){var r=new t.constructor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=t[a];"object"!=typeof o&&o!=r[a]&&(r[a]=o)}t.childNodes&&(r.childNodes=new L),r.ownerDocument=e;var l=i;switch(r.nodeType){case h:var c=t.attributes,u=r.attributes=new O,d=c.length;u._ownerElement=r;for(var m=0;m<d;m++)r.setAttributeNode(be(e,c.item(m),!0));break;case p:l=!0}return null!==n?n.appendChild(r):s=r,l?r:null}}),s}function Te(e,t,i){e[t]=i}w.SYNTAX_ERR=(k[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(k[13]="Invalid modification",13),w.NAMESPACE_ERR=(k[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(k[15]="Invalid access",15),D.prototype=Error.prototype,c(w,D),L.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,i){for(var s=!!i&&!!i.requireWellFormed,n=[],r=0;r<this.length;r++)ve(this[r],n,e,t,null,s);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},M.prototype.item=function(e){return N(this),this[e]||null},u(M,L),O.prototype={length:0,item:L.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new D(A);var i=this.getNamedItem(e.nodeName);return U(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new D(A);return t=this.getNamedItemNS(e.namespaceURI,e.localName),U(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return B(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return B(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var s=this[i];if(s.localName==t&&s.namespaceURI==e)return s}return null}},F.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var s=new z;if(s.implementation=this,s.childNodes=new L,s.doctype=i||null,i&&s.appendChild(i),t){var n=s.createElementNS(e,t);s.appendChild(n)}return s},createDocumentType:function(e,t,i){var s=new ce;return s.name=e,s.nodeName=e,s.publicId=t||"",s.systemId=i||"",s}},j.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return te(this,e,t)},replaceChild:function(e,t){te(this,e,t,ee),t&&this.removeChild(t)},removeChild:function(e){return G(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return be(this.ownerDocument||this,this,e)},normalize:function(){H(this,null,{enter:function(e){for(var t=e.firstChild;t;){var i=t.nextSibling;null!==i&&i.nodeType===m&&t.nodeType===m?(e.removeChild(i),t.appendData(i.data)):t=i}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e)return s;
vendor: 6,989 bytes, line 2
2t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},c(d,j),c(d,j.prototype),H.STOP=Symbol("walkDOM.STOP"),H.ENTER=0,H.EXIT=1,z.prototype={nodeName:"#document",nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var i=e.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,t),i=s}return e}return te(this,e,t),ie(e,this),null===this.documentElement&&e.nodeType===h&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},replaceChild:function(e,t){te(this,e,t,ee),ie(e,this),t&&this.removeChild(t),K(e)&&(this.documentElement=e)},importNode:function(e,t){return function(e,t,i){var s;return H(t,null,{enter:function(t,n){var r=t.cloneNode(!1);return r.ownerDocument=e,r.parentNode=null,null===n?s=r:n.appendChild(r),t.nodeType===p||i?r:null}}),s}(this,e,t)},getElementById:function(e){var t=null;return $(this.documentElement,function(i){if(i.nodeType==h&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=l(e);return new M(this,function(i){var s=[];return t.length>0&&$(i.documentElement,function(n){if(n!==i&&n.nodeType===h){var r=n.getAttribute("class");if(r){var a=e===r;if(!a){var o=l(r);a=t.every((c=o,function(e){return c&&-1!==c.indexOf(e)}))}a&&s.push(n)}}var c}),s})},createElement:function(e){var t=new se;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new L,(t.attributes=new O)._ownerElement=t,t},createDocumentFragment:function(){var e=new pe;return e.ownerDocument=this,e.childNodes=new L,e},createTextNode:function(e){var t=new ae;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new oe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(-1!==e.indexOf("]]>"))throw new D(x,'data contains "]]>"');var t=new le;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new me;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ne;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new he;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new se,s=t.split(":"),n=i.attributes=new O;return i.childNodes=new L,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,n._ownerElement=i,i},createAttributeNS:function(e,t){var i=new ne,s=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,i}},u(z,j),se.prototype={nodeType:h,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,W(e.ownerDocument,e,t),ie(t,e.ownerDocument||e),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var s=this.ownerDocument.createAttributeNS(e,t);s.value=s.nodeValue=""+i,this.setAttributeNode(s)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new M(this,function(t){var i=[];return $(t,function(s){s===t||s.nodeType!=h||"*"!==e&&s.tagName!=e||i.push(s)}),i})},getElementsByTagNameNS:function(e,t){return new M(this,function(i){var s=[];return $(i,function(n){n===i||n.nodeType!==h||"*"!==e&&n.namespaceURI!==e||"*"!==t&&n.localName!=t||s.push(n)}),s})}},z.prototype.getElementsByTagName=se.prototype.getElementsByTagName,z.prototype.getElementsByTagNameNS=se.prototype.getElementsByTagNameNS,u(se,j),ne.prototype.nodeType=p,u(ne,j),re.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(k[E])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},u(re,j),ae.prototype={nodeName:"#text",nodeType:m,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var s=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}},u(ae,re),oe.prototype={nodeName:"#comment",nodeType:v},u(oe,re),le.prototype={nodeName:"#cdata-section",nodeType:g},u(le,re),ce.prototype.nodeType=T,u(ce,j),ue.prototype.nodeType=C,u(ue,j),de.prototype.nodeType=y,u(de,j),he.prototype.nodeType=f,u(he,j),pe.prototype.nodeName="#document-fragment",pe.prototype.nodeType=S,u(pe,j),me.prototype.nodeType=_,u(me,j),ge.prototype.serializeToString=function(e,t,i,s){return fe.call(e,t,i,s)},j.prototype.toString=fe;try{Object.defineProperty&&(Object.defineProperty(M.prototype,"length",{get:function(){return N(this),this.$$length}}),Object.defineProperty(j.prototype,"textContent",{get:function(){if(this.nodeType===h||this.nodeType===S){var e=[];return H(this,null,{enter:function(t){return t.nodeType===h||t.nodeType===S||(t.nodeType===_||t.nodeType===v?null:void e.push(t.nodeValue))}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case h:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Te=function(e,t,i){e["$$"+t]=i})}catch(e){}t.DocumentType=ce,t.DOMException=D,t.DOMImplementation=F,t.Element=se,t.Node=j,t.NodeList=L,t.walkDOM=
2H,t.XMLSerializer=ge},559(e,t,i){"use strict";var s=i(582).freeze;t.XML_ENTITIES=s({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=s
vendor: 28,727 bytes, line 2
2({Aacute:"Ã",aacute:"á",Abreve:"Ä",abreve:"Ä",ac:"â¾",acd:"â¿",acE:"â¾Ì³",Acirc:"Ã",acirc:"â",acute:"´",Acy:"Ð",acy:"а",AElig:"Ã",aelig:"æ",af:"â¡",Afr:"ð",afr:"ð",Agrave:"Ã",agrave:"à ",alefsym:"âµ",aleph:"âµ",Alpha:"Î",alpha:"α",Amacr:"Ä",amacr:"Ä",amalg:"⨿",AMP:"&",amp:"&",And:"â©",and:"â§",andand:"â©",andd:"â©",andslope:"â©",andv:"â©",ang:"â ",ange:"⦤",angle:"â ",angmsd:"â¡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"â¦",angmsdag:"⦮",angmsdah:"⦯",angrt:"â",angrtvb:"â¾",angrtvbd:"â¦",angsph:"â¢",angst:"Ã
",angzarr:"â¼",Aogon:"Ä",aogon:"Ä
",Aopf:"ð¸",aopf:"ð",ap:"â",apacir:"⩯",apE:"â©°",ape:"â",apid:"â",apos:"'",ApplyFunction:"â¡",approx:"â",approxeq:"â",Aring:"Ã
",aring:"Ã¥",Ascr:"ð",ascr:"ð¶",Assign:"â",ast:"*",asymp:"â",asympeq:"â",Atilde:"Ã",atilde:"ã",Auml:"Ã",auml:"ä",awconint:"â³",awint:"â¨",backcong:"â",backepsilon:"϶",backprime:"âµ",backsim:"â½",backsimeq:"â",Backslash:"â",Barv:"â«§",barvee:"â½",Barwed:"â",barwed:"â
",barwedge:"â
",bbrk:"âµ",bbrktbrk:"â¶",bcong:"â",Bcy:"Ð",bcy:"б",bdquo:"â",becaus:"âµ",Because:"âµ",because:"âµ",bemptyv:"⦰",bepsi:"϶",bernou:"â¬",Bernoullis:"â¬",Beta:"Î",beta:"β",beth:"â¶",between:"â¬",Bfr:"ð
",bfr:"ð",bigcap:"â",bigcirc:"â¯",bigcup:"â",bigodot:"â¨",bigoplus:"â¨",bigotimes:"â¨",bigsqcup:"â¨",bigstar:"â
",bigtriangledown:"â½",bigtriangleup:"â³",biguplus:"â¨",bigvee:"â",bigwedge:"â",bkarow:"â¤",blacklozenge:"â§«",blacksquare:"âª",blacktriangle:"â´",blacktriangledown:"â¾",blacktriangleleft:"â",blacktriangleright:"â¸",blank:"â£",blk12:"â",blk14:"â",blk34:"â",block:"â",bne:"=â¥",bnequiv:"â¡â¥",bNot:"â«",bnot:"â",Bopf:"ð¹",bopf:"ð",bot:"â¥",bottom:"â¥",bowtie:"â",boxbox:"â§",boxDL:"â",boxDl:"â",boxdL:"â",boxdl:"â",boxDR:"â",boxDr:"â",boxdR:"â",boxdr:"â",boxH:"â",boxh:"â",boxHD:"â¦",boxHd:"â¤",boxhD:"â¥",boxhd:"â¬",boxHU:"â©",boxHu:"â§",boxhU:"â¨",boxhu:"â´",boxminus:"â",boxplus:"â",boxtimes:"â ",boxUL:"â",boxUl:"â",boxuL:"â",boxul:"â",boxUR:"â",boxUr:"â",boxuR:"â",boxur:"â",boxV:"â",boxv:"â",boxVH:"â¬",boxVh:"â«",boxvH:"âª",boxvh:"â¼",boxVL:"â£",boxVl:"â¢",boxvL:"â¡",boxvl:"â¤",boxVR:"â ",boxVr:"â",boxvR:"â",boxvr:"â",bprime:"âµ",Breve:"Ë",breve:"Ë",brvbar:"¦",Bscr:"â¬",bscr:"ð·",bsemi:"â",bsim:"â½",bsime:"â",bsol:"\\",bsolb:"â§
",bsolhsub:"â",bull:"â¢",bullet:"â¢",bump:"â",bumpE:"⪮",bumpe:"â",Bumpeq:"â",bumpeq:"â",Cacute:"Ä",cacute:"Ä",Cap:"â",cap:"â©",capand:"â©",capbrcup:"â©",capcap:"â©",capcup:"â©",capdot:"â©",CapitalDifferentialD:"â
",caps:"â©ï¸",caret:"â",caron:"Ë",Cayleys:"â",ccaps:"â©",Ccaron:"Ä",ccaron:"Ä",Ccedil:"Ã",ccedil:"ç",Ccirc:"Ä",ccirc:"Ä",Cconint:"â°",ccups:"â©",ccupssm:"â©",Cdot:"Ä",cdot:"Ä",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"â",cfr:"ð ",CHcy:"Ч",chcy:"Ñ",check:"â",checkmark:"â",Chi:"Χ",chi:"Ï",cir:"â",circ:"Ë",circeq:"â",circlearrowleft:"âº",circlearrowright:"â»",circledast:"â",circledcirc:"â",circleddash:"â",CircleDot:"â",circledR:"®",circledS:"â",CircleMinus:"â",CirclePlus:"â",CircleTimes:"â",cirE:"â§",cire:"â",cirfnint:"â¨",cirmid:"⫯",cirscir:"â§",ClockwiseContourIntegral:"â²",CloseCurlyDoubleQuote:"â",CloseCurlyQuote:"â",clubs:"â£",clubsuit:"â£",Colon:"â·",colon:":",Colone:"â©´",colone:"â",coloneq:"â",comma:",",commat:"@",comp:"â",compfn:"â",complement:"â",complexes:"â",cong:"â
",congdot:"â©",Congruent:"â¡",Conint:"â¯",conint:"â®",ContourIntegral:"â®",Copf:"â",copf:"ð",coprod:"â",Coproduct:"â",COPY:"©",copy:"©",copysr:"â",CounterClockwiseContourIntegral:"â³",crarr:"âµ",Cross:"⨯",cross:"â",Cscr:"ð",cscr:"ð¸",csub:"â«",csube:"â«",csup:"â«",csupe:"â«",ctdot:"â¯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"â",cuesc:"â",cularr:"â¶",cularrp:"⤽",Cup:"â",cup:"âª",cupbrcap:"â©",CupCap:"â",cupcap:"â©",cupcup:"â©",cupdot:"â",cupor:"â©
",cups:"âªï¸",curarr:"â·",curarrm:"⤼",curlyeqprec:"â",curlyeqsucc:"â",curlyvee:"â",curlywedge:"â",curren:"¤",curvearrowleft:"â¶",curvearrowright:"â·",cuvee:"â",cuwed:"â",cwconint:"â²",cwint:"â±",cylcty:"â",Dagger:"â¡",dagger:"â ",daleth:"â¸",Darr:"â¡",dArr:"â",darr:"â",dash:"â",Dashv:"⫤",dashv:"â£",dbkarow:"â¤",dblac:"Ë",Dcaron:"Ä",dcaron:"Ä",Dcy:"Ð",dcy:"д",DD:"â
",dd:"â
",ddagger:"â¡",ddarr:"â",DDotrahd:"â¤",ddotseq:"â©·",deg:"°",Del:"â",Delta:"Î",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"ð",dfr:"ð¡",dHar:"⥥",dharl:"â",dharr:"â",DiacriticalAcute:"´",DiacriticalDot:"Ë",DiacriticalDoubleAcute:"Ë",DiacriticalGrave:"`",DiacriticalTilde:"Ë",diam:"â",Diamond:"â",diamond:"â",diamondsuit:"â¦",diams:"â¦",die:"¨",DifferentialD:"â
",digamma:"Ï",disin:"â²",div:"÷",divide:"÷",divideontimes:"â",divonx:"â",DJcy:"Ð",djcy:"Ñ",dlcorn:"â",dlcrop:"â",dollar:"$",Dopf:"ð»",dopf:"ð",Dot:"¨",dot:"Ë",DotDot:"â",doteq:"â",doteqdot:"â",DotEqual:"â",dotminus:"â¸",dotplus:"â",dotsquare:"â¡",doublebarwedge:"â",DoubleContourIntegral:"â¯",DoubleDot:"¨",DoubleDownArrow:"â",DoubleLeftArrow:"â",DoubleLeftRightArrow:"â",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"â¸",DoubleLongLeftRightArrow:"âº",DoubleLongRightArrow:"â¹",DoubleRightArrow:"â",DoubleRightTee:"â¨",DoubleUpArrow:"â",DoubleUpDownArrow:"â",DoubleVerticalBar:"â¥",DownArrow:"â",Downarrow:"â",downarrow:"â",DownArrowBar:"â¤",DownArrowUpArrow:"âµ",DownBreve:"Ì",downdownarrows:"â",downharpoonleft:"â",downharpoonright:"â",DownLeftRightVector:"â¥",DownLeftTeeVector:"â¥",DownLeftVector:"â½",DownLeftVectorBar:"â¥",DownRightTeeVector:"â¥",DownRightVector:"â",DownRightVectorBar:"â¥",DownTee:"â¤",DownTeeArrow:"â§",drbkarow:"â¤",drcorn:"â",drcrop:"â",Dscr:"ð",dscr:"ð¹",DScy:"Ð
",dscy:"Ñ",dsol:"â§¶",Dstrok:"Ä",dstrok:"Ä",dtdot:"â±",dtri:"â¿",dtrif:"â¾",duarr:"âµ",duhar:"⥯",dwangle:"⦦",DZcy:"Ð",dzcy:"Ñ",dzigrarr:"â¿",Eacute:"Ã",eacute:"é",easter:"â©®",Ecaron:"Ä",ecaron:"Ä",ecir:"â",Ecirc:"Ã",ecirc:"ê",ecolon:"â",Ecy:"Ð",ecy:"Ñ",eDDot:"â©·",Edot:"Ä",eDot:"â",edot:"Ä",ee:"â
",efDot:"â",Efr:"ð",efr:"ð¢",eg:"âª",Egrave:"Ã",egrave:"è",egs:"âª",egsdot:"âª",el:"âª",Element:"â",elinters:"â§",ell:"â",els:"âª",elsdot:"âª",Emacr:"Ä",emacr:"Ä",empty:"â
",emptyset:"â
",EmptySmallSquare:"â»",emptyv:"â
",EmptyVerySmallSquare:"â«",emsp:"â",emsp13:"â",emsp14:"â
",ENG:"Å",eng:"Å",ensp:"â",Eogon:"Ä",eogon:"Ä",Eopf:"ð¼",eopf:"ð",epar:"â",eparsl:"â§£",eplus:"⩱",epsi:"ε",Epsilon:"Î",epsilon:"ε",epsiv:"ϵ",eqcirc:"â",eqcolon:"â",eqsim:"â",eqslantgtr:"âª",eqslantless:"âª",Equal:"⩵",equals:"=",EqualTilde:"â",equest:"â",Equilibrium:"â",equiv:"â¡",equivDD:"⩸",eqvparsl:"â§¥",erarr:"⥱",erDot:"â",Escr:"â°",escr:"â¯",esdot:"â",Esim:"⩳",esim:"â",Eta:"Î",eta:"η",ETH:"Ã",eth:"ð",Euml:"Ã",euml:"ë",euro:"â¬",excl:"!",exist:"â",Exists:"â",expectation:"â°",ExponentialE:"â
",exponentiale:"â
",fallingdotseq:"â",Fcy:"Ф",fcy:"Ñ",female:"â",ffilig:"ï¬",fflig:"ï¬",ffllig:"ï¬",Ffr:"ð",ffr:"ð£",filig:"ï¬",FilledSmallSquare:"â¼",FilledVerySmallSquare:"âª",fjlig:"fj",flat:"â",fllig:"ï¬",fltns:"â±",fnof:"Æ",Fopf:"ð½",fopf:"ð",ForAll:"â",forall:"â",fork:"â",forkv:"â«",Fouriertrf:"â±",fpartint:"â¨",frac12:"½",frac13:"â
",frac14:"¼",frac15:"â
",frac16:"â
",frac18:"â
",frac23:"â
",frac25:"â
",frac34:"¾",frac35:"â
",frac38:"â
",frac45:"â
",frac56:"â
",frac58:"â
",frac78:"â
",frasl:"â",frown:"â¢",Fscr:"â±",fscr:"ð»",gacute:"ǵ",Gamma:"Î",gamma:"γ",Gammad:"Ï",gammad:"Ï",gap:"âª",Gbreve:"Ä",gbreve:"Ä",Gcedil:"Ä¢",Gcirc:"Ä",gcirc:"Ä",Gcy:"Ð",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",gE:"â§",ge:"â¥",gEl:"âª",gel:"â",geq:"â¥",geqq:"â§",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"âª",gesdoto:"âª",gesdotol:"âª",gesl:"âï¸",gesles:"âª",Gfr:"ð",gfr:"ð¤",Gg:"â",gg:"â«",ggg:"â",gimel:"â·",GJcy:"Ð",gjcy:"Ñ",gl:"â·",gla:"⪥",glE:"âª",glj:"⪤",gnap:"âª",gnapprox:"âª",gnE:"â©",gne:"âª",gneq:"âª",gneqq:"â©",gnsim:"â§",Gopf:"ð¾",gopf:"ð",grave:"`",GreaterEqual:"â¥",GreaterEqualLess:"â",GreaterFullEqual:"â§",GreaterGreater:"⪢",GreaterLess:"â·",GreaterSlantEqual:"⩾",GreaterTilde:"â³",Gscr:"ð¢",gscr:"â",gsim:"â³",gsime:"âª",gsiml:"âª",Gt:"â«",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"â",gtlPar:"â¦",gtquest:"⩼",gtrapprox:"âª",gtrarr:"⥸",gtrdot:"â",gtreqless:"â",gtreqqless:"âª",gtrless:"â·",gtrsim:"â³",gvertneqq:"â©ï¸",gvnE:"â©ï¸",Hacek:"Ë",hairsp:"â",half:"½",hamilt:"â",HARDcy:"Ъ",hardcy:"Ñ",hArr:"â",harr:"â",harrcir:"â¥",harrw:"â",Hat:"^",hbar:"â",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"â¥",heartsuit:"â¥",hellip:"â¦",hercon:"â¹",Hfr:"â",hfr:"ð¥",HilbertSpace:"â",hksearow:"⤥",hkswarow:"⤦",hoarr:"â¿",homtht:"â»",hookleftarrow:"â©",hookrightarrow:"âª",Hopf:"â",hopf:"ð",horbar:"â",HorizontalLine:"â",Hscr:"â",hscr:"ð½",hslash:"â",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"â",HumpEqual:"â",hybull:"â",hyphen:"â",Iacute:"Ã",iacute:"Ã",ic:"â£",Icirc:"Ã",icirc:"î",Icy:"Ð",icy:"и",Idot:"İ",IEcy:"Ð",iecy:"е",iexcl:"¡",iff:"â",Ifr:"â",ifr:"ð¦",Igrave:"Ã",igrave:"ì",ii:"â
",iiiint:"â¨",iiint:"â",iinfin:"â§",iiota:"â©",IJlig:"IJ",ijlig:"ij",Im:"â",Imacr:"Ī",imacr:"Ä«",image:"â",ImaginaryI:"â
",imagline:"â",imagpart:"â",imath:"ı",imof:"â·",imped:"Ƶ",Implies:"â",in:"â",incare:"â
",infin:"â",infintie:"â§",inodot:"ı",Int:"â¬",int:"â«",intcal:"âº",integers:"â¤",Integral:"â«",intercal:"âº",Intersection:"â",intlarhk:"â¨",intprod:"⨼",InvisibleComma:"â£",InvisibleTimes:"â¢",IOcy:"Ð",iocy:"Ñ",Iogon:"Ä®",iogon:"į",Iopf:"ð",iopf:"ð",Iota:"Î",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"â",iscr:"ð¾",isin:"â",isindot:"âµ",isinE:"â¹",isins:"â´",isinsv:"â³",isinv:"â",it:"â¢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"Ð",iukcy:"Ñ",Iuml:"Ã",iuml:"ï",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Ð",jcy:"й",Jfr:"ð",jfr:"ð§",jmath:"È·",Jopf:"ð",jopf:"ð",Jscr:"ð¥",jscr:"ð¿",Jsercy:"Ð",jsercy:"Ñ",Jukcy:"Ð",jukcy:"Ñ",Kappa:"Î",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"Ð",kcy:"к",Kfr:"ð",kfr:"ð¨",kgreen:"ĸ",KHcy:"Ð¥",khcy:"Ñ
",KJcy:"Ð",kjcy:"Ñ",Kopf:"ð",kopf:"ð",Kscr:"ð¦",kscr:"ð",lAarr:"â",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"â",Lambda:"Î",lambda:"λ",Lang:"âª",lang:"â¨",langd:"â¦",langle:"â¨",lap:"âª
",Laplacetrf:"â",laquo:"«",Larr:"â",lArr:"â",larr:"â",larrb:"â¤",larrbfs:"â¤",larrfs:"â¤",larrhk:"â©",larrlp:"â«",larrpl:"⤹",larrsim:"⥳",larrtl:"â¢",lat:"⪫",lAtail:"â¤",latail:"â¤",late:"âª",lates:"âªï¸",lBarr:"â¤",lbarr:"â¤",lbbrk:"â²",lbrace:"{",lbrack:"[",lbrke:"â¦",lbrksld:"â¦",lbrkslu:"â¦",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"â",lcub:"{",Lcy:"Ð",lcy:"л",ldca:"⤶",ldquo:"â",ldquor:"â",ldrdhar:"⥧",ldrushar:"â¥",ldsh:"â²",lE:"â¦",le:"â¤",LeftAngleBracket:"â¨",LeftArrow:"â",Leftarrow:"â",leftarrow:"â",LeftArrowBar:"â¤",LeftArrowRightArrow:"â",leftarrowtail:"â¢",LeftCeiling:"â",LeftDoubleBracket:"â¦",LeftDownTeeVector:"⥡",LeftDownVector:"â",LeftDownVectorBar:"â¥",LeftFloor:"â",leftharpoondown:"â½",leftharpoonup:"â¼",leftleftarrows:"â",LeftRightArrow:"â",Leftrightarrow:"â",leftrightarrow:"â",leftrightarrows:"â",leftrightharpoons:"â",leftrightsquigarrow:"â",LeftRightVector:"â¥",LeftTee:"â£",LeftTeeArrow:"â¤",LeftTeeVector:"â¥",leftthreetimes:"â",LeftTriangle:"â²",LeftTriangleBar:"â§",LeftTriangleEqual:"â´",LeftUpDownVector:"â¥",LeftUpTeeVector:"⥠",LeftUpVector:"â¿",LeftUpVectorBar:"â¥",LeftVector:"â¼",LeftVectorBar:"â¥",lEg:"âª",leg:"â",leq:"â¤",leqq:"â¦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"â©¿",lesdoto:"âª",lesdotor:"âª",lesg:"âï¸",lesges:"âª",lessapprox:"âª
",lessdot:"â",lesseqgtr:"â",lesseqqgtr:"âª",LessEqualGreater:"â",LessFullEqual:"â¦",LessGreater:"â¶",lessgtr:"â¶",LessLess:"⪡",lesssim:"â²",LessSlantEqual:"⩽",LessTilde:"â²",lfisht:"⥼",lfloor:"â",Lfr:"ð",lfr:"ð©",lg:"â¶",lgE:"âª",lHar:"⥢",lhard:"â½",lharu:"â¼",lharul:"⥪",lhblk:"â",LJcy:"Ð",ljcy:"Ñ",Ll:"â",ll:"âª",llarr:"â",llcorner:"â",Lleftarrow:"â",llhard:"⥫",lltri:"âº",Lmidot:"Ä¿",lmidot:"Å",lmoust:"â°",lmoustache:"â°",lnap:"âª",lnapprox:"âª",lnE:"â¨",lne:"âª",lneq:"âª",lneqq:"â¨",lnsim:"â¦",loang:"â¬",loarr:"â½",lobrk:"â¦",LongLeftArrow:"âµ",Longleftarrow:"â¸",longleftarrow:"âµ",LongLeftRightArrow:"â·",Longleftrightarrow:"âº",longleftrightarrow:"â·",longmapsto:"â¼",LongRightArrow:"â¶",Longrightarrow:"â¹",longrightarrow:"â¶",looparrowleft:"â«",looparrowright:"â¬",lopar:"â¦
",Lopf:"ð",lopf:"ð",loplus:"â¨",lotimes:"⨴",lowast:"â",lowbar:"_",LowerLeftArrow:"â",LowerRightArrow:"â",loz:"â",lozenge:"â",lozf:"â§«",lpar:"(",lparlt:"â¦",lrarr:"â",lrcorner:"â",lrhar:"â",lrhard:"â¥",lrm:"â",lrtri:"â¿",lsaquo:"â¹",Lscr:"â",lscr:"ð",Lsh:"â°",lsh:"â°",lsim:"â²",lsime:"âª",lsimg:"âª",lsqb:"[",lsquo:"â",lsquor:"â",Lstrok:"Å",lstrok:"Å",Lt:"âª",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"â",lthree:"â",ltimes:"â",ltlarr:"⥶",ltquest:"â©»",ltri:"â",ltrie:"â´",ltrif:"â",ltrPar:"â¦",lurdshar:"â¥",luruhar:"⥦",lvertneqq:"â¨ï¸",lvnE:"â¨ï¸",macr:"¯",male:"â",malt:"â ",maltese:"â ",Map:"â¤
",map:"â¦",mapsto:"â¦",mapstodown:"â§",mapstoleft:"â¤",mapstoup:"â¥",marker:"â®",mcomma:"⨩",Mcy:"Ð",mcy:"м",mdash:"â",mDDot:"âº",measuredangle:"â¡",MediumSpace:"â",Mellintrf:"â³",Mfr:"ð",mfr:"ðª",mho:"â§",micro:"µ",mid:"â£",midast:"*",midcir:"â«°",middot:"·",minus:"â",minusb:"â",minusd:"â¸",minusdu:"⨪",MinusPlus:"â",mlcp:"â«",mldr:"â¦",mnplus:"â",models:"â§",Mopf:"ð",mopf:"ð",mp:"â",Mscr:"â³",mscr:"ð",mstpos:"â¾",Mu:"Î",mu:"μ",multimap:"â¸",mumap:"â¸",nabla:"â",Nacute:"Å",nacute:"Å",nang:"â â",nap:"â",napE:"⩰̸",napid:"â̸",napos:"Å",napprox:"â",natur:"â®",natural:"â®",naturals:"â",nbsp:" ",nbump:"â̸",nbumpe:"â̸",ncap:"â©",Ncaron:"Å",ncaron:"Å",Ncedil:"Å
",ncedil:"Å",ncong:"â",ncongdot:"â©Ì¸",ncup:"â©",Ncy:"Ð",ncy:"н",ndash:"â",ne:"â ",nearhk:"⤤",neArr:"â",nearr:"â",nearrow:"â",nedot:"â̸",NegativeMediumSpace:"â",NegativeThickSpace:"â",NegativeThinSpace:"â",NegativeVeryThinSpace:"â",nequiv:"â¢",nesear:"⤨",nesim:"â̸",NestedGreaterGreater:"â«",NestedLessLess:"âª",NewLine:"\n",nexist:"â",nexists:"â",Nfr:"ð",nfr:"ð«",ngE:"â§Ì¸",nge:"â±",ngeq:"â±",ngeqq:"â§Ì¸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"â̸",ngsim:"âµ",nGt:"â«â",ngt:"â¯",ngtr:"â¯",nGtv:"â«Ì¸",nhArr:"â",nharr:"â®",nhpar:"⫲",ni:"â",nis:"â¼",nisd:"âº",niv:"â",NJcy:"Ð",njcy:"Ñ",nlArr:"â",nlarr:"â",nldr:"â¥",nlE:"â¦Ì¸",nle:"â°",nLeftarrow:"â",nleftarrow:"â",nLeftrightarrow:"â",nleftrightarrow:"â®",nleq:"â°",nleqq:"â¦Ì¸",nleqslant:"⩽̸",nles:"⩽̸",nless:"â®",nLl:"â̸",nlsim:"â´",nLt:"âªâ",nlt:"â®",nltri:"âª",nltrie:"â¬",nLtv:"âªÌ¸",nmid:"â¤",NoBreak:"â ",NonBreakingSpace:" ",Nopf:"â",nopf:"ð",Not:"⫬",not:"¬",NotCongruent:"â¢",NotCupCap:"â",NotDoubleVerticalBar:"â¦",NotElement:"â",NotEqual:"â ",NotEqualTilde:"â̸",NotExists:"â",NotGreater:"â¯",NotGreaterEqual:"â±",NotGreaterFullEqual:"â§Ì¸",NotGreaterGreater:"â«Ì¸",NotGreaterLess:"â¹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"âµ",NotHumpDownHump:"â̸",NotHumpEqual:"â̸",notin:"â",notindot:"âµÌ¸",notinE:"â¹Ì¸",notinva:"â",notinvb:"â·",notinvc:"â¶",NotLeftTriangle:"âª",NotLeftTriangleBar:"â§Ì¸",NotLeftTriangleEqual:"â¬",NotLess:"â®",NotLessEqual:"â°",NotLessGreater:"â¸",NotLessLess:"âªÌ¸",NotLessSlantEqual:"⩽̸",NotLessTilde:"â´",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"â",notniva:"â",notnivb:"â¾",notnivc:"â½",NotPrecedes:"â",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"â ",NotReverseElement:"â",NotRightTriangle:"â«",NotRightTriangleBar:"â§Ì¸",NotRightTriangleEqual:"â",NotSquareSubset:"â̸",NotSquareSubsetEqual:"â¢",NotSquareSuperset:"â̸",NotSquareSupersetEqual:"â£",NotSubset:"ââ",NotSubsetEqual:"â",NotSucceeds:"â",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"â¡",NotSucceedsTilde:"â¿Ì¸",NotSuperset:"ââ",NotSupersetEqual:"â",NotTilde:"â",NotTildeEqual:"â",NotTildeFullEqual:"â",NotTildeTilde:"â",NotVerticalBar:"â¤",npar:"â¦",nparallel:"â¦",nparsl:"⫽â¥",npart:"â̸",npolint:"â¨",npr:"â",nprcue:"â ",npre:"⪯̸",nprec:"â",npreceq:"⪯̸",nrArr:"â",nrarr:"â",nrarrc:"⤳̸",nrarrw:"â̸",nRightarrow:"â",nrightarrow:"â",nrtri:"â«",nrtrie:"â",nsc:"â",nsccue:"â¡",nsce:"⪰̸",Nscr:"ð©",nscr:"ð",nshortmid:"â¤",nshortparallel:"â¦",nsim:"â",nsime:"â",nsimeq:"â",nsmid:"â¤",nspar:"â¦",nsqsube:"â¢",nsqsupe:"â£",nsub:"â",nsubE:"â«
̸",nsube:"â",nsubset:"ââ",nsubseteq:"â",nsubseteqq:"â«
̸",nsucc:"â",nsucceq:"⪰̸",nsup:"â
",nsupE:"â«Ì¸",nsupe:"â",nsupset:"ââ",nsupseteq:"â",nsupseteqq:"â«Ì¸",ntgl:"â¹",Ntilde:"Ã",ntilde:"ñ",ntlg:"â¸",ntriangleleft:"âª",ntrianglelefteq:"â¬",ntriangleright:"â«",ntrianglerighteq:"â",Nu:"Î",nu:"ν",num:"#",numero:"â",numsp:"â",nvap:"ââ",nVDash:"â¯",nVdash:"â®",nvDash:"â",nvdash:"â¬",nvge:"â¥â",nvgt:">â",nvHarr:"â¤",nvinfin:"â§",nvlArr:"â¤",nvle:"â¤â",nvlt:"<â",nvltrie:"â´â",nvrArr:"â¤",nvrtrie:"âµâ",nvsim:"â¼â",nwarhk:"⤣",nwArr:"â",nwarr:"â",nwarrow:"â",nwnear:"⤧",Oacute:"Ã",oacute:"ó",oast:"â",ocir:"â",Ocirc:"Ã",ocirc:"ô",Ocy:"Ð",ocy:"о",odash:"â",Odblac:"Å",odblac:"Å",odiv:"⨸",odot:"â",odsold:"⦼",OElig:"Å",oelig:"Å",ofcir:"⦿",Ofr:"ð",ofr:"ð¬",ogon:"Ë",Ograve:"Ã",ograve:"ò",ogt:"â§",ohbar:"⦵",ohm:"Ω",oint:"â®",olarr:"âº",olcir:"⦾",olcross:"⦻",oline:"â¾",olt:"â§",Omacr:"Å",omacr:"Å",Omega:"Ω",omega:"Ï",Omicron:"Î",omicron:"ο",omid:"⦶",ominus:"â",Oopf:"ð",oopf:"ð ",opar:"⦷",OpenCurlyDoubleQuote:"â",OpenCurlyQuote:"â",operp:"⦹",oplus:"â",Or:"â©",or:"â¨",orarr:"â»",ord:"â©",order:"â´",orderof:"â´",ordf:"ª",ordm:"º",origof:"â¶",oror:"â©",orslope:"â©",orv:"â©",oS:"â",Oscr:"ðª",oscr:"â´",Oslash:"Ã",oslash:"ø",osol:"â",Otilde:"Ã",otilde:"õ",Otimes:"⨷",otimes:"â",otimesas:"⨶",Ouml:"Ã",ouml:"ö",ovbar:"â½",OverBar:"â¾",OverBrace:"â",OverBracket:"â´",OverParenthesis:"â",par:"â¥",para:"¶",parallel:"â¥",parsim:"⫳",parsl:"⫽",part:"â",PartialD:"â",Pcy:"Ð",pcy:"п",percnt:"%",period:".",permil:"â°",perp:"â¥",pertenk:"â±",Pfr:"ð",pfr:"ð",Phi:"Φ",phi:"Ï",phiv:"Ï",phmmat:"â³",phone:"â",Pi:"Î ",pi:"Ï",pitchfork:"â",piv:"Ï",planck:"â",planckh:"â",plankv:"â",plus:"+",plusacir:"⨣",plusb:"â",pluscir:"⨢",plusdo:"â",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"â",pointint:"â¨",Popf:"â",popf:"ð¡",pound:"£",Pr:"⪻",pr:"âº",prap:"⪷",prcue:"â¼",prE:"⪳",pre:"⪯",prec:"âº",precapprox:"⪷",preccurlyeq:"â¼",Precedes:"âº",PrecedesEqual:"⪯",PrecedesSlantEqual:"â¼",PrecedesTilde:"â¾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"â¨",precsim:"â¾",Prime:"â³",prime:"â²",primes:"â",prnap:"⪹",prnE:"⪵",prnsim:"â¨",prod:"â",Product:"â",profalar:"â®",profline:"â",profsurf:"â",prop:"â",Proportion:"â·",Proportional:"â",propto:"â",prsim:"â¾",prurel:"â°",Pscr:"ð«",pscr:"ð
",Psi:"Ψ",psi:"Ï",puncsp:"â",Qfr:"ð",qfr:"ð®",qint:"â¨",Qopf:"â",qopf:"ð¢",qprime:"â",Qscr:"ð¬",qscr:"ð",quaternions:"â",quatint:"â¨",quest:"?",questeq:"â",QUOT:'"',quot:'"',rAarr:"â",race:"â½Ì±",Racute:"Å",racute:"Å",radic:"â",raemptyv:"⦳",Rang:"â«",rang:"â©",rangd:"â¦",range:"⦥",rangle:"â©",raquo:"»",Rarr:"â ",rArr:"â",rarr:"â",rarrap:"⥵",rarrb:"â¥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"â¤",rarrhk:"âª",rarrlp:"â¬",rarrpl:"â¥
",rarrsim:"⥴",Rarrtl:"â¤",rarrtl:"â£",rarrw:"â",rAtail:"â¤",ratail:"â¤",ratio:"â¶",rationals:"â",RBarr:"â¤",rBarr:"â¤",rbarr:"â¤",rbbrk:"â³",rbrace:"}",rbrack:"]",rbrke:"â¦",rbrksld:"â¦",rbrkslu:"â¦",Rcaron:"Å",rcaron:"Å",Rcedil:"Å",rcedil:"Å",rceil:"â",rcub:"}",Rcy:"Ð ",rcy:"Ñ",rdca:"⤷",rdldhar:"⥩",rdquo:"â",rdquor:"â",rdsh:"â³",Re:"â",real:"â",realine:"â",realpart:"â",reals:"â",rect:"â",REG:"®",reg:"®",ReverseElement:"â",ReverseEquilibrium:"â",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"â",Rfr:"â",rfr:"ð¯",rHar:"⥤",rhard:"â",rharu:"â",rharul:"⥬",Rho:"Ρ",rho:"Ï",rhov:"ϱ",RightAngleBracket:"â©",RightArrow:"â",Rightarrow:"â",rightarrow:"â",RightArrowBar:"â¥",RightArrowLeftArrow:"â",rightarrowtail:"â£",RightCeiling:"â",RightDoubleBracket:"â§",RightDownTeeVector:"â¥",RightDownVector:"â",RightDownVectorBar:"â¥",RightFloor:"â",rightharpoondown:"â",rightharpoonup:"â",rightleftarrows:"â",rightleftharpoons:"â",rightrightarrows:"â",rightsquigarrow:"â",RightTee:"â¢",RightTeeArrow:"â¦",RightTeeVector:"â¥",rightthreetimes:"â",RightTriangle:"â³",RightTriangleBar:"â§",RightTriangleEqual:"âµ",RightUpDownVector:"â¥",RightUpTeeVector:"â¥",RightUpVector:"â¾",RightUpVectorBar:"â¥",RightVector:"â",RightVectorBar:"â¥",ring:"Ë",risingdotseq:"â",rlarr:"â",rlhar:"â",rlm:"â",rmoust:"â±",rmoustache:"â±",rnmid:"â«®",roang:"â",roarr:"â¾",robrk:"â§",ropar:"â¦",Ropf:"â",ropf:"ð£",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"â¦",rppolint:"â¨",rrarr:"â",Rrightarrow:"â",rsaquo:"âº",Rscr:"â",rscr:"ð",Rsh:"â±",rsh:"â±",rsqb:"]",rsquo:"â",rsquor:"â",rthree:"â",rtimes:"â",rtri:"â¹",rtrie:"âµ",rtrif:"â¸",rtriltri:"â§",RuleDelayed:"â§´",ruluhar:"⥨",rx:"â",Sacute:"Å",sacute:"Å",sbquo:"â",Sc:"⪼",sc:"â»",scap:"⪸",Scaron:"Å ",scaron:"Å¡",sccue:"â½",scE:"⪴",sce:"⪰",Scedil:"Å",scedil:"Å",Scirc:"Å",scirc:"Å",scnap:"⪺",scnE:"⪶",scnsim:"â©",scpolint:"â¨",scsim:"â¿",Scy:"С",scy:"Ñ",sdot:"â
",sdotb:"â¡",sdote:"⩦",searhk:"⤥",seArr:"â",searr:"â",searrow:"â",sect:"§",semi:";",seswar:"⤩",setminus:"â",setmn:"â",sext:"â¶",Sfr:"ð",sfr:"ð°",sfrown:"â¢",sharp:"â¯",SHCHcy:"Щ",shchcy:"Ñ",SHcy:"Ш",shcy:"Ñ",ShortDownArrow:"â",ShortLeftArrow:"â",shortmid:"â£",shortparallel:"â¥",ShortRightArrow:"â",ShortUpArrow:"â",shy:"Â",Sigma:"Σ",sigma:"Ï",sigmaf:"Ï",sigmav:"Ï",sim:"â¼",simdot:"⩪",sime:"â",simeq:"â",simg:"âª",simgE:"⪠",siml:"âª",simlE:"âª",simne:"â",simplus:"⨤",simrarr:"⥲",slarr:"â",SmallCircle:"â",smallsetminus:"â",smashp:"⨳",smeparsl:"⧤",smid:"â£",smile:"â£",smt:"⪪",smte:"⪬",smtes:"⪬ï¸",SOFTcy:"Ь",softcy:"Ñ",sol:"/",solb:"â§",solbar:"â¿",Sopf:"ð",sopf:"ð¤",spades:"â ",spadesuit:"â ",spar:"â¥",sqcap:"â",sqcaps:"âï¸",sqcup:"â",sqcups:"âï¸",Sqrt:"â",sqsub:"â",sqsube:"â",sqsubset:"â",sqsubseteq:"â",sqsup:"â",sqsupe:"â",sqsupset:"â",sqsupseteq:"â",squ:"â¡",Square:"â¡",square:"â¡",SquareIntersection:"â",SquareSubset:"â",SquareSubsetEqual:"â",SquareSuperset:"â",SquareSupersetEqual:"â",SquareUnion:"â",squarf:"âª",squf:"âª",srarr:"â",Sscr:"ð®",sscr:"ð",ssetmn:"â",ssmile:"â£",sstarf:"â",Star:"â",star:"â",starf:"â
",straightepsilon:"ϵ",straightphi:"Ï",strns:"¯",Sub:"â",sub:"â",subdot:"⪽",subE:"â«
",sube:"â",subedot:"â«",submult:"â«",subnE:"â«",subne:"â",subplus:"⪿",subrarr:"⥹",Subset:"â",subset:"â",subseteq:"â",subseteqq:"â«
",SubsetEqual:"â",subsetneq:"â",subsetneqq:"â«",subsim:"â«",subsub:"â«",subsup:"â«",succ:"â»",succapprox:"⪸",succcurlyeq:"â½",Succeeds:"â»",SucceedsEqual:"⪰",SucceedsSlantEqual:"â½",SucceedsTilde:"â¿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"â©",succsim:"â¿",SuchThat:"â",Sum:"â",sum:"â",sung:"âª",Sup:"â",sup:"â",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"â«",supE:"â«",supe:"â",supedot:"â«",Superset:"â",SupersetEqual:"â",suphsol:"â",suphsub:"â«",suplarr:"⥻",supmult:"â«",supnE:"â«",supne:"â",supplus:"â«",Supset:"â",supset:"â",supseteq:"â",supseteqq:"â«",supsetneq:"â",supsetneqq:"â«",supsim:"â«",supsub:"â«",supsup:"â«",swarhk:"⤦",swArr:"â",swarr:"â",swarrow:"â",swnwar:"⤪",szlig:"Ã",Tab:"\t",target:"â",Tau:"Τ",tau:"Ï",tbrk:"â´",Tcaron:"Ť",tcaron:"Å¥",Tcedil:"Å¢",tcedil:"Å£",Tcy:"Т",tcy:"Ñ",tdot:"â",telrec:"â",Tfr:"ð",tfr:"ð±",there4:"â´",Therefore:"â´",therefore:"â´",Theta:"Î",theta:"θ",thetasym:"Ï",thetav:"Ï",thickapprox:"â",thicksim:"â¼",ThickSpace:"ââ",thinsp:"â",ThinSpace:"â",thkap:"â",thksim:"â¼",THORN:"Ã",thorn:"þ",Tilde:"â¼",tilde:"Ë",TildeEqual:"â",TildeFullEqual:"â
",TildeTilde:"â",times:"Ã",timesb:"â ",timesbar:"⨱",timesd:"⨰",tint:"â",toea:"⤨",top:"â¤",topbot:"â¶",topcir:"⫱",Topf:"ð",topf:"ð¥",topfork:"â«",tosa:"⤩",tprime:"â´",TRADE:"â¢",trade:"â¢",triangle:"âµ",triangledown:"â¿",triangleleft:"â",trianglelefteq:"â´",triangleq:"â",triangleright:"â¹",trianglerighteq:"âµ",tridot:"â¬",trie:"â",triminus:"⨺",TripleDot:"â",triplus:"⨹",trisb:"â§",tritime:"⨻",trpezium:"â¢",Tscr:"ð¯",tscr:"ð",TScy:"Ц",tscy:"Ñ",TSHcy:"Ð",tshcy:"Ñ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"â¬",twoheadleftarrow:"â",twoheadrightarrow:"â ",Uacute:"Ã",uacute:"ú",Uarr:"â",uArr:"â",uarr:"â",Uarrocir:"â¥",Ubrcy:"Ð",ubrcy:"Ñ",Ubreve:"Ŭ",ubreve:"Å",Ucirc:"Ã",ucirc:"û",Ucy:"У",ucy:"Ñ",udarr:"â
",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"ð",ufr:"ð²",Ugrave:"Ã",ugrave:"ù",uHar:"⥣",uharl:"â¿",uharr:"â¾",uhblk:"â",ulcorn:"â",ulcorner:"â",ulcrop:"â",ultri:"â¸",Umacr:"Ū",umacr:"Å«",uml:"¨",UnderBar:"_",UnderBrace:"â",UnderBracket:"âµ",UnderParenthesis:"â",Union:"â",UnionPlus:"â",Uogon:"Ų",uogon:"ų",Uopf:"ð",uopf:"ð¦",UpArrow:"â",Uparrow:"â",uparrow:"â",UpArrowBar:"â¤",UpArrowDownArrow:"â
",UpDownArrow:"â",Updownarrow:"â",updownarrow:"â",UpEquilibrium:"⥮",upharpoonleft:"â¿",upharpoonright:"â¾",uplus:"â",UpperLeftArrow:"â",UpperRightArrow:"â",Upsi:"Ï",upsi:"Ï
",upsih:"Ï",Upsilon:"Î¥",upsilon:"Ï
",UpTee:"â¥",UpTeeArrow:"â¥",upuparrows:"â",urcorn:"â",urcorner:"â",urcrop:"â",Uring:"Å®",uring:"ů",urtri:"â¹",Uscr:"ð°",uscr:"ð",utdot:"â°",Utilde:"Ũ",utilde:"Å©",utri:"âµ",utrif:"â´",uuarr:"â",Uuml:"Ã",uuml:"ü",uwangle:"⦧",vangrt:"â¦",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"â
",varphi:"Ï",varpi:"Ï",varpropto:"â",vArr:"â",varr:"â",varrho:"ϱ",varsigma:"Ï",varsubsetneq:"âï¸",varsubsetneqq:"â«ï¸",varsupsetneq:"âï¸",varsupsetneqq:"â«ï¸",vartheta:"Ï",vartriangleleft:"â²",vartriangleright:"â³",Vbar:"â««",vBar:"⫨",vBarv:"â«©",Vcy:"Ð",vcy:"в",VDash:"â«",Vdash:"â©",vDash:"â¨",vdash:"â¢",Vdashl:"⫦",Vee:"â",vee:"â¨",veebar:"â»",veeeq:"â",vellip:"â®",Verbar:"â",verbar:"|",Vert:"â",vert:"|",VerticalBar:"â£",VerticalLine:"|",VerticalSeparator:"â",VerticalTilde:"â",VeryThinSpace:"â",Vfr:"ð",vfr:"ð³",vltri:"â²",vnsub:"ââ",vnsup:"ââ",Vopf:"ð",vopf:"ð§",vprop:"â",vrtri:"â³",Vscr:"ð±",vscr:"ð",vsubnE:"â«ï¸",vsubne:"âï¸",vsupnE:"â«ï¸",vsupne:"âï¸",Vvdash:"âª",vzigzag:"â¦",Wcirc:"Å´",wcirc:"ŵ",wedbar:"â©",Wedge:"â",wedge:"â§",wedgeq:"â",weierp:"â",Wfr:"ð",wfr:"ð´",Wopf:"ð",wopf:"ð¨",wp:"â",wr:"â",wreath:"â",Wscr:"ð²",wscr:"ð",xcap:"â",xcirc:"â¯",xcup:"â",xdtri:"â½",Xfr:"ð",xfr:"ðµ",xhArr:"âº",xharr:"â·",Xi:"Î",xi:"ξ",xlArr:"â¸",xlarr:"âµ",xmap:"â¼",xnis:"â»",xodot:"â¨",Xopf:"ð",xopf:"ð©",xoplus:"â¨",xotime:"â¨",xrArr:"â¹",xrarr:"â¶",Xscr:"ð³",xscr:"ð",xsqcup:"â¨",xuplus:"â¨",xutri:"â³",xvee:"â",xwedge:"â",Yacute:"Ã",yacute:"ý",YAcy:"Я",yacy:"Ñ",Ycirc:"Ŷ",ycirc:"Å·",Ycy:"Ы",ycy:"Ñ",yen:"Â¥",Yfr:"ð",yfr:"ð¶",YIcy:"Ð",yicy:"Ñ",Yopf:"ð",yopf:"ðª",Yscr:"ð´",yscr:"ð",YUcy:"Ю",yucy:"Ñ",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"Ð",zcy:"з",Zdot:"Å»",zdot:"ż",zeetrf:"â¨",ZeroWidthSpace:"â",Zeta:"Î",zeta:"ζ",Zfr:"â¨",zfr:"ð·",ZHcy:"Ð",zhcy:"ж",zigrarr:"â",Zopf:"â¤",zopf:"ð«",Zscr:"ðµ",zscr:"ð",zwj:"â",zwnj:"â"}),
vendor: 7,577 bytes, line 2
2t.entityMap=t.HTML_ENTITIES},978(e,t,i){var s=i(722);s.DOMImplementation,s.XMLSerializer,t.DOMParser=i(752).DOMParser},466(e,t,i){var s=i(582).NAMESPACE,n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+n.source+r.source+"*(?::"+n.source+r.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function l(){}function c(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,i,n,r,a){function o(e,t,s){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),s)}for(var l,c=++t,u=0;;){var d=e.charAt(c);switch(d){case"=":if(1===u)l=e.slice(t,c),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(a.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");o(l,h=e.slice(t,c),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');o(l,h=e.slice(t,c),t),a.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=c+1,u=5}break;case"/":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,c)),c;case">":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(h=e.slice(t,c)).slice(-1)&&(i.closed=!0,h=h.slice(0,-1));case 2:2===u&&(h=l),4==u?(a.warning('attribute "'+h+'" missed quot(")!'),o(l,h,t)):(s.isHTML(n[""])&&h.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),o(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"Â":d=" ";default:if(d<=" ")switch(u){case 0:i.setTagName(e.slice(t,c)),u=6;break;case 1:l=e.slice(t,c),u=2;break;case 4:var h=e.slice(t,c);a.warning('attribute "'+h+'" missed quot(")!!'),o(l,h,t);case 5:u=6}else switch(u){case 2:i.tagName,s.isHTML(n[""])&&l.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=c,u=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:u=1,t=c;break;case 3:u=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function d(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var o=e[a],l=o.qName,c=o.value;if((p=l.indexOf(":"))>0)var u=o.prefix=l.slice(0,p),d=l.slice(p+1),h="xmlns"===u&&d;else d=l,u=null,h="xmlns"===l&&"";o.localName=d,!1!==h&&(null==r&&(r={},m(i,i={})),i[h]=r[h]=c,o.uri=s.XMLNS,t.startPrefixMapping(h,c))}for(a=e.length;a--;)(u=(o=e[a]).prefix)&&("xml"===u&&(o.uri=s.XML),"xmlns"!==u&&(o.uri=i[u||""]));var p;(p=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,p),d=e.localName=n.slice(p+1)):(u=null,d=e.localName=n);var g=e.uri=i[u||""];if(t.startElement(g,d,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(g,d,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function h(e,t,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t),a=e.substring(t+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(n.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,s),n.characters(a,0,a.length),r)}return t+1}function p(e,t,i,s){var n=s[i];return null==n&&((n=e.lastIndexOf("</"+i+">"))<t&&(n=e.lastIndexOf("</"+i)),s[i]=n),n<t}function m(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function g(e,t,i,s){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(n=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,n-t-4),n+3):(s.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var n=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,n-t-9),i.endCDATA(),n+3}var r=function(e,t){var i,s=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=t,n.exec(e);i=n.exec(e);)if(s.push(i),i[1])return s}(e,t),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(r[2][0])?(l=r[3][0],c=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(c=r[3][0]));var u=r[a-1];return i.startDTD(o,l,c),i.endDTD(),u.index+u[0].length}return-1}function f(e,t,i){var s=e.indexOf("?>",t);if(s){var n=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)$/);return n?(n[0].length,i.processingInstruction(n[1],n[2]),s+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,l.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),m(t,t={}),function(e,t,i,n,r){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function l(t){if(t>w){var i=e.substring(w,t).replace(/&#?\w+;/g,a);T&&m(w),n.characters(i,0,t-w),w=t}}function m(t,i){for(;t>=v&&(i=b.exec(e));)_=i.index,v=_+i[0].length,T.lineNumber++;T.columnNumber=t-_+1}for(var _=0,v=0,b=/.*(?:\r\n?|\n)|.*$/g,T=n.locator,S=[{currentNSMap:t}],C={},w=0;;){try{var k=e.indexOf("<",w);if(k<0){if(!e.substr(w).match(/^\s*$/)){var E=n.doc,x=E.createTextNode(e.substr(w));E.appendChild(x),n.currentElement=x}return}switch(k>w&&l(k),e.charAt(k+1)){case"/":var I=e.indexOf(">",k+3),A=e.substring(k+2,I).replace(/[ \t\n\r]+$/g,""),P=S.pop();I<0?(A=e.substring(k+2).replace(/[\s<].*/,""),r.error("end tag name: "+A+" is not complete:"+P.tagName),I=k+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),r.error("end tag name: "+A+" maybe not complete"),I=k+1+A.length);var D=P.localNSMap,L=P.tagName==A;if(L||P.tagName&&P.tagName.toLowerCase()==A.toLowerCase()){if(n.endElement(P.uri,P.localName,A),D)for(var M in D)Object.prototype.hasOwnProperty.call(D,M)&&n.endPrefixMapping(M);L||r.fatalError("end tag name: "+A+" is not match the current start tagName:"+P.tagName)}else S.push(P);I++;break;case"?":T&&m(k),I=f(e,k,n);break;case"!":T&&m(k),I=g(e,k,n,r);break;default:T&&m(k);var N=new y,O=S[S.length-1].currentNSMap,R=(I=u(e,k,N,O,a,r),N.length);if(!N.closed&&p(e,I,N.tagName,C)&&(N.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),T&&R){for(var U=c(T,{}),B=0;B<R;B++){var F=N[B];m(F.offset),F.locator=c(T,{})}n.locator=U,d(N,n,O)&&S.push(N),n.locator=T}else d(N,n,O)&&S.push(N);s.isHTML(N.uri)&&!N.closed?I=h(e,I,N.tagName,a,n):I++}}catch(e){if(e instanceof o)throw e;r.error("element parse error: "+e),I=-1}I>w?w=I:l(Math.max(k,w)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},y.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=o},280(e,t,i){"use strict";i.d(t,{default:()=>s});const s=e=>({controls:{play:()=>new Promise((t,i)=>
2e.controls.play(!0).then(t).catch(i)),pause:()=>new Promise((t,i)=>e.controls.pause(!0).then(t).catch(i)),seek:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.controls.seek(!0,t).then(i).catch(s);s("Invalid argument provided for timeMs")}),volume:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.controls.volume(!0,t).then(i).catch(s);s("Invalid argument provided for volume")}),mute:t=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.controls.mute(!0,t).then(i).catch(s))),fullscreen:t=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.controls.fullscreen(!0,t).then(i).catch(s))),setChapters:t=>new Promise((i,s)=>{if(Array.isArray(t))return e.controls.setChapters(!0,t).then(i).catch(s);s("Invalid argument provided for chapters")})},customize:{get:t=>new Promise((i,s)=>(t=String(t),e.customize.get(!0,t).then(i).catch(s))),set:t=>new Promise((i,s)=>{if("object"==typeof t)return e.customize.set(!0,t).then(i).catch(s);s("Invalid argument provided for options")})},info:{onInfoUpdated:t=>e.info.infoUpdated.on(t),offInfoUpdated:t=>e.info.infoUpdated.off(t),duration:(t=JSON.parse(!1))=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.info.duration(!0,t).then(i).catch(s))),dimensions:()=>new Promise((t,i)=>e.info.dimensions(!0).then(t).catch(i)),onDimensionsChanged:t=>e.info.dimensionsChanged.on(t),offDimensionsChanged:t=>e.info.dimensionsChanged.off(t),guid:()=>new Promise((t,i)=>e.info.guid(!0).then(t).catch(i)),title:()=>new Promise((t,i)=>e.info.title(!0).then(t).catch(i)),poster:()=>new Promise((t,i)=>e.info.poster(!0).then(t).catch(i)),privacy:()=>new Promise((t,i)=>e.info.privacy(!0).then(t).catch(i)),getThumbnailSample:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.info.getThumbnailSample(!0,t).then(i).catch(s);s("Invalid argument provided for count")}),enableWatchedSegments:()=>new Promise((t,i)=>e.info.enableWatchedSegments(!0).then(t).catch(i)),disableWatchedSegments:()=>new Promise((t,i)=>e.info.disableWatchedSegments(!0).then(t).catch(i)),toggleWatchedSegments:()=>new Promise((t,i)=>e.info.toggleWatchedSegments(!0).then(t).catch(i)),watched:()=>new Promise((t,i)=>e.info.watched(!0).then(t).catch(i)),resetWatched:()=>new Promise((t,i)=>e.info.resetWatched(!0).then(t).catch(i))},status:{fullscreen:()=>new Promise((t,i)=>e.status.fullscreen(!0).then(t).catch(i)),onFullscreenChanged:t=>e.status.fullscreenChanged.on(t),offFullscreenChanged:t=>e.status.fullscreenChanged.off(t),player:()=>new Promise((t,i)=>e.status.player(!0).then(t).catch(i)),onPlayerStatusChanged:t=>e.status.playerStatusChanged.on(t),offPlayerStatusChanged:t=>e.status.playerStatusChanged.off(t),audio:()=>new Promise((t,i)=>e.status.audio(!0).then(t).catch(i)),playbackTime:()=>new Promise((t,i)=>e.status.playbackTime(!0).then(t).catch(i)),onPlaybackTimeUpdated:t=>e.status.playbackTimeUpdated.on(t),offPlaybackTimeUpdated:t=>e.status.playbackTimeUpdated.off(t),onTimeUpdate:t=>e.status.timeUpdate.on(t),offTimeUpdate:t=>e.status.timeUpdate.off(t),onChaptersChapterChange:t=>e.status.chaptersChapterChange.on(t),offChaptersChapterChange:t=>e.status.chaptersChapterChange.off(t),onChaptersTrackChange:t=>e.status.chaptersTrackChange.on(t),offChaptersTrackChange:t=>e.status.chaptersTrackChange.off(t),onBorderColorsChanged:t=>e.status.borderColorsChanged.on(t),offBorderColorsChanged:t=>e.status.borderColorsChanged.off(t),borderColors:()=>new Promise((t,i)=>e.status.borderColors(!0).then(t).catch(i)),onError:t=>e.status.error.on(t),offError:t=>e.status.error.off(t),onSegmentsWatched:t=>e.status.segmentsWatched.on(t),offSegmentsWatched:t=>e.status.segmentsWatched.off(t),onPlaybackRateUpdate:t=>e.status.playbackRateUpdate.on(t),offPlaybackRateUpdate:t=>e.status.playbackRateUpdate.off(t)}})},697(e,t,i){var s,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},r=i(542);"undefined"!=typeof document?s=document:(s=n["__GLOBAL_DOCUMENT_CACHE@4"])||(s=n["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=s},840(e){var t;t="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e.exports=t},56(e){e.exports=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},147(e){function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function i(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,s,n){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof s&&(n=s,s={}),s=s||{},n=n||function(){},a.type=s.type||"text/javascript",a.charset=s.charset||"utf8",a.async=!("async"in s)||!!s.async,a.src=e,s.attrs&&function(e,t){for(var i in t)e.setAttribute(i,t[i])}(a,s.attrs),s.text&&(a.text=""+s.text),("onload"in a?t:i)(a,n),a.onload||t(a,n),r.appendChild(a)}},962(e,t,i){var s=i(626).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(e.subarray(n)),i.firstOffset=s(e.subarray(n+8)),n+=16),n+=2;var r=t.getUint16(n);for(n+=2;r>0;n+=12,r--)i.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 i}},622(e){var t,i,s,n,r,a,o,l=9e4;t=function(e){return e*l},i=function(e,t){return e*t},s=function(e){return e/l},n=function(e,t){return e/t},r=function(e,i){return t(n(e,i))},a=function(e,t){return i(s(e),t)},o=function(e,t,i){return s(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:s,audioTsToSeconds:n,audioTsToVideoTs:r,videoTsToAudioTs:a,metadataTsToSeconds:o}},626(e){var t=Math.pow(2,32);e.exports={getUint64:function(e){var i,s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.getBigUint64?(i=s.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
vendor: 5,189 bytes, line 2
2Number(i):i:s.getUint32(0)*t+s.getUint32(4)},MAX_UINT32:t}},879(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>wa});var s=i(840),n=i.n(s),r=i(697),a=i.n(r),o=i(36),l=i.n(o),c=i(784),u=i.n(c);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},d.apply(null,arguments)}const h=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=n().location&&n().location.href||"");var i=/^\/\//.test(e),s=!n().location&&!/\/\//i.test(e);e=new(n().URL)(e,n().location||"https://example.com");var r=new URL(t,e);return s?r.href.slice(19):i?r.href.slice(r.protocol.length):r.href};var p=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=t.length,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)})},e}();function m(e){for(var t,i=(t=e,n().atob?n().atob(t):Buffer.from(t,"base64").toString("binary")),s=new Uint8Array(i.length),r=0;r<i.length;r++)s[r]=i.charCodeAt(r);return s}class g extends p{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const f=String.fromCharCode(9),y=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},_=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let s,n=i.length;for(;n--;)""!==i[n]&&(s=/([^=]*)=(.*)/.exec(i[n]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),t[s[0]]=s[1]);return t},v=e=>{const t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class b extends p{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((t,i)=>{const s=i(e);return s===e?t:t.concat([s])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=d(y(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=_(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=y(e.BYTERANGE))}this.trigger("data",i)}else{if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=_(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=v(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=_(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"}
vendor: 4,359 bytes, line 2
2,t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=_(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=_(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=_(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(f)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=_(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=y(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=_(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=_(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=_(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}}),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=_(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=_(t[1]),["ID","CLASS"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))});const e=/^X-([A-Z]+-)+[A-Z]+$/;
vendor: 12,220 bytes, line 2
2for(const t in i.attributes){if(!e.test(t))continue;const s=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),n=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=s?i.attributes[t].toString(16):n?parseFloat(i.attributes[t]):String(i.attributes[t])}return void this.trigger("data",i)}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=_(t[1]),void this.trigger("data",i);if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t)return i={type:"tag",tagType:"i-frame-playlist"},i.attributes=_(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=v(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),void this.trigger("data",i);if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t)return i={type:"tag",tagType:"define"},i.attributes=_(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:i,segment:s}){"function"!=typeof i&&(i=e=>e),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:s}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(i=>e.test(i)?t(i):i)}}const T=function(e){const t={};return Object.keys(e).forEach(function(i){var s;t[(s=i,s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()))]=e[i]}),t},S=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t)return;const n="#EXT-X-SERVER-CONTROL",r="holdBack",a="partHoldBack",o=i&&3*i,l=s&&2*s;i&&!t.hasOwnProperty(r)&&(t[r]=o,this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[r]<o&&(this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`}),t[r]=o),s&&!t.hasOwnProperty(a)&&(t[a]=3*s,this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),s&&t[a]<l&&(this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class C extends p{constructor(e={}){super(),this.lineStream=new g,this.parseStream=new b,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let s,n,r={},a=!1;const o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let c=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0,h=0;const p={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&n&&(r.key=n),r.timeline||"number"!=typeof c||(r.timeline=c),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(e){let g,f;if(t.manifest.definitions)for(const i in t.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace(`{$${i}}`,t.manifest.definitions[i])),e.attributes)for(const s in e.attributes)"string"==typeof e.attributes[s]&&(e.attributes[s]=e.attributes[s].replace(`{$${i}}`,t.manifest.definitions[i]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in e&&(r.byterange=t,t.length=e.length,"offset"in e||(e.offset=u)),"offset"in e&&(r.byterange=t,t.offset=e.offset),u=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(r.title=e.title),e.duration>0&&(r.duration=e.duration),0===e.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:m(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange),n&&(s.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(r.attributes||(r.attributes={}),d(r.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},g=t[e.attributes["GROUP-ID"]],f={default:/yes/i.test(e.attributes.DEFAULT)},f.default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),g[e.attributes.NAME]=f},discontinuity(){c+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),r.dateTimeString=e.dateTimeString,r.dateTimeObject=e.dateTimeObject;const{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,S.call(this,this.manifest))},start(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){r.cueOut=e.data},"cue-out-cont"(){r.cueOutCont=e.data},"cue-in"(){r.cueIn=e.data},skip(){this.manifest.skip=T(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const t=this.manifest.segments.length,i=T(e.attributes);r.parts=r.parts||[],r.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=h),h=i.byterange.offset+i.byterange.length);const s=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${s} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){const t=this.manifest.serverControl=T(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),S.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,i=T(e.attributes),s=i.type&&"PART"===i.type;r.preloadHints=r.preloadHints||[],r.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=s?h:0,s&&(h=i.byterange.offset+i.byterange.length)));const n=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<r.preloadHints.length-1;e++){const s=r.preloadHints[e];s.type&&s.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}},"rendition-report"(){const t=T(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const i=this.manifest.renditionReports.length-1,s=["LAST-MSN","URI"];a&&s.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,s)},"part-inf"(){this.manifest.partInf=T(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),S.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(T(e.attributes));const t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);const i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const s=!!i.endOnNext;if(s&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
2=YES attribute must have a CLASS attribute"}),s&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){const e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(p[i.id]){for(const e in p[i.id])if(i[e]&&JSON.stringify(p[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex(e=>e.id===i.id);this.manifest.dateRanges[e]=d(this.manifest.dateRanges[e],i),p[i.id]=d(p[i.id],i),this.manifest.dateRanges.pop()}else p[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=T(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const i=this.params.get(e.attributes.QUERYPARAM);return i?void t(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void t(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:c}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||o).call(t)},uri(){r.uri=e.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),n&&(r.key=n),r.timeline=c,s&&(r.map=s),h=0,null!==this.lastProgramDateTime&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*r.duration),r={}},comment(){},custom(){e.segment?(r.custom=r.custom||{},r.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){t.hasOwnProperty(e)||s.push(e)}),s.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var w,k,E={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},x=["video","audio","text"],I=["Video","Audio","Text"],A=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}):e},P=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach(function(e){var t;e=e.trim(),x.forEach(function(s){var n=E[s].exec(e.toLowerCase());if(n&&!(n.length<=1)){t=s;var r=e.substring(0,n[1].length),a=e.replace(r,"");i.push({type:r,details:a,mediaType:s})}}),t||i.push({type:e,details:"",mediaType:"unknown"})}),i},D=function(e){return void 0===e&&(e=""),E.audio.test(e.trim().toLowerCase())},L=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map(function(e){return A(e.trim())}),s="video";1===i.length&&D(i[0])?s="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),E.text.test(t.trim().toLowerCase()))&&
vendor: 75,225 bytes, line 2
2(s="application");var n="mp4";return i.every(function(e){return E.mp4.test(e)})?n="mp4":i.every(function(e){return E.webm.test(e)})?n="webm":i.every(function(e){return E.ogg.test(e)})&&(n="ogg"),s+"/"+n+';codecs="'+e+'"'}},M=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),n().MediaSource&&n().MediaSource.isTypeSupported&&n().MediaSource.isTypeSupported(L(e))||t&&n().ManagedMediaSource&&n().ManagedMediaSource.isTypeSupported&&n().ManagedMediaSource.isTypeSupported(L(e))||!1},N=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<I.length;t++)if(E["muxer"+I[t]].test(e))return!0;return!1})},O="mp4a.40.2",R=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,U=/^application\/dash\+xml/i,B=function(e){return R.test(e)?"hls":U.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},F=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},j=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||F(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},q=n().BigInt||Number,$=[q("0x1"),q("0x100"),q("0x10000"),q("0x1000000"),q("0x100000000"),q("0x10000000000"),q("0x1000000000000"),q("0x100000000000000"),q("0x10000000000000000")],H=(w=new Uint16Array([65484]),255===(k=new Uint8Array(w.buffer,w.byteOffset,w.byteLength))[0]||k[0],function(e,t){var i=void 0===t?{}:t,s=i.signed,n=void 0!==s&&s,r=i.le,a=void 0!==r&&r;e=j(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,function(t,i,s){var n=a?s:Math.abs(s+1-e.length);return t+q(i)*$[n]},q(0));if(n){var c=$[e.length]/q(2)-q(1);(l=q(l))>c&&(l-=c,l-=c,l-=q(2))}return Number(l)}),z=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return i},V=function(e,t,i){var s=void 0===i?{}:i,n=s.offset,r=void 0===n?0:n,a=s.mask,o=void 0===a?[]:a;e=j(e);var l=(t=j(t)).every?t.every:Array.prototype.every;return t.length&&e.length-r>=t.length&&l.call(t,function(t,i){return t===(o[i]?o[i]&e[r+i]:e[r+i])})},W=i(978);const G=e=>!!e&&"object"==typeof e,X=(...e)=>e.reduce((e,t)=>("object"!=typeof t||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):G(e[i])&&G(t[i])?e[i]=X(e[i],t[i]):e[i]=t[i]}),e),{}),K=e=>Object.keys(e).map(t=>e[t]),Y=e=>e.reduce((e,t)=>e.concat(t),[]),Q=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};const Z=({baseUrl:e="",source:t="",range:i="",indexRange:s=""})=>{const r={uri:t,resolvedUri:h(e||"",t)};if(i||s){const e=(i||s).split("-");let t,a=n().BigInt?n().BigInt(e[0]):parseInt(e[0],10),o=n().BigInt?n().BigInt(e[1]):parseInt(e[1],10);a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),t="bigint"==typeof o||"bigint"==typeof a?n().BigInt(o)-n().BigInt(a)+n().BigInt(1):o-a+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:a}}return r},J=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),ee={static(e){const{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e,r=J(e.endNumber),a=t/i;return"number"==typeof r?{start:0,end:r}:"number"==typeof n?{start:0,end:n/a}:{start:0,end:s/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,c=J(e.endNumber),u=(t+i)/1e3,d=s+a,h=u+o-d,p=Math.ceil(h*n/r),m=Math.floor((u-d-l)*n/r),g=Math.floor((u-d)*n/r);return{start:Math.max(0,m),end:"number"==typeof c?c:Math.min(p,g)}}},te=e=>{const{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=e,{start:a,end:o}=ee[t](e),l=((e,t)=>{const i=[];for(let s=e;s<t;s++)i.push(s);return i})(a,o).map((e=>t=>{const{duration:i,timescale:s=1,periodStart:n,startNumber:r=1}=e;return{number:r+t,duration:i/s,timeline:n,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof n?n:r;l[e].duration=t-i/s*e}return l},ie=e=>{const{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error("NO_BASE_URL");const c=Z({baseUrl:t,source:i.sourceURL,range:i.range}),u=Z({baseUrl:t,source:t,indexRange:n});if(u.map=c,l){const t=te(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else s&&(u.duration=s,u.timeline=r);return u.presentationTime=a||r,u.number=o,[u]},se=(e,t,i)=>{const s=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,c=t.timescale,u=t.references.filter(e=>1!==e.referenceType),d=[],h=e.endList?"static":"dynamic",p=e.sidx.timeline;let m,g=p,f=e.mediaSequence||0;m="bigint"==typeof t.firstOffset?n().BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<u.length;e++){const o=t.references[e],l=o.referencedSize,u=o.subsegmentDuration;let y;y="bigint"==typeof m?m+n().BigInt(l)-n().BigInt(1):m+l-1;const _=ie({baseUrl:i,timescale:c,timeline:a,periodStart:p,presentationTime:g,number:f,duration:u,sourceDuration:r,indexRange:`${m}-${y}`,type:h})[0];s&&(_.map=s),d.push(_),m+="bigint"==typeof m?n().BigInt(l):l,g+=u/c,f++}return e.segments=d,e},ne=["AUDIO","SUBTITLES"],re=1/60,ae=e=>{return(t=e,i=({timeline:e})=>e,K(t.reduce((e,t)=>(t.forEach(t=>{e[i(t)]=t}),e),{}))).sort((e,t)=>e.timeline>t.timeline?1:-1);var t,i},oe=e=>{let t=[];var i,s;return i=e,s=(e,i,s,n)=>{t=t.concat(e.playlists||[])},ne.forEach(function(e){for(var t in i.mediaGroups[e])for(var n in i.mediaGroups[e][t]){var r=i.mediaGroups[e][t][n];s(r)}}),t},le=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},ce=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?n().BigInt(e.offset)+n().BigInt(e.length)-n().BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),ue=e=>{const t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{});let i=[];return Object.values(t).forEach(e=>{const t=K(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>{var t;return e.discontinuityStarts=(t=e.segments||[],t.reduce((e,t,i)=>(t.discontinuity&&e.push(i),e),[])),e})},de=(e,t)=>{const i=ce(e.sidx),s=i&&t[i]&&t[i].sidx;return s&&se(e,s,e.sidx.resolvedUri),e},he=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=de(e[i],t);return e},pe=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(n.contentProtection=e.contentProtection),e.serviceLocation&&(n.attributes.serviceLocation=e.serviceLocation),i&&(n.sidx=i),n},me=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ge=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,fe=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,ye=e=>e?Object.keys(e).reduce((t,i)=>{const s=e[i];return t.concat(s.playlists)},[]):[],_e=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:c}=e[0].attributes,u=ue(e.filter(me)).map(pe),d=ue(e.filter(ge)),h=ue(e.filter(fe)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:he(u,s)};c>=0&&(m.minimumUpdatePeriod=1e3*c),t&&(m.locations=t),i&&(m.contentSteering=i),"dynamic"===o&&(m.suggestedPresentationDelay=l),r&&r.length>0&&(m.eventStream=r);const g=0===m.playlists.length,f=d.length?((e,t={},i=!1)=>{let s;const n=e.reduce((e,n)=>{const r=n.attributes.role&&n.attributes.role.value||"",a=n.attributes.lang||"";let o=n.attributes.label||"main";if(a&&!n.attributes.label){const e=r?` (${r})`:"";o=`${n.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===r,playlists:[],uri:""});const l=de((({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(n,i),t);return e[o].playlists.push(l),void 0===s&&"main"===r&&(s=n,s.default=!0),e},{});return s||(n[Object.keys(n)[0]].default=!0),n})(d,s,g):null,y=h.length?((e,t={})=>e.reduce((e,i)=>{const s=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return e[s]||(e[s]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[s].playlists.push(de((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const r={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(r.CODECS=e.codecs);const a={attributes:r,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e},{}))(h,s):null,_=u.concat(ye(f),ye(y)),v=_.map(({timelineStarts:e})=>e);var b,T;return m.timelineStarts=ae(v),b=_,T=m.timelineStarts,b.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=T.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),f&&(m.mediaGroups.AUDIO.audio=f),y&&(m.mediaGroups.SUBTITLES.subs=y),p.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce((e,t)=>t?(t.forEach(t=>{const{channel:i,language:s}=t;e[s]={autoselect:!1,default:!1,instreamId:i,language:s},t.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[s].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[s]["3D"]=t["3D"])}),e):e,{})),n?(({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(oe(e)),s=t.playlists.concat(oe(t));return t.timelineStarts=ae([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});const s=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!s)return;if(t.sidx)return;const n=t.segments[0],r=s.segments.findIndex(function(e){return Math.abs(e.presentationTime-n.presentationTime)<re});if(-1===r)return le({playlist:t,mediaSequence:s.mediaSequence+s.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!s.segments.length&&t.timeline>s.timeline||s.segments.length&&t.timeline>s.segments[s.segments.length-1].timeline)&&t.discontinuitySequence--);s.segments[r].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),le({playlist:t,mediaSequence:s.segments[r].number})})})({oldPlaylists:i,newPlaylists:s,timelineStarts:t.timelineStarts}),t})({oldManifest:n,newManifest:m}):m},ve=(e,t,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,c=(s+n)/1e3+l-(r+o);return Math.ceil((c*a-t)/i)},be=(e,t)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e,c=[];let u=-1;for(let d=0;d<t.length;d++){const h=t[d],p=h.d,m=h.r||0,g=h.t||0;let f;if(u<0&&(u=g),g&&g>u&&(u=g),m<0){const o=d+1;f=o===t.length?"dynamic"===i&&s>0&&n.indexOf("$Number$")>0?ve(e,u,p):(r*a-u)/p:(t[o].t-u)/p}else f=m+1;const y=o+c.length+f;let _=o+c.length;for(;_<y;)c.push({number:_,duration:p/a,time:u,timeline:l}),u+=p,_++}return c},Te=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Se=(e,t)=>e.replace(Te,(e=>(t,i,s,n)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const r=""+e[i];return"RepresentationID"===i?r:(n=s?parseInt(n,10):1,r.length>=n?r:`${new Array(n-r.length+1).join("0")}${r}`)})(t)),Ce=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=e,n=Z({baseUrl:e.baseUrl,source:Se(s.sourceURL,i),range:s.range}),r=((e,t)=>e.duration||t?e.duration?te(e):be(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return r.map(t=>{i.Number=t.number,i.Time=t.time;const s=Se(e.media||"",i),r=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/r;return{uri:s,timeline:t.timeline,duration:t.duration,resolvedUri:h(e.baseUrl||"",s),map:n,number:t.number,presentationTime:o}})},we=(e,t)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=e;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");const r=s.map(t=>((e,t)=>{const{baseUrl:i,initialization:s={}}=e,n=Z({baseUrl:i,source:s.sourceURL,range:s.range}),r=Z({baseUrl:i,source:t.media,range:t.mediaRange});return r.map=n,r})(e,t));let a;return i&&(a=te(e)),t&&(a=be(e,t)),a.map((t,i)=>{if(r[i]){const s=r[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return s.timeline=t.timeline,s.duration=t.duration,s.number=t.number,s.presentationTime=n+(t.time-o)/a,s}}).filter(e=>e)},ke=({attributes:e,segmentInfo:t})=>{let i,s;t.template?(s=Ce,i=X(e,t.template)):t.base?(s=ie,i=X(e,t.base)):t.list&&(s=we,i=X(e,t.list));const n={attributes:e};if(!s)return n;const r=s(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else r.length?i.duration=r.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0;return n.attributes=i,n.segments=r,t.base&&i.indexRange&&(n.sidx=r[0],n.segments=[]),n},Ee=(e,t)=>Q(e.childNodes).filter(({tagName:e})=>e===t),xe=e=>e.textContent.trim(),Ie=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,s,n,r,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(s||0)+86400*parseFloat(n||0)+3600*parseFloat(r||0)+60*parseFloat(a||0)+parseFloat(o||0)},Ae={mediaPresentationDuration:e=>Ie(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>Ie(e),suggestedPresentationDelay:e=>Ie(e),type:e=>e,timeShiftBufferDepth:e=>Ie(e),start:e=>Ie(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce((e,t)=>e/t)))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?Ie(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Pe=e=>e&&e.attributes?Q(e.attributes).reduce((e,t)=>{const i=Ae[t.name]||Ae.DEFAULT;return e[t.name]=i(t.value),e},{}):{},De={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Le=(e,t)=>t.length?Y(e.map(function(e){return t.map(function(t){const i=xe(t),s=h(e.baseUrl,i),n=X(Pe(t),{baseUrl:s});return s!==i&&!n.serviceLocation&&e.serviceLocation&&(n.serviceLocation=e.serviceLocation),n})})):e,Me=e=>{const t=Ee(e,"SegmentTemplate")[0],i=Ee(e,"SegmentList")[0],s=i&&Ee(i,"SegmentURL").map(e=>X({tag:"SegmentURL"},Pe(e))),n=Ee(e,"SegmentBase")[0],r=i||t,a=r&&Ee(r,"SegmentTimeline")[0],o=i||n||t,l=o&&Ee(o,"Initialization")[0],c=t&&Pe(t);c&&l?c.initialization=l&&Pe(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});const u={template:c,segmentTimeline:a&&Ee(a,"S").map(e=>Pe(e)),list:i&&X(Pe(i),{segmentUrls:s,initialization:Pe(l)}),base:n&&X(Pe(n),{initialization:Pe(l)})};return Object.keys(u).forEach(e=>{u[e]||delete u[e]}),u},Ne=e=>Y(Ee(e.node,"EventStream").map(t=>{const i=Pe(t),s=i.schemeIdUri;return Ee(t,"Event").map(t=>{const n=Pe(t),r=n.presentationTime||0,a=i.timescale||1,o=n.duration||0,l=r/a+e.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:l,end:l+o/a,messageData:xe(t)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),Oe=(e,t)=>(i,s)=>{const n=Le(t,Ee(i.node,"BaseURL")),r=X(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(r.periodDuration=i.attributes.duration);const a=Ee(i.node,"AdaptationSet"),o=Me(i.node);return Y(a.map(((e,t,i)=>s=>{const n=Pe(s),r=Le(t,Ee(s,"BaseURL")),a=Ee(s,"Role")[0],o={role:Pe(a)};let l=X(e,n,o);const c=Ee(s,"Accessibility")[0],u="urn:scte:dash:cc:cea-608:2015"===(d=Pe(c)).schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}):"urn:scte:dash:cc:cea-708:2015"===d.schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,s=""]=e.split("=");t.channel=i,t.language=e,s.split(",").forEach(e=>{const[i,s]=e.split(":");"lang"===i?t.language=s:"er"===i?t.easyReader=Number(s):"war"===i?t.aspectRatio=Number(s):"3D"===i&&(t["3D"]=Number(s))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}):void 0;var d;u&&(l=X(l,{captionServices:u}));const h=Ee(s,"Label")[0];if(h&&h.childNodes.length){const e=h.childNodes[0].nodeValue.trim();l=X(l,{label:e})}const p=Ee(s,"ContentProtection").reduce((e,t)=>{const i=Pe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const s=De[i.schemeIdUri];if(s){e[s]={attributes:i};const n=Ee(t,"cenc:pssh")[0];if(n){const t=xe(n);e[s].pssh=t&&m(t)}}return e},{});Object.keys(p).length&&(l=X(l,{contentProtection:p}));const g=Me(s),f=Ee(s,"Representation"),y=X(i,g);return Y(f.map(((e,t,i)=>s=>{const n=Ee(s,"BaseURL"),r=Le(t,n),a=X(e,Pe(s)),o=Me(s);return r.map(e=>({segmentInfo:X(i,o),attributes:X(a,e)}))})(l,r,y)))})(r,n,o)))},Re=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=X({serverURL:xe(e[0])},Pe(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Ue=e=>{if(""===e)throw new Error("DASH_EMPTY_MANIFEST");const t=new W.DOMParser;let i,s;try{i=t.parseFromString(e,"application/xml"),s=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return s};var Be,Fe=i(962),je=i.n(Fe),qe=j([73,68,51]),$e=function e(t,i){return void 0===i&&(i=0),(t=j(t)).length-i<10||!V(t,qe,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=j(e))[t+5],s=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?s+20:s+10}(t,i),e(t,i))},He=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?z(e):e}),ze=function(e){e=j(e);for(var t=[],i=0;e.length>i;){var s=e[i],n=0,r=0,a=e[++r];for(r++;128&a;)n=(127&a)<<7,a=e[r],r++;n+=127&a;for(var o=0;o<Be.length;o++){var l=Be[o],c=l.id,u=l.parser;if(s===c){t.push(u(e.subarray(r,r+n)));break}}i+=n+r}return t};Be=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,j(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=ze(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:ze(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Ve=function e(t,i,s){void 0===s&&(s=!1),i=function(e){return Array.isArray(e)?e.map(function(e){return He(e)}):[He(e)]}(i),t=j(t);var n=[];if(!i.length)return n;for(var r=0;r<t.length;){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0,o=t.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>t.length){if(s)break;l=t.length}var c=t.subarray(r+8,l);V(o,i[0])&&(1===i.length?n.push(c):n.push.apply(n,e(c,i.slice(1),s))),r=l}return n},We={EBML:j([26,69,223,163]),DocType:j([66,130]),Segment:j([24,83,128,103]),SegmentInfo:j([21,73,169,102]),Tracks:j([22,84,174,107]),Track:j([174]),TrackNumber:j([215]),DefaultDuration:j([35,227,131]),TrackEntry:j([174]),TrackType:j([131]),FlagDefault:j([136]),CodecID:j([134]),CodecPrivate:j([99,162]),VideoTrack:j([224]),AudioTrack:j([225]),Cluster:j([31,67,182,117]),Timestamp:j([231]),TimestampScale:j([42,215,177]),BlockGroup:j([160]),BlockDuration:j([155]),Block:j([161]),SimpleBlock:j([163])},Ge=[128,64,32,16,8,4,2,1],Xe=function(e,t,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var n=function(e){for(var t=1,i=0;i<Ge.length&&!(e&Ge[i]);i++)t++;return t}(e[t]),r=e.subarray(t,t+n);return i&&((r=Array.prototype.slice.call(e,t,t+n))[0]^=Ge[n-1]),{length:n,value:H(r,{signed:s}),bytes:r}},Ke=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?function(e,t){var i=(void 0===t?{}:t).le,s=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var n,r=(n=e=q(e),Math.ceil(function(e){return e.toString(2).length}(n)/8)),a=new Uint8Array(new ArrayBuffer(r)),o=0;o<r;o++){var l=s?o:Math.abs(o+1-a.length);a[l]=Number(e/$[o]&q(255)),e<0&&(a[l]=Math.abs(~a[l]),a[l]-=0===o?1:2)}return a}(t):t},Ye=function e(t,i,s){if(s>=i.length)return i.length;var n=Xe(i,s,!1);if(V(t.bytes,n.bytes))return s;var r=Xe(i,s+n.length);return e(t,i,s+r.length+r.value+n.length)},Qe=function e(t,i){i=function(e){return Array.isArray(e)?e.map(function(e){return Ke(e)}):[Ke(e)]}(i),t=j(t);var s=[];if(!i.length)return s;for(var n=0;n<t.length;){var r=Xe(t,n,!1),a=Xe(t,n+r.length),o=n+r.length+a.length;127===a.value&&(a.value=Ye(r,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,c=t.subarray(o,l);V(i[0],r.bytes)&&(1===i.length?s.push(c):s=s.concat(e(c,i.slice(1)))),n+=r.length+a.length+c.length}return s},Ze=j([0,0,0,1]),Je=j([0,0,1]),et=j([0,0,3]),tt=function(e){for(var t=[],i=1;i<e.length-2;)V(e.subarray(i,i+3),et)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var s=e.length-t.length,n=new Uint8Array(s),r=0;for(i=0;i<s;r++,i++)r===t[0]&&(r++,t.shift()),n[i]=e[r];return n},it=function(e,t,i,s){void 0===s&&(s=1/0),e=j(e),i=[].concat(i);for(var n,r=0,a=0;r<e.length&&(a<s||n);){var o=void 0;if(V(e.subarray(r),Ze)?o=4:V(e.subarray(r),Je)&&(o=3),o){if(a++,n)return tt(e.subarray(n,r));var l=void 0;"h264"===t?l=31&e[r+o]:"h265"===t&&(l=e[r+o]>>1&63),-1!==i.indexOf(l)&&(n=r+o),r+=o+("h264"===t?1:2)}else r++}return e.subarray(0,0)},st={webm:j([119,101,98,109]),matroska:j([109,97,116,114,111,115,107,97]),flac:j([102,76,97,67]),ogg:j([79,103,103,83]),ac3:j([11,119]),riff:j([82,73,70,70]),avi:j([65,86,73]),wav:j([87,65,86,69]),"3gp":j([102,116,121,112,51,103]),mp4:j([102,116,121,112]),fmp4:j([115,116,121,112]),mov:j([102,116,121,112,113,116]),moov:j([109,111,111,118]),moof:j([109,111,111,102])},nt={aac:function(e){var t=$e(e);return V(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=$e(e);return V(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Qe(e,[We.EBML,We.DocType])[0];return V(t,st.webm)},mkv:function(e){var t=Qe(e,[We.EBML,We.DocType])[0];return V(t,st.matroska)},mp4:function(e){return!nt["3gp"](e)&&!nt.mov(e)&&(!(!V(e,st.mp4,{offset:4})&&!V(e,st.fmp4,{offset:4}))||!(!V(e,st.moof,{offset:4})&&!V(e,st.moov,{offset:4}))||void 0)},mov:function(e){return V(e,st.mov,{offset:4})},"3gp":function(e){return V(e,st["3gp"],{offset:4})},ac3:function(e){var t=$e(e);return V(e,st.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=$e(e);return V(e,st.flac,{offset:t})},ogg:function(e){return V(e,st.ogg)},avi:function(e){return V(e,st.riff)&&V(e,st.avi,{offset:8})},wav:function(e){return V(e,st.riff)&&V(e,st.wav,{offset:8})},h264:function(e){return function(e){return it(e,"h264",7,3)}(e).length},h265:function(e){return function(e){return it(e,"h265",[32,33],3)}(e).length}},rt=Object.keys(nt).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);rt.forEach(function(e){var t=nt[e];nt[e]=function(e){return t(j(e))}});var at=nt,ot=function(e){e=j(e);for(var t=0;t<rt.length;t++){var i=rt[t];if(at[i](e))return i}return""},lt=i(622),ct="8.23.8";const ut={},dt=function(e,t){return ut[e]=ut[e]||[],t&&(ut[e]=ut[e].concat(t)),ut[e]},ht=function(e,t){const i=dt(e).indexOf(t);return!(i<=-1||(ut[e]=ut[e].slice(),ut[e].splice(i,1),0))},pt={prefixed:!0},mt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],gt=mt[0];let ft;for(let e=0;e<mt.length;e++)if(mt[e][1]in a()){ft=mt[e];break}if(ft){for(let e=0;e<ft.length;e++)pt[gt[e]]=ft[e];pt.prefixed=ft[0]!==gt[0]}let yt=[];const _t=function e(t,i=":",s=""){let r,a="info";function o(...e){r("log",a,e)}return r=((e,t,i)=>(s,r,a)=>{const o=t.levels[r],l=new RegExp(`^(${o})$`);let c=e;if("log"!==s&&a.unshift(s.toUpperCase()+":"),i&&(c=`%c${e}`,a.unshift(i)),a.unshift(c+":"),yt){yt.push([].concat(a));const e=yt.length-1e3;yt.splice(0,e>0?e:0)}if(!n().console)return;let u=n().console[s];u||"debug"!==s||(u=n().console.info||n().console.log),u&&o&&l.test(s)&&u[Array.isArray(a)?"apply":"call"](n().console,a)})(t,o,s),o.createLogger=(n,r,a)=>{const o=void 0!==r?r:i;return e(`${t} ${o} ${n}`,o,void 0!==a?a:s)},o.createNewLogger=(t,i,s)=>e(t,i,s),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:a},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);a=e}return a},o.history=()=>yt?[].concat(yt):[],o.history.filter=e=>(yt||[]).filter(t=>new RegExp(`.*${e}.*`).test(t[0])),o.history.clear=()=>{yt&&(yt.length=0)},o.history.disable=()=>{null!==yt&&(yt.length=0,yt=null)},o.history.enable=()=>{null===yt&&(yt=[])},o.error=(...e)=>r("error",a,e),o.warn=(...e)=>r("warn",a,e),o.debug=(...e)=>r("debug",a,e),o}("VIDEOJS"),vt=_t.createLogger,bt=Object.prototype.toString,Tt=function(e){return wt(e)?Object.keys(e):[]};function St(e,t){Tt(e).forEach(i=>t(e[i],i))}function Ct(e,t,i=0){return Tt(e).reduce((i,s)=>t(i,e[s],s),i)}function wt(e){return!!e&&"object"==typeof e}function kt(e){return wt(e)&&"[object Object]"===bt.call(e)&&e.constructor===Object}function Et(...e){const t={};return e.forEach(e=>{e&&St(e,(e,i)=>{kt(e)?(kt(t[i])||(t[i]={}),t[i]=Et(t[i],e)):t[i]=e})}),t}function xt(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];t.push(s)}return t}function It(e,t,i,s=!0){const n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return n(e),e}};return s&&(r.set=n),Object.defineProperty(e,t,r)}var At=Object.freeze({__proto__:null,each:St,reduce:Ct,isObject:wt,isPlain:kt,merge:Et,values:xt,defineLazyProperty:It});let Pt,Dt=!1,Lt=null,Mt=!1,Nt=!1,Ot=!1,Rt=!1,Ut=!1,Bt=null,Ft=null;const jt=Boolean(n().cast&&n().cast.framework&&n().cast.framework.CastReceiverContext);let qt=null,$t=!1,Ht=!1,zt=!1,Vt=!1,Wt=!1,Gt=!1,Xt=!1;const Kt=Boolean(ti()&&("ontouchstart"in n()||n().navigator.maxTouchPoints||n().DocumentTouch&&n().document instanceof n().DocumentTouch)),Yt=n().navigator&&n().navigator.userAgentData;if(Yt&&Yt.platform&&Yt.brands&&(Mt="Android"===Yt.platform,Ot=Boolean(Yt.brands.find(e=>"Microsoft Edge"===e.brand)),Rt=Boolean(Yt.brands.find(e=>"Chromium"===e.brand)),Ut=!Ot&&Rt,Bt=Ft=(Yt.brands.find(e=>"Chromium"===e.brand)||{}).version||null,Ht="Windows"===Yt.platform),!Rt){const e=n().navigator&&n().navigator.userAgent||"";Dt=/iPod/i.test(e),Lt=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Mt=/Android/i.test(e),Pt=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),s=t[2]&&parseFloat(t[2]);return i&&s?parseFloat(t[1]+"."+t[2]):i||null}(),Nt=/Firefox/i.test(e),Ot=/Edg/i.test(e),Rt=/Chrome/i.test(e)||/CriOS/i.test(e),Ut=!Ot&&Rt,Bt=Ft=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),qt=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),Wt=/Tizen/i.test(e),Gt=/Web0S/i.test(e),Xt=Wt||Gt,$t=/Safari/i.test(e)&&!Ut&&!Mt&&!Ot&&!Xt,Ht=/Windows/i.test(e),zt=/iPad/i.test(e)||$t&&Kt&&!/iPhone/i.test(e),Vt=/iPhone/i.test(e)&&!zt}const Qt=Vt||zt||Dt,Zt=($t||Qt)&&!Ut;var Jt=Object.freeze({__proto__:null,get IS_IPOD(){return Dt},get IOS_VERSION(){return Lt},get IS_ANDROID(){return Mt},get ANDROID_VERSION(){return Pt},get IS_FIREFOX(){return Nt},get IS_EDGE(){return Ot},get IS_CHROMIUM(){return Rt},get IS_CHROME(){return Ut},get CHROMIUM_VERSION(){return Bt},get CHROME_VERSION(){return Ft},IS_CHROMECAST_RECEIVER:jt,get IE_VERSION(){return qt},get IS_SAFARI(){return $t},get IS_WINDOWS(){return Ht},get IS_IPAD(){return zt},get IS_IPHONE(){return Vt},get IS_TIZEN(){return Wt},get IS_WEBOS(){return Gt},get IS_SMART_TV(){return Xt},TOUCH_ENABLED:Kt,IS_IOS:Qt,IS_ANY_SAFARI:Zt});function ei(e){return"string"==typeof e&&Boolean(e.trim())}function ti(){return a()===n().document}function ii(e){return wt(e)&&1===e.nodeType}function si(){try{return n().parent!==n().self}catch(e){return!0}}function ni(e){return function(t,i){if(!ei(t))return a()[e](null);ei(i)&&(i=a().querySelector(i));const s=ii(i)?i:a();return s[e]&&s[e](t)}}function ri(e="div",t={},i={},s){const n=a().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){const i=t[e];"textContent"===e?ai(n,i):n[e]===i&&"tabIndex"!==e||(n[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),s&&ki(n,s),n}function ai(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function oi(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function li(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function ci(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function ui(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(_t.warn("removeClass was called with an element that doesn't exist"),null)}function di(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function hi(e,t){Object.getOwnPropertyNames(t).forEach(function(i){const s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s)})}function pi(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let e=s.length-1;e>=0;e--){const n=s[e].name;let r=s[e].value;i.includes(n)&&(r=null!==r),t[n]=r}}return t}function mi(e,t){return e.getAttribute(t)}function gi(e,t,i){e.setAttribute(t,i)}function fi(e,t){e.removeAttribute(t)}function yi(){a().body.focus(),a().onselectstart=function(){return!1}}function _i(){a().onselectstart=function(){return!0}}function vi(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(Pi(e,"height"))),i.width||(i.width=parseFloat(Pi(e,"width"))),i}}function bi(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let s=0,n=0;for(;e.offsetParent&&e!==a()[pt.fullscreenElement];)s+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:s,top:n,width:t,height:i}}function Ti(e,t){const i={x:0,y:0};if(Qt){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Pi(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&n().WebKitCSSMatrix){const e=n().getComputedStyle(t.assignedSlot.parentElement).transform,s=new(n().WebKitCSSMatrix)(e);i.x+=s.m41,i.y+=s.m42}t=t.parentNode||t.host}}const s={},r=bi(t.target),a=bi(e),o=a.width,l=a.height;let c=t.offsetY-(a.top-r.top),u=t.offsetX-(a.left-r.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-a.left,c=t.changedTouches[0].pageY+a.top,Qt&&(u-=i.x,c-=i.y)),s.y=1-Math.max(0,Math.min(1,c/l)),s.x=Math.max(0,Math.min(1,u/o)),s}function Si(e){return wt(e)&&3===e.nodeType}function Ci(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function wi(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),ii(e)||Si(e)?e:"string"==typeof e&&/\S/.test(e)?a().createTextNode(e):void 0)).filter(e=>e)}function ki(e,t){return wi(t).forEach(t=>e.appendChild(t)),e}function Ei(e,t){return ki(Ci(e),t)}function xi(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||"mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const Ii=ni("querySelector"),Ai=ni("querySelectorAll");function Pi(e,t){if(!e||!t)return"";if("function"==typeof n().getComputedStyle){let i;try{i=n().getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function Di(e){[...a().styleSheets].forEach(t=>{try{const i=[...t.cssRules].map(e=>e.cssText).join(""),s=a().createElement("style");s.textContent=i,e.document.head.appendChild(s)}catch(i){const s=a().createElement("link");s.rel="stylesheet",s.type=t.type,s.media=t.media.mediaText,s.href=t.href,e.document.head.appendChild(s)}})}var Li=Object.freeze({__proto__:null,isReal:ti,isEl:ii,isInFrame:si,createEl:ri,textContent:ai,prependTo:oi,hasClass:li,addClass:ci,removeClass:ui,toggleClass:di,setAttributes:hi,getAttributes:pi,getAttribute:mi,setAttribute:gi,removeAttribute:fi,blockTextSelection:yi,unblockTextSelection:_i,getBoundingClientRect:vi,findPosition:bi,getPointerPosition:Ti,isTextNode:Si,emptyEl:Ci,normalizeContent:wi,appendContent:ki,insertContent:Ei,isSingleLeftClick:xi,$:Ii,$$:Ai,computedStyle:Pi,copyStyleSheetsToWindow:Di});let Mi,Ni=!1;const Oi=function(){if(!1===Mi.options.autoSetup)return;const e=Array.prototype.slice.call(a().getElementsByTagName("video")),t=Array.prototype.slice.call(a().getElementsByTagName("audio")),i=Array.prototype.slice.call(a().getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e<t;e++){const t=s[e];if(!t||!t.getAttribute){Ri(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&Mi(t)}else Ni||Ri(1)};function Ri(e,t){ti()&&(t&&(Mi=t),n().setTimeout(Oi,e))}function Ui(){Ni=!0,n().removeEventListener("load",Ui)}ti()&&("complete"===a().readyState?Ui():n().addEventListener("load",Ui));const Bi=function(e){const t=a().createElement("style");return t.className=e,t},Fi=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var ji=new WeakMap;let qi,$i=3;function Hi(){return $i++}function zi(e,t){if(!ji.has(e))return;const i=ji.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&ji.delete(e)}function Vi(e,t,i,s){i.forEach(function(i){e(t,i,s)})}function Wi(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const s=e||n().event;e={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const t in s)r.includes(t)||"returnValue"===t&&s.preventDefault||(e[t]=s[t]);if(e.target||(e.target=e.srcElement||a()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=a().documentElement,i=a().body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Gi=["touchstart","touchmove"];function Xi(e,t,i){if(Array.isArray(t))return Vi(Xi,e,t,i);ji.has(e)||ji.set(e,{});const s=ji.get(e);if(s.handlers||(s.handlers={}),s.handlers[t]||(s.handlers[t]=[]),i.guid||(i.guid=Hi()),s.handlers[t].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(t,i){if(s.disabled)return;t=Wi(t);const n=s.handlers[t.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r&&!t.isImmediatePropagationStopped();n++)try{s[n].call(e,t,i)}catch(e){_t.error(e)}}}),1===s.handlers[t].length)if(e.addEventListener){let i=!1;(function(){if("boolean"!=typeof qi){qi=!1;try{const e=Object.defineProperty({},"passive",{get(){qi=!0}});n().addEventListener("test",null,e),n().removeEventListener("test",null,e)}catch(e){}}return qi})()&&Gi.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,s.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher)}function Ki(e,t,i){if(!ji.has(e))return;const s=ji.get(e);if(!s.handlers)return;if(Array.isArray(t))return Vi(Ki,e,t,i);const n=function(e,t){s.handlers[t]=[],zi(e,t)};if(void 0===t){for(const t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&n(e,t);return}const r=s.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);zi(e,t)}else n(e,t)}function Yi(e,t,i){const s=ji.has(e)?ji.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Wi(t),s.dispatcher&&s.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)Yi.call(null,n,t,i);else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){ji.has(t.target)||ji.set(t.target,{});const e=ji.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function Qi(e,t,i){if(Array.isArray(t))return Vi(Qi,e,t,i);const s=function(){Ki(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Hi(),Xi(e,t,s)}function Zi(e,t,i){const s=function(){Ki(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Hi(),Xi(e,t,s)}var Ji=Object.freeze({__proto__:null,fixEvent:Wi,on:Xi,off:Ki,trigger:Yi,one:Qi,any:Zi});const es=30,ts=function(e,t,i){t.guid||(t.guid=Hi());const s=t.bind(e);return s.guid=i?i+"_"+t.guid:t.guid,s},is=function(e,t){let i=n().performance.now();return function(...s){const r=n().performance.now();r-i>=t&&(e(...s),i=r)}},ss=function(e,t,i,s=n()){let r;const a=function(){const n=this,a=arguments;let o=function(){r=null,o=null,i||e.apply(n,a)};!r&&i&&e.apply(n,a),s.clearTimeout(r),r=s.setTimeout(o,t)};return a.cancel=()=>{s.clearTimeout(r),r=null},a};var ns=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:es,bind_:ts,throttle:is,debounce:ss});let rs;class as{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Xi(this,e,t),this.addEventListener=i}off(e,t){Ki(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Qi(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Zi(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Wi(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Yi(this,e)}queueTrigger(e){rs||(rs=new Map);const t=e.type||e;let i=rs.get(this);i||(i=new Map,rs.set(this,i));const s=i.get(t);i.delete(t),n().clearTimeout(s);const r=n().setTimeout(()=>{i.delete(t),0===i.size&&(i=null,rs.delete(this)),this.trigger(e)},0);i.set(t,r)}}as.prototype.allowedEvents_={},as.prototype.addEventListener=as.prototype.on,as.prototype.removeEventListener=as.prototype.off,as.prototype.dispatchEvent=as.prototype.trigger;const os=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,ls=e=>e instanceof as||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),cs=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,us=(e,t,i)=>{if(!e||!e.nodeName&&!ls(e))throw new Error(`Invalid target for ${os(t)}#${i}; must be a DOM node or evented object.`)},ds=(e,t,i)=>{if(!cs(e))throw new Error(`Invalid event type for ${os(t)}#${i}; must be a non-empty string or array.`)},hs=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${os(t)}#${i}; must be a function.`)},ps=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n,r,a;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):(n=t[0],r=t[1],a=t[2]),us(n,e,i),ds(r,e,i),hs(a,e,i),a=ts(e,a),{isTargetingSelf:s,target:n,type:r,listener:a}},ms=(e,t,i,s)=>{us(e,e,t),e.nodeName?Ji[t](e,i,s):e[t](i,s)},gs={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=ps(this,e,"on");if(ms(i,"on",s,n),!t){const e=()=>this.off(i,s,n);e.guid=n.guid;const t=()=>this.off("dispose",e);t.guid=n.guid,ms(this,"on","dispose",e),ms(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=ps(this,e,"one");if(t)ms(i,"one",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,ms(i,"one",s,e)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=ps(this,e,"any");if(t)ms(i,"any",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,ms(i,"any",s,e)}},off(e,t,i){if(!e||cs(e))Ki(this.eventBusEl_,e,t);else{const s=e,n=t;us(s,this,"off"),ds(n,this,"off"),hs(i,this,"off"),i=ts(this,i),this.off("dispose",i),s.nodeName?(Ki(s,n,i),Ki(s,"dispose",i)):ls(s)&&(s.off(n,i),s.off("dispose",i))}},trigger(e,t){us(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!cs(i))throw new Error(`Invalid event type for ${os(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Yi(this.eventBusEl_,e,t)}};function fs(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=ri("span",{className:"vjs-event-bus"});return Object.assign(e,gs),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&ji.has(e)&&ji.delete(e)}),n().setTimeout(()=>{e.eventBusEl_=null},0)}),e}const ys={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),St(e,(e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&ls(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function _s(e,t){return Object.assign(e,ys),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&ls(e)&&e.on("statechanged",e.handleStateChanged),e}const vs=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},bs=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},Ts=function(e,t){return bs(e)===bs(t)};var Ss=Object.freeze({__proto__:null,toLowerCase:vs,toTitleCase:bs,titleCaseEquals:Ts});class Cs{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Et({},this.options_),t=this.options_=Et(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Hi()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(fs(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),_s(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Et(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ri(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[s],a=s&&s.split("-")[0],o=n&&n[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){const s=t[i-1];let n=s;return void 0===s&&(n=e),n})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",s=ri("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=a().createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=a().createElementNS(i,"use");return n.appendChild(r),r.setAttributeNS(null,"href",`#vjs-icon-${e}`),s.appendChild(n),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},i=this.children_.length){let s,n;if("string"==typeof e){n=bs(e);const i=t.componentClass||n;t.name=n;const r=Cs.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;s=new r(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),n=n||s.name&&bs(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[vs(n)]=s),"function"==typeof s.el&&s.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:ii(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(s.el(),e)}return s}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[bs(e.name())]=null,this.childNameIndex_[vs(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let s=e.opts;if(void 0!==t[i]&&(s=t[i]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);n&&(this[i]=n)};let s;const n=Cs.getComponent("Tech");s=Array.isArray(e)?e:Object.keys(e),s.concat(Object.keys(this.options_).filter(function(e){return!s.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,s;return"string"==typeof t?(i=t,s=e[i]||this.options_[i]||{}):(i=t.name,s=t),{name:i,opts:s}}).filter(e=>{const t=Cs.getComponent(e.opts.componentClass||bs(e.name));return t&&!n.isTech(t)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return Ii(e,t||this.contentEl())}$$(e,t){return Ai(e,t||this.contentEl())}hasClass(e){return li(this.el_,e)}addClass(...e){ci(this.el_,...e)}removeClass(...e){ui(this.el_,...e)}toggleClass(e,t){di(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return mi(this.el_,e)}setAttribute(e,t){gi(this.el_,e,t)}removeAttribute(e){fi(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,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;const s=this.el_.style[e],n=s.indexOf("px");return-1!==n?parseInt(s.slice(0,n),10):parseInt(this.el_["offset"+bs(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Pi(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${bs(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",function(s){1===s.touches.length&&(i={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},t=n().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){const s=t.touches[0].pageX-i.pageX,n=t.touches[0].pageY-i.pageY;Math.sqrt(s*s+n*n)>10&&(e=!1)}});const s=function(){e=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",function(s){i=null,!0===e&&n().performance.now()-t<200&&(s.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ts(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=ts(this,e),this.clearTimersOnDispose_(),i=n().setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),n().clearTimeout(e)),e}setInterval(e,t){e=ts(this,e),this.clearTimersOnDispose_();const i=n().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),n().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=ts(this,e),t=n().requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=ts(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),n().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){const t=n().getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;const t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0)return!1;if(t.x>(a().documentElement.clientWidth||n().innerWidth))return!1;if(t.y<0)return!1;if(t.y>(a().documentElement.clientHeight||n().innerHeight))return!1;let i=a().elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)&&(i=e,t(i.parentElement)&&t(i)&&"0"!==i.style.opacity&&"0px"!==n().getComputedStyle(i).height&&"0px"!==n().getComputedStyle(i).width)&&(!e.parentElement||e.tabIndex>=0));var i}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Cs.getComponent("Tech"),s=i&&i.isTech(t),n=Cs===t||Cs.prototype.isPrototypeOf(t.prototype);if(s||!n){let t;throw t=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=bs(e),Cs.components_||(Cs.components_={});const r=Cs.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0)for(let i=0;i<t.length;i++)if(null!==e[t[i]])throw new Error("Can not register Player component after player has been created.")}return Cs.components_[e]=t,Cs.components_[vs(e)]=t,t}static getComponent(e){if(e&&Cs.components_)return Cs.components_[e]}}function ws(e,t,i,s){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,s,i.length-1),i[s][t]}function ks(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ws.bind(null,"start",0,e),end:ws.bind(null,"end",1,e)},n().Symbol&&n().Symbol.iterator&&(t[n().Symbol.iterator]=()=>(e||[]).values()),t}function Es(e,t){return Array.isArray(e)?ks(e):void 0===e||void 0===t?ks():ks([[e,t]])}Cs.registerComponent("Component",Cs);const xs=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),s=Math.floor(e/60%60),n=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=s=i="-"),n=n>0||a>0?n+":":"",s=((n||r>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,n+s+i};let Is=xs;function As(e){Is=e}function Ps(){Is=xs}function Ds(e,t=e){return Is(e,t)}var Ls=Object.freeze({__proto__:null,createTimeRanges:Es,createTimeRange:Es,setFormatTime:As,resetFormatTime:Ps,formatTime:Ds});function Ms(e,t){let i,s,n=0;if(!t)return 0;e&&e.length||(e=Es(0,0));for(let r=0;r<e.length;r++)i=e.start(r),s=e.end(r),s>t&&(s=t),n+=s-i;return n/t}function Ns(e){if(e instanceof Ns)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:wt(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Ns.defaultMessages[this.code]||"")}function Os(e){return null!=e&&"function"==typeof e.then}function Rs(e){Os(e)&&e.then(null,e=>{})}Ns.prototype.code=0,Ns.prototype.message="",Ns.prototype.status=null,Ns.prototype.metadata=null,Ns.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Ns.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."},Ns.MEDIA_ERR_CUSTOM=0,Ns.prototype.MEDIA_ERR_CUSTOM=0,Ns.MEDIA_ERR_ABORTED=1,Ns.prototype.MEDIA_ERR_ABORTED=1,Ns.MEDIA_ERR_NETWORK=2,Ns.prototype.MEDIA_ERR_NETWORK=2,Ns.MEDIA_ERR_DECODE=3,Ns.prototype.MEDIA_ERR_DECODE=3,Ns.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ns.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ns.MEDIA_ERR_ENCRYPTED=5,Ns.prototype.MEDIA_ERR_ENCRYPTED=5;const Us=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,s)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var Bs=Us;const Fs="vjs-modal-dialog";class js extends Cs{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ri("div",{className:`${Fs}-content`},{role:"document"}),this.descEl_=ri("p",{className:`${Fs}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ai(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Fs} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Ei(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Ci(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=a().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let e=0;e<t.length;e++)if(i===t[e]){s=e;break}a().activeElement===this.el_&&(s=0),e.shiftKey&&0===s?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||s!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof n().HTMLAnchorElement||e instanceof n().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof n().HTMLInputElement||e instanceof n().HTMLSelectElement||e instanceof n().HTMLTextAreaElement||e instanceof n().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof n().HTMLIFrameElement||e instanceof n().HTMLObjectElement||e instanceof n().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}js.prototype.options_={pauseOnOpen:!0,temporary:!0},Cs.registerComponent("ModalDialog",js);class qs extends as{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},ls(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}qs.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in qs.prototype.allowedEvents_)qs.prototype["on"+e]=null;const $s=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class Hs extends qs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){$s(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&$s(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,$s(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const zs=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class Vs extends qs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){zs(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&zs(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,zs(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Ws extends qs{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class Gs{constructor(e){Gs.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e,this.length_=e.length;const n=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<s)for(i=t;i<s;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}const Xs={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Ks={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ys={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Qs={disabled:"disabled",hidden:"hidden",showing:"showing"};class Zs extends as{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Hi(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const Js=function(e){return new URL(e,a().baseURI)},en=function(e){return new URL(e,a().baseURI).href},tn=function(e){if("string"==typeof e){const t=e.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},sn=function(e,t=n().location){return Js(e).origin!==t.origin};var nn=Object.freeze({__proto__:null,parseUrl:Js,getAbsoluteURL:en,getFileExtension:tn,isCrossOrigin:sn});const rn=function(e,t){const i=new(n().WebVTT.Parser)(n(),n().vttjs,n().WebVTT.StringDecoder()),s=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){s.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),s.length>0&&(n().console&&n().console.groupCollapsed&&n().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),s.forEach(e=>_t.error(e)),n().console&&n().console.groupEnd&&n().console.groupEnd()),i.flush()},an=function(e,t){const i={uri:e},s=sn(e);s&&(i.cors=s);const r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),l()(i,ts(this,function(e,i,s){if(e)return _t.error(e,i);t.loaded_=!0,"function"!=typeof n().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return rn(s,t);_t.error(`vttjs failed to load, stopping trying to process ${t.src}`)}):rn(s,t)}))};class on extends Zs{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Et(e,{kind:Ys[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Qs[t.mode]||"disabled";const s=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const n=new Gs(this.cues_),r=new Gs(this.activeCues_);let a=!1;this.timeupdateHandler=ts(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>s,set(){}},mode:{get:()=>i,set(e){Qs[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||an(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const e=this.tech_.currentTime(),t=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];s.startTime<=e&&s.endTime>=e&&t.push(s)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,r.setCues_(this.activeCues_),r},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&an(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(n().vttjs.VTTCue)(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Bs(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}on.prototype.allowedEvents_={cuechange:"cuechange"};class ln extends Zs{constructor(e={}){const t=Et(e,{kind:Ks[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class cn extends Zs{constructor(e={}){const t=Et(e,{kind:Xs[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class un extends as{constructor(e={}){let t;super();const i=new on(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=un.NONE,i.addEventListener("loadeddata",()=>{t=un.LOADED,this.trigger({type:"load",target:this})})}}un.prototype.allowedEvents_={load:"load"},un.NONE=0,un.LOADING=1,un.LOADED=2,un.ERROR=3;const dn={audio:{ListClass:Hs,TrackClass:ln,capitalName:"Audio"},video:{ListClass:Vs,TrackClass:cn,capitalName:"Video"},text:{ListClass:Ws,TrackClass:on,capitalName:"Text"}};Object.keys(dn).forEach(function(e){dn[e].getterName=`${e}Tracks`,dn[e].privateName=`${e}Tracks_`});const hn={remoteText:{ListClass:Ws,TrackClass:on,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}
vendor: 3,729 bytes, line 2
2),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:un,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},pn=Object.assign({},dn,hn);hn.names=Object.keys(hn),dn.names=Object.keys(dn),pn.names=[].concat(hn.names).concat(dn.names);class mn extends Cs{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),pn.names.forEach(t=>{const i=pn[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new pn.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ts(this,function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Es(0,0)}bufferedPercent(){return Ms(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(dn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}
vendor: 8,963 bytes, line 2
2clearTracks(e){(e=[].concat(e)).forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const s=t[i];"text"===e&&this.removeRemoteTextTrack(s),t.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Ns(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Es(0,0):Es()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){dn.names.forEach(e=>{const t=dn[e],i=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!n().WebVTT)if(a().body.contains(this.el())){if(!this.options_["vtt.js"]&&kt(u())&&Object.keys(u()).length>0)return void this.trigger("vttjsloaded");const e=a().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),n().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),s=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),r=()=>{n();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",n),"showing"===i.mode&&i.addEventListener("cuechange",n)}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",s),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,s,n={}){const r=e.textTracks();n.kind=t,i&&(n.label=i),s&&(n.language=s),n.tech=e;const a=new pn.text.TrackClass(n);return r.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=Et(e,{tech:this});return new hn.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Hi();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return mn.canPlayType(e.type)}static isTech(e){return e.prototype instanceof mn||e instanceof mn||e===mn}static registerTech(e,t){if(mn.techs_||(mn.techs_={}),!mn.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!mn.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!mn.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=bs(e),mn.techs_[e]=t,mn.techs_[vs(e)]=t,"Tech"!==e&&mn.defaultTechOrder_.push(e),t}static getTech(e){if(e)return mn.techs_&&mn.techs_[e]?mn.techs_[e]:(e=bs(e),n()&&n().videojs&&n().videojs[e]?(_t.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),n().videojs[e]):void 0)}}pn.names.forEach(function(e){const t=pn[e];mn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),mn.prototype.featuresVolumeControl=!0,mn.prototype.featuresMuteControl=!0,mn.prototype.featuresFullscreenResize=!1,mn.prototype.featuresPlaybackRate=!1,mn.prototype.featuresProgressEvents=!1,mn.prototype.featuresSourceset=!1,mn.prototype.featuresTimeupdateEvents=!1,mn.prototype.featuresNativeTextTracks=!1,mn.prototype.featuresVideoFrameCallback=!1,mn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;s||(s=e.sourceHandlers=[]),void 0===i&&(i=s.length),s.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let s;for(let e=0;e<i.length;e++)if(s=i[e].canPlayType(t),s)return s;return""},e.selectSourceHandler=function(t,i){const s=e.sourceHandlers||[];let n;for(let e=0;e<s.length;e++)if(n=s[e].canHandleSource(t,i),n)return s[e];return null},e.canPlaySource=function(t,i){const s=e.selectSourceHandler(t,i);return s?s.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:_t.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Cs.registerComponent("Tech",mn),mn.registerTech("Tech",mn),mn.defaultTechOrder_=[];const gn={},fn={},yn={};function _n(e,t,i){e.setTimeout(()=>wn(t,gn[t.type],i,e),1)}function vn(e,t,i,s=null){const n="call"+bs(i),r=e.reduce(Cn(n),s),a=r===yn,o=a?null:t[i](r);return function(e,t,i,s){for(let n=e.length-1;n>=0;n--){const r=e[n];r[t]&&r[t](s,i)}}(e,i,o,a),o}const bn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Tn={setCurrentTime:1,setMuted:1,setVolume:1},Sn={play:1,pause:1};function Cn(e){return(t,i)=>t===yn?yn:i[e]?i[e](t):t}function wn(e={},t=[],i,s,n=[],r=!1){const[a,...o]=t;if("string"==typeof a)wn(e,gn[a],i,s,n,r);else if(a){const t=function(e,t){const i=fn[e.id()];let s=null;if(null==i)return s=t(e),fn[e.id()]=[[t,s]],s;for(let e=0;e<i.length;e++){const[n,r]=i[e];n===t&&(s=r)}return null===s&&(s=t(e),i.push([t,s])),s}(s,a);if(!t.setSource)return n.push(t),wn(e,o,i,s,n,r);t.setSource(Object.assign({},e),function(a,l){if(a)return wn(e,o,i,s,n,r);n.push(t),wn(l,e.type===l.type?o:gn[l.type],i,s,n,r)})}else o.length?wn(e,o,i,s,n,r):r?i(e,n):wn(e,gn["*"],i,s,n,!0)}const kn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},En=function(e=""){const t=tn(e);return kn[t.toLowerCase()]||""},xn=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=xn(e),Array.isArray(e)?t=t.concat(e):wt(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[In({src:e})]:wt(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[In(e)]:[];return e};function In(e){if(!e.type){const t=En(e.src);t&&(e.type=t)}return e}const An=Wt?10009:Gt?461:8,Pn={codes:{play:415,pause:19,ff:417,rw:412,back:An},names:{415:"play",19:"pause",417:"ff",412:"rw",[An]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){const t=this.codes[e.code];return this.names[t]}return null}};class Dn extends as{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}
vendor: 2,441 bytes, line 2
2start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const e=t.key.substring(5).toLowerCase();this.move(e)}else if(Pn.isEventKey(t,"play")||Pn.isEventKey(t,"pause")||Pn.isEventKey(t,"ff")||Pn.isEventKey(t,"rw")){t.preventDefault();const e=Pn.getEventName(t);this.performMediaAction_(e)}else Pn.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const s=this.getCurrentComponent(e.target);t&&(i=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(s&&"CloseButton"===s.name()?this.refocusComponent():(this.pause(),s&&s.el()&&(this.lastFocusedComponent_=s)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(e){for(const s of e)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&t.pu
vendor: 2,493 bytes, line 2
2sh(s),s.hasOwnProperty("children_")&&s.children_.length>0&&i(s.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){const i=e.el_.querySelector(".vjs-errors-ok-button-container");i&&i.querySelectorAll("button").forEach((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{const t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){const s=t(i.children[e]);if(s)return s}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length)for(const e of this.focusableComponents)if(e.el()===t)return e}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),s=this.focusableComponents.filter(s=>s!==t&&this.isInDirection_(i.boundingClientRect,s.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,s,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focu
vendor: 5,406 bytes, line 2
2sedComponent:t})}findBestCandidate_(e,t,i){let s=1/0,n=null;for(const r of t){const t=r.getPositions().center,a=this.calculateDistance_(e,t,i);a<s&&(s=a,n=r)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const s=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let r;switch(i){case"right":case"left":r=s+100*n;break;case"up":r=2*n+.5*s;break;case"down":r=5*n+s;break;default:r=s+n}return r}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if("TextTrackSelect"===t.constructor.name){e.focus(t);break}}}Cs.registerComponent("MediaLoader",class extends Cs{constructor(e,t,i){if(super(e,Et({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,s=t.playerOptions.techOrder;i<s.length;i++){const t=bs(s[i]);let n=mn.getTech(t);if(t||(n=Cs.getComponent(t)),n&&n.isSupported()){e.loadTech_(t);break}}}});class Ln extends Cs{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&_t.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const s=ri(e,t,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(ri("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ri("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,ai(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Cs.registerComponent("ClickableComponent",Ln);class Mn extends Ln{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ri("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ri("picture",{className:"vjs-poster",tabIndex:-1},{},ri("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Rs(this.player_.play()):this.player_.pause())}}Mn.prototype.crossorigin=Mn.prototype.crossOrigin,Cs.registerComponent("PosterImage",Mn);const Nn="#222",On="#ccc",Rn={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',
vendor: 32,934 bytes, line 2
2script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Un(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Bn(e,t,i){try{e.style[t]=i}catch(e){return}}function Fn(e){return e?`${e}px`:""}Cs.registerComponent("TextTrackDisplay",class extends Cs{constructor(e,t,i){super(e,t,i);const s=e=>this.updateDisplay(e),r=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("useractive",s),e.on("userinactive",s),e.on("texttrackchange",s),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(ts(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",r),e.on("playerresize",r);const t=n().screen.orientation||n(),i=n().screen.orientation?"change":"orientationchange";t.addEventListener(i,r),e.on("dispose",()=>t.removeEventListener(i,r));const s=this.options_.playerOptions.tracks||[];for(let e=0;e<s.length;e++)this.player_.addRemoteTextTrack(s[e],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,n,r;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?r=o:r||(r=o):i&&!i.enabled?(r=null,s=null,n=null):o.default&&("descriptions"!==o.kind||s?o.kind in e&&!n&&(n=o):s=o)}r?r.mode="showing":n?n.mode="showing":s&&(s.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof n().WebVTT&&n().WebVTT.processCues(n(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const s=e[i];"showing"===s.mode&&t.push(s)}return void this.updateForTrack(t)}let i=null,s=null,r=e.length;for(;r--;){const t=e[r];"showing"===t.mode&&("descriptions"===t.kind?i=t:s=t)}if(s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),void 0===n().CSS||!n().CSS.supports("inset","10px")){const e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,s=this.player_.el_.getBoundingClientRect().height;e.style="",Bn(e,"position","relative"),Bn(e,"height",s-i+"px"),Bn(e,"top","unset"),Bn(e,"bottom",Xt?s+"px":"0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){const t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||void 0===n().CSS||!n().CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,s=this.player_.videoWidth()/this.player_.videoHeight();let r=0,a=0;Math.abs(i-s)>.1&&(i>s?r=Math.round((e-t*s)/2):a=Math.round((t-e/s)/2)),Bn(this.el_,"insetInline",Fn(r)),Bn(this.el_,"insetBlock",Fn(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let s=i.length;for(;s--;){const e=i[s];if(!e)continue;const r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Bn(r.firstChild,"color",Un(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Bn(r.firstChild,"backgroundColor",Un(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Bn(r,"backgroundColor",Un(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${Nn}, 2px 2px 4px ${Nn}, 2px 2px 5px ${Nn}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Nn}, 2px 2px ${Nn}, 3px 3px ${Nn}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${On}, 0 1px ${On}, -1px -1px ${Nn}, 0 -1px ${Nn}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${Nn}, 0 0 4px ${Nn}, 0 0 4px ${Nn}, 0 0 4px ${Nn}`)),t.fontPercent&&1!==t.fontPercent){const e=n().parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Rn[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof n().WebVTT||e.every(e=>!e.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const s=e[i];for(let e=0;e<s.activeCues.length;++e)t.push(s.activeCues[e])}n().WebVTT.processCues(n(),t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const s=i.activeCues[e].displayState;ci(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&gi(s,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),Cs.registerComponent("LoadingSpinner",class extends Cs{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ri("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(i),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class jn extends Ln{createEl(e,t={},i={}){const s=ri("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||s.appendChild(ri("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){const i=this.constructor.name;return _t.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),Cs.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "!==e.key&&"Enter"!==e.key?super.handleKeyDown(e):e.stopPropagation()}}Cs.registerComponent("Button",jn);class qn extends jn{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e)return Rs(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if(!s)return void this.player_.tech(!0).focus();const n=()=>s.focus();Os(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}qn.prototype.controlText_="Play Video",Cs.registerComponent("BigPlayButton",qn),Cs.registerComponent("CloseButton",class extends jn{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class $n extends jn{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Rs(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}$n.prototype.controlText_="Play",Cs.registerComponent("PlayToggle",$n);class Hn extends Cs{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ri("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}Â `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ri("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Ds(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,_t.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=a().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Hn.prototype.labelText_="Time",Hn.prototype.controlText_="Time",Cs.registerComponent("TimeDisplay",Hn);class zn extends Hn{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime&&null!==e.target.pendingSeekTime()?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}zn.prototype.labelText_="Current Time",zn.prototype.controlText_="Current Time",Cs.registerComponent("CurrentTimeDisplay",zn);class Vn extends Hn{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Vn.prototype.labelText_="Duration",Vn.prototype.controlText_="Duration",Cs.registerComponent("DurationDisplay",Vn),Cs.registerComponent("TimeDivider",class extends Cs{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class Wn extends Hn{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(ri("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}Wn.prototype.labelText_="Remaining Time",Wn.prototype.controlText_="Remaining Time",Cs.registerComponent("RemainingTimeDisplay",Wn),Cs.registerComponent("LiveDisplay",class extends Cs{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ri("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ri("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}Â `})),this.contentEl_.appendChild(a().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class Gn extends jn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ri("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Xn(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}Gn.prototype.controlText_="Seek to live, currently playing live",Cs.registerComponent("SeekToLive",Gn);var Kn=Object.freeze({__proto__:null,clamp:Xn});class Yn extends Cs{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ut||e.preventDefault(),yi(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;_i(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Xn(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Ti(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,s=t&&t.horizontalSeek;i?s&&"ArrowLeft"===e.key||!s&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):s&&"ArrowRight"===e.key||!s&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Cs.registerComponent("Slider",Yn);const Qn=(e,t)=>Xn(e/t*100,0,100).toFixed(2)+"%";Cs.registerComponent("LoadProgressBar",class extends Cs{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ri("span",{className:"vjs-control-text"}),i=ri("span",{textContent:this.localize("Loaded")}),s=a().createTextNode(": ");return this.percentageEl_=ri("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),n=this.partEls_,r=Qn(s,i);this.percent_!==r&&(this.el_.style.width=r,ai(this.percentageEl_,r),this.percent_=r);for(let e=0;e<t.length;e++){const i=t.start(e),r=t.end(e);let a=n[e];a||(a=this.el_.appendChild(ri()),n[e]=a),a.dataset.start===i&&a.dataset.end===r||(a.dataset.start=i,a.dataset.end=r,a.style.left=Qn(i,s),a.style.width=Qn(r-i,s))}for(let e=n.length;e>t.length;e--)this.el_.removeChild(n[e-1]);n.length=t.length})}}),Cs.registerComponent("TimeTooltip",class extends Cs{constructor(e,t){super(e,t),this.update=is(ts(this,this.update),es)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=bi(this.el_),n=vi(this.player_.el()),r=e.width*t;if(!n||!s)return;let a=e.left-n.left+r,o=e.width-r+(n.right-e.right);o||(o=e.width-r,a=r);let l=s.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>s.width&&(l=s.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){ai(this.el_,e)}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;n=(i<1?"":"-")+Ds(i,e)}else n=Ds(i,r);this.update(e,t,n),s&&s()})}});class Zn extends Cs{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=is(ts(this,this.update),es)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const s=this.getChild("timeTooltip");if(!s)return;const n=i&&i.target&&"function"==typeof i.target.pendingSeekTime?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,n)}}Zn.prototype.options_={children:[]},Qt||Mt||Zn.prototype.options_.children.push("timeTooltip"),Cs.registerComponent("PlayProgressBar",Zn);class Jn extends Cs{constructor(e,t){super(e,t),this.update=is(ts(this,this.update),es)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}Jn.prototype.options_={children:["timeTooltip"]},Cs.registerComponent("MouseTimeDisplay",Jn);class er extends Yn{constructor(e,t){(t=Et(er.prototype.options_,t)).children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(Qt||Mt)||e.options_.disableSeekWhileScrubbingOnSTV;(!Qt&&!Mt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=ts(this,this.update),this.update=is(this.update_,es),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.on(a(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===a().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,es))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===a().visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let n=this.player_.duration();s&&s.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ds(i,n),Ds(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(vi(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(void 0!==e)if(null!==e){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){xi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!xi(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const s=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(s>=.99)return void n.seekToLiveEdge();const e=n.seekableStart(),t=n.liveCurrentTime();if(i=e+s*n.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=s*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Rs(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.off(a(),"visibilitychange",this.toggleVisibility_),super.dispose()}}er.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Cs.registerComponent("SeekBar",er);class tr extends Cs{constructor(e,t){super(e,t),this.handleMouseMove=is(ts(this,this.handleMouseMove),es),this.throttledHandleMouseSeek=is(ts(this,this.handleMouseSeek),es),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!i&&!s)return;const n=t.el(),r=bi(n);let a=Ti(n,e).x;a=Xn(a,0,1),s&&s.update(r,a),i&&i.update(r,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Rs(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}tr.prototype.options_={children:["seekBar"]},Cs.registerComponent("ProgressControl",tr);class ir extends jn{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){a().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in n()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof a().exitPictureInPicture&&super.show()}}ir.prototype.controlText_="Picture-in-Picture",Cs.registerComponent("PictureInPictureToggle",ir);class sr extends jn{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===a()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}sr.prototype.controlText_="Fullscreen",Cs.registerComponent("FullscreenToggle",sr),Cs.registerComponent("VolumeLevel",class extends Cs{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),Cs.registerComponent("VolumeLevelTooltip",class extends Cs{constructor(e,t){super(e,t),this.update=is(ts(this,this.update),es)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){const i=vi(this.el_),s=vi(this.player_.el()),n=e.width*t;if(!s||!i)return;const r=e.left-s.left+n,a=e.width-n+(s.right-e.right);let o=i.width/2;r<o?o+=o-r:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${s}%`)}write(e){ai(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0)),n&&n()})}});
vendor: 4,742 bytes, line 2
2class nr extends Cs{constructor(e,t){super(e,t),this.update=is(ts(this,this.update),es)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}nr.prototype.options_={children:["volumeLevelTooltip"]},Cs.registerComponent("MouseVolumeLevelDisplay",nr);class rr extends Yn{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){xi(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),s=vi(i),n=this.vertical();let r=Ti(i,e);r=n?r.y:r.x,r=Xn(r,0,1),t.update(s,r,n)}xi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Qt||Mt||rr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),rr.prototype.playerEvent="volumechange",Cs.registerComponent("VolumeBar",rr);class ar extends Cs{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||kt(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.throttledHandleMouseMove=is(ts(this,this.handleMouseMove),es),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ar.prototype.options_={children:["volumeBar"]},Cs.registerComponent("VolumeControl",ar);class or extends jn{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Qt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),ui(this.el_,[0,1,2,3].reduce((e,t)=>
vendor: 24,832 bytes, line 2
2e+`${t?" ":""}vjs-vol-${t}`,"")),ci(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}or.prototype.controlText_="Mute",Cs.registerComponent("MuteToggle",or);class lr extends Cs{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||kt(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Xi(a(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Ki(a(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}lr.prototype.options_={children:["muteToggle","volumeControl"]},Cs.registerComponent("VolumePanel",lr);class cr extends jn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=s?t+this.skipTime:s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}cr.prototype.controlText_="Skip Forward",Cs.registerComponent("SkipForward",cr);class ur extends jn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()&&i.seekableStart();let n;n=s&&t-this.skipTime<=s?s:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}ur.prototype.controlText_="Skip Backward",Cs.registerComponent("SkipBackward",ur);class dr extends Cs{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Cs&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Cs&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ri(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Xi(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||a().activeElement;if(!this.children().some(e=>e.el()===t)){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(t=>t.el()===e.target)[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Cs.registerComponent("Menu",dr);class hr extends Cs{constructor(e,t={}){super(e,t),this.menuButton_=new jn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=jn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Xi(a(),"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const 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.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new dr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ri("li",{className:"vjs-menu-title",textContent:bs(this.options_.title),tabIndex:-1}),i=new Cs(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${jn.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Ki(a(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){"Escape"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){"Escape"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Qt&&si())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Cs.registerComponent("MenuButton",hr);class pr extends hr{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const s=ts(this,this.update);i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s)})}}Cs.registerComponent("TrackButton",pr);class mr extends Ln{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=ri("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Cs.registerComponent("MenuItem",mr);class gr extends mr{constructor(e,t){const i=t.track,s=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),s.addEventListener("change",r),s.addEventListener("selectedlanguagechange",o),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],r),s.removeEventListener("change",r),s.removeEventListener("selectedlanguagechange",o)}),void 0===s.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof n().Event)try{e=new(n().Event)("change")}catch(e){}e||(e=a().createEvent("Event"),e.initEvent("change",!0,!0)),s.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const s=i[e];-1!==this.kinds.indexOf(s.kind)&&(s===t?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Cs.registerComponent("TextTrackMenuItem",gr);class fr extends gr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Cs.registerComponent("OffTextTrackMenuItem",fr);class yr extends pr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=gr){let i;this.label_&&(i=`${this.label_} off`),e.push(new fr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${n.kind}-menu-item`),e.push(i)}}return e}}Cs.registerComponent("TextTrackButton",yr);class _r extends mr{constructor(e,t){const i=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=i,this.cue=s}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Cs.registerComponent("ChaptersTrackMenuItem",_r);class vr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(bs(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i<s;i++){const s=t[i],n=new _r(this.player_,{track:this.track_,cue:s});e.push(n)}return e}}vr.prototype.kind_="chapters",vr.prototype.controlText_="Chapters",Cs.registerComponent("ChaptersButton",vr);class br extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const s=e.textTracks(),n=ts(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}br.prototype.kind_="descriptions",br.prototype.controlText_="Descriptions",Cs.registerComponent("DescriptionsButton",br);class Tr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Tr.prototype.kind_="subtitles",Tr.prototype.controlText_="Subtitles",Cs.registerComponent("SubtitlesButton",Tr);class Sr extends gr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Cs.registerComponent("CaptionSettingsMenuItem",Sr);class Cr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Cr.prototype.kind_="captions",Cr.prototype.controlText_="Captions",Cs.registerComponent("CaptionsButton",Cr);class wr extends gr{createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(ri("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ri("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}Cs.registerComponent("SubsCapsMenuItem",wr);class kr extends yr{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(bs(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,wr),e}}kr.prototype.kinds_=["captions","subtitles"],kr.prototype.controlText_="Subtitles",Cs.registerComponent("SubsCapsButton",kr);class Er extends mr{constructor(e,t){const i=t.track,s=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",n),this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ri("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ri("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Cs.registerComponent("AudioTrackMenuItem",Er);class xr extends pr{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const s=t[i];e.push(new Er(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e}}xr.prototype.controlText_="Audio Track",Cs.registerComponent("AudioTrackButton",xr);class Ir extends mr{constructor(e,t){const i=t.rate,s=parseFloat(i,10);t.label=i,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=s,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Ir.prototype.contentElType="button",Cs.registerComponent("PlaybackRateMenuItem",Ir);class Ar extends hr{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ri("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Ir(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Ar.prototype.controlText_="Playback Rate",Cs.registerComponent("PlaybackRateMenuButton",Ar);class Pr extends Cs{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Cs.registerComponent("Spacer",Pr),Cs.registerComponent("CustomControlSpacer",class extends Pr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}});class Dr extends Cs{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Dr.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Cs.registerComponent("ControlBar",Dr);class Lr extends js{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Lr.prototype.options_=Object.assign({}
vendor: 6,036 bytes, line 2
2,js.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Cs.registerComponent("ErrorDisplay",Lr);class Mr extends Cs{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ri("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Hi()}`)+"-"+e[1].replace(/\W+/g,""),i=ri("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}Cs.registerComponent("TextTrackSelect",Mr);class Nr extends Cs{constructor(e,t={}){super(e,t);const i=ri("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const s=this.options_.selects;for(const t of s){const i=this.options_.selectConfigs[t],s=i.className,n=i.id.replace("%s",this.options_.id_);let r=null;const a=`vjs_select_${Hi()}`;if("colors"===this.options_.type){r=ri("span",{className:s});const e=ri("label",{id:n,className:"vjs-label",textContent:this.localize(i.label)});e.setAttribute("for",a),r.appendChild(e)}const o=new Mr(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:n});this.addChild(o),"colors"===this.options_.type&&(r.appendChild(o.el()),this.el().appendChild(r))}}createEl(){return ri("fieldset",{className:this.options_.className})}}Cs.registerComponent("TextTrackFieldset",Nr);class Or extends Cs{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,s=new Nr(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const n=new Nr(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const r=new Nr(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r)}createEl(){return ri("div",{className:"vjs-track-settings-colors"})}}Cs.registerComponent("TextTrackSettingsColors",Or);class Rr extends Cs{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,s=new Nr(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const n=new Nr(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const r=new Nr(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r)}createEl(){return ri("div",{className:"vjs-track-settings-font"})}}Cs.registerComponent("TextTrackSettingsFont",Rr);class Ur extends Cs{constructor(e,t={}){super(e,t);const i=new jn(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const s=this.localize("Done"),n=new jn(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=s,this.addChild(n)}createEl(){return ri("div",{className:"vjs-track-settings-controls"})}}Cs.registerComponent("TrackSettingsControls",Ur);const Br="vjs-text-track-settings",Fr=["#000","Black"],jr=["#00F","Blue"],qr=["#0FF","Cyan"],$r=["#0F0","Green"],Hr=["#F0F","Magenta"],zr=["#F00","Red"],Vr=["#FFF","White"],Wr=["#FF0","Yellow"],Gr=["1","Opaque"],Xr=["0.5","Semi-Transparent"],Kr=["0","Transparent"],Yr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Fr,Vr,zr,$r,jr,Wr,Hr,qr],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Gr,Xr,Kr],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Vr,Fr,zr,$r,jr,Wr,Hr,qr],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Gr,Xr],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Kr,Xr,Gr],
vendor: 28,517 bytes, line 2
2className:"vjs-window-opacity vjs-opacity"}};function Qr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Yr.windowColor.options=Yr.backgroundColor.options,Cs.registerComponent("TextTrackSettings",class extends js{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=ri("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Or(e,{textTrackComponentid:this.id_,selectConfigs:Yr,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Rr(e,{textTrackComponentid:this.id_,selectConfigs:Yr,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const s=new Ur(e);this.addChild(s)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),St(Yr,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return Ct(Yr,(e,t,i)=>{const s=(n=this.$(t.selector),r=t.parser,Qr(n.options[n.options.selectedIndex].value,r));var n,r;return void 0!==s&&(e[i]=s),e},{})}setValues(e){St(Yr,(t,i)=>{!function(e,t,i){if(t)for(let s=0;s<e.options.length;s++)if(Qr(e.options[s].value,i)===t){e.selectedIndex=s;break}}(this.$(t.selector),e[i],t.parser)})}setDefaults(){St(Yr,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(n().localStorage.getItem(Br))}catch(e){_t.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?n().localStorage.setItem(Br,JSON.stringify(e)):n().localStorage.removeItem(Br)}catch(e){_t.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}),Cs.registerComponent("ResizeManager",class extends Cs{constructor(e,t){let i=t.ResizeObserver||n().ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,Et({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||n().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ss(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){Ki(this,"resize",e),Ki(this,"unload",t),t=null};Xi(this.el_.contentWindow,"unload",t),Xi(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Zr={trackingThreshold:20,liveTolerance:15};Cs.registerComponent("LiveTracker",class extends Cs{constructor(e,t){super(e,Et(Zr,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(n().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime(),r=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-r)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,es),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),Cs.registerComponent("TitleBar",class extends Cs{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ri("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Hi()}`}),description:ri("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Hi()}`})},ri("div",{className:"vjs-title-bar"},{},xt(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const s=this.state[e],n=this.els[e],r=i[e];Ci(n),s&&ai(n,s),t&&(t.removeAttribute(r),s&&t.setAttribute(r,n.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Jr={initialDisplay:4e3,position:[],takeFocus:!1};Cs.registerComponent("TransientButton",class extends jn{constructor(e,t){super(e,t=Et(Jr,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ri("button",{},{type:"button",class:this.buildCSSClass()},ri("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const ea=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),s=[];let n="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===s.indexOf(t)&&s.push(t)}return!!s.length&&(1===s.length&&(n=s[0]),e.triggerSourceset(n),!0)},ta=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=a().createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=a().createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",n().Element.prototype.appendChild.call(this,i),this.innerHTML}}),ia=(e,t)=>{let i={};for(let s=0;s<e.length&&(i=Object.getOwnPropertyDescriptor(e[s],t),!(i&&i.set&&i.get));s++);return i.enumerable=!0,i.configurable=!0,i},sa=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},s=(e=>ia([e.el(),n().HTMLMediaElement.prototype,n().Element.prototype,ta],"innerHTML"))(e),r=i=>(...s)=>{const n=i.apply(t,s);return ea(e),n};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))}),Object.defineProperty(t,"innerHTML",Et(s,{set:r(s.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",s)},e.one("sourceset",t.resetSourceWatch_)},na=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?en(n().Element.prototype.getAttribute.call(this,"src")):""},set(e){return n().Element.prototype.setAttribute.call(this,"src",e),e}});class ra extends mn{constructor(e,t){super(e,t);const i=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const n=e[t];"track"===n.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),this.textTracks().addTrack(n.track),s||this.el_.hasAttribute("crossorigin")||!sn(n.src)||(s=!0)):i.push(n))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&_t.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Kt||Vt)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),ra.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>ia([e.el(),n().HTMLMediaElement.prototype,na],"src"))(e),s=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Et(i,{set:s=>{const n=i.set.call(t,s);return e.triggerSourceset(t.src),n}})),t.setAttribute=(i,n)=>{const r=s.call(t,i,n);return/src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=()=>{const i=r.call(t);return ea(e)||(e.triggerSourceset(""),sa(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):ea(e)||sa(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=s,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const s=e[i];"metadata"===s.kind&&t.push({track:s,storedMode:s.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const s=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",s),e.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=dn[e],i=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:t=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i),"text"===e&&this[hn.remoteText.getterName]().trigger(i)},addtrack(e){s.addTrack(e.track)},removetrack(e){s.removeTrack(e.track)}},r=function(){const e=[];for(let t=0;t<s.length;t++){let n=!1;for(let e=0;e<i.length;e++)if(i[e]===s[t]){n=!0;break}n||e.push(s[t])}for(;e.length;)s.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(e=>{const t=n[e];i.addEventListener(e,t),this.on("dispose",s=>i.removeEventListener(e,t))}),this.on("loadstart",r),this.on("dispose",e=>this.off("loadstart",r))}proxyNativeTracks_(){dn.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),ra.disposeMediaElement(e),e=t}else{e=a().createElement("video");const t=Et({},this.options_.tag&&pi(this.options_.tag));Kt&&!0===this.options_.nativeControlsForTouch||delete t.controls,hi(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&gi(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const s=t[i],n=this.options_[s];void 0!==n&&(n?gi(e,s,s):fi(e,s),e[s]=n)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")})}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Zt?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){_t(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Mt&&Ut&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Rs(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return _t.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const s=ri("source",{},i);return this.el_.appendChild(s),!0}removeSourceElement(e){if(!e)return _t.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return _t.warn(`No matching source element found with src: ${e}`),!1}reset(){ra.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=a().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),n().performance&&(e.creationTime=n().performance.now()),e}}It(ra,"TEST_VID",function(){if(!ti())return;const e=a().createElement("video"),t=a().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),ra.isSupported=function(){try{ra.TEST_VID.volume=.5}catch(e){return!1}return!(!ra.TEST_VID||!ra.TEST_VID.canPlayType)},ra.canPlayType=function(e){return ra.TEST_VID.canPlayType(e)},ra.canPlaySource=function(e,t){return ra.canPlayType(e.type)},ra.canControlVolume=function(){try{const e=ra.TEST_VID.volume;ra.TEST_VID.volume=e/2+.1;const t=e!==ra.TEST_VID.volume;return t&&Qt?(n().setTimeout(()=>{ra&&ra.prototype&&(ra.prototype.featuresVolumeControl=e!==ra.TEST_VID.volume)}),!1):t}catch(e){return!1}},ra.canMuteVolume=function(){try{const e=ra.TEST_VID.muted;return ra.TEST_VID.muted=!e,ra.TEST_VID.muted?gi(ra.TEST_VID,"muted","muted"):fi(ra.TEST_VID,"muted"),e!==ra.TEST_VID.muted}catch(e){return!1}},ra.canControlPlaybackRate=function(){if(Mt&&Ut&&Ft<58)return!1;try{const e=ra.TEST_VID.playbackRate;return ra.TEST_VID.playbackRate=e/2+.1,e!==ra.TEST_VID.playbackRate}catch(e){return!1}},ra.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(a().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ra.supportsNativeTextTracks=function(){return Zt||Qt&&Ut},ra.supportsNativeVideoTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.videoTracks)},ra.supportsNativeAudioTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.audioTracks)},ra.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){It(ra.prototype,e,()=>ra[t](),!0)}),ra.prototype.featuresVolumeControl=ra.canControlVolume(),ra.prototype.movingMediaElementInDOM=!Qt,ra.prototype.featuresFullscreenResize=!0,ra.prototype.featuresProgressEvents=!0,ra.prototype.featuresTimeupdateEvents=!0,ra.prototype.featuresVideoFrameCallback=!(!ra.TEST_VID||!ra.TEST_VID.requestVideoFrameCallback),ra.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},ra.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){ra.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){ra.prototype["set"+bs(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){ra.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){ra.prototype["set"+bs(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){ra.prototype[e]=function(){return this.el_[e]()}}),mn.withSourceHandlers(ra),ra.nativeSourceHandler={},ra.nativeSourceHandler.canPlayType=function(e){try{return ra.TEST_VID.canPlayType(e)}catch(e){return""}},ra.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ra.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=tn(e.src);return ra.nativeSourceHandler.canPlayType(`video/${t}`)}return""},ra.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},ra.nativeSourceHandler.dispose=function(){},ra.registerSourceHandler(ra.nativeSourceHandler),mn.registerTech("Html5",ra);const aa=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],oa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},la=["tiny","xsmall","small","medium","large","xlarge","huge"],ca={};la.forEach(e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;ca[e]=`vjs-layout-${t}`});const ua={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class da extends Cs{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Hi()}`,(t=Object.assign(da.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=vt(this.id_),this.fsApi_=pt,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&pi(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=da.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),fs(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Xi(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=Et(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new(n().DOMParser)
vendor: 17,817 bytes, line 2
2).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))
vendor: 6,168 bytes, line 2
2_t.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Dn(this),this.addClass("vjs-spatial-navigation-enabled")),Kt&&this.addClass("vjs-touch-enabled"),Qt||this.addClass("vjs-workinghover"),da.players[this.id_]=this;const r=ct.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Ki(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ki(a(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),da.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),fn.hasOwnProperty(this.id())&&delete fn[this.id()],pn.names.forEach(e=>{const t=this[pn[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:s||(e=this.el_=super.createEl("div"));const r=pi(t);if(s){for(e=this.el_=t,t=this.tag=a().createElement("video");e.children.length;)t.appendChild(e.firstChild);li(e,"video-js")||ci(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch(e){}})}t.setAttribute("tabindex","-1"),r.tabindex="-1",Ut&&Ht&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach(function(i){s&&"class"===i||e.setAttribute(i,r[i]),s&&t.setAttribute(i,r[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const o=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>Jt[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...o),!0!==n().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Bi("vjs-styles-dimensions");const e=Ii(".vjs-styles-defaults"),t=Ii("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=t.getElementsByTagName("a");for(let e=0;e<l.length;e++){const t=l.item(e);ci(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),oi(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):_t.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const s=parseFloat(t);isNaN(s)?_t.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=s,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,ls(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},ls(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===n().VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,s;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const r=i.split(":"),a=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),Fi(this.styleEl_,`\n .${s}
2 {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${s}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*a}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=bs(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(mn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(n=!1);const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};pn.names.forEach(e=>{const t=pn[e];r[t.getterName]=this[t.privateName]}),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[s]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const a=mn.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);var o,l;this.tech_=new a(r),this.tech_.ready(ts(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],l=this.tech_,o.forEach(function(e){const t=l.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>t.addCue(e))}),l.textTracks(),aa.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${bs(e)}_`](t))}),Object.keys(oa).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${oa[e]}_`].bind(this),event:t}):this[`handleTech${oa[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||oi(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){pn.names.forEach(e=>{const t=pn[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){const t=Us(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===i.indexOf(e)}).map(Us))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&_t.warn("Using the tech directly can be dangerous. I hope you know
2what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":ct}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(Os(i))return i.catch(e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),Os(i)&&(i=i.catch(t))),Os(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;const s=e.$$("source");for(let e=0;e<s.length;e++){const i=s[e];if(i.type&&i.src&&i.src===t)return i.type}return En(t)})(this,t)),this.cache_.source=Et({},e,{src:t,type:i});const s=this.cache_.sources.filter(e=>e.src&&e.src===t),n=[],r=this.$$("source"),a=[];for(let e=0;e<r.length;e++){const i=pi(r[e]);n.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,s=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
vendor: 20,648 bytes, line 2
2handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Rs(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!a().pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let s=a()[this.fsApi_.fullscreenElement]===i;!s&&i.matches&&(s=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Tn)return function(e,t,i,s){return t[i](e.reduce(Cn(i),s))}(this.middleware_,this.tech_,e,t);if(e in Sn)return vn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw _t(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in bn)return function(e,t,i){return e.reduceRight(Cn(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Sn)return vn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw _t(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw _t(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw _t(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Rs){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(Zt||Qt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const s=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===s?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Es(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Es(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Es(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ms(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,s)=>{function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),i()}function a(e,t){n(),s(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(n,n),o.then(i,s))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function s(){e.off("fullscreenerror",r),e.off("fullscreenchange",n)}function n(){s(),t()}function r(e,t){s(),i(t)}e.one("fullscreenchange",n),e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();a&&(a.then(s,s),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=a()[this.fsApi_.exitFullscreen]();return e&&Rs(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a().documentElement.style.overflow,Xi(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow="hidden",ci(a().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Ki(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow=this.docOrigOverflow,ui(a().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&n().documentPictureInPicture){const e=a().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ri("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),n().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Di(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in a()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return n().documentPictureInPicture&&n().documentPictureInPicture.window?(n().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in a()?a().exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{const t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=t=>"f"===e.key.toLowerCase(),muteKey:s=t=>"m"===e.key.toLowerCase(),playPauseKey:n=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Cs.getComponent("FullscreenToggle");!1!==a()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),Cs.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Cs.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=mn.getTech(n);if(r||(r=Cs.getComponent(n)),r){if(r.isSupported()&&(t=r.canPlayType(e),t))return t}else _t.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map(e=>[e,mn.getTech(e)]).filter(([e,t])=>t?t.isSupported():(_t.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(e,t,i){let s;return e.some(e=>t.some(t=>{if(s=i(e,t),s)return!0})),s};let s;const n=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var r;return s=this.options_.sourceOrder?i(e,t,(r=n,(e,t)=>r(t,e))):i(t,e,n),s||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=xn(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),_n(this,i[0],(e,s)=>{if(this.middleware_=s,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());var n,r;n=s,r=this.tech_,n.forEach(e=>e.setTech&&e.setTech(r))}),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ts(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Rs(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ls(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(dt("beforeerror").forEach(t=>{const i=t(this,e);wt(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Ns(e),this.addClass("vjs-error"),_t.error(`(CODE:${this.error_.code} ${Ns.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),dt("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const s=ts(this,this.reportUserActivity),n=function(t){s(),this.clearInterval(e)};this.on("mousedown",function(){s(),this.clearInterval(e),e=this.setInterval(s,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,s())}),this.on("mouseup",n),this.on("mouseleave",n);const r=this.getChild("controlBar");let a;!r||Qt||Mt||(r.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),r.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}
vendor: 5,320 bytes, line 2
2),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ls(this)&&this.trigger("languagechange"))}languages(){return Et(da.prototype.options_.languages,this.languages_)}toJSON(){const e=Et(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let s=t[i];s=Et(s),s.player=void 0,e.tracks[i]=s}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new js(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<la.length;i++){const s=la[i];if(t<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(ca[e]),this.addClass(ca[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},ua,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return ca[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=Et(e);const{artist:s,artwork:n,description:r,poster:a,src:o,textTracks:l,title:c}=this.cache_.media;!n&&a&&(this.cache_.media.artwork=[{src:a,type:En(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:c,description:r||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:En(t.poster)}]),t}return Et(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=pi(e),s=i["data-setup"];if(li(e,"vjs-fill")&&(i.fill=!0),li(e,"vjs-fluid")&&(i.fluid=!0),null!==s)try{Object.assign(i,JSON.parse(s||"{}"))}catch(e){_t.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,s=i.length;e<s;e++){const s=i[e],n=s.nodeName.toLowerCase();"source"===n?t.sources.push(pi(s)):"track"===n&&t.tracks.push(pi(s))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}da.prototype.videoTracks=()=>{},da.prototype.audioTracks=()=>{},da.prototype.textTracks=()=>{},da.prototype.remoteTextTracks=()=>{},da.prototype.remoteTextTrackEls=()=>{}
vendor: 4,204 bytes, line 2
2,pn.names.forEach(function(e){const t=pn[e];da.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),da.prototype.crossorigin=da.prototype.crossOrigin,da.players={};const ha=n().navigator;da.prototype.options_={techOrder:mn.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ha&&(ha.languages&&ha.languages[0]||ha.userLanguage||ha.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},aa.forEach(function(e){da.prototype[`handleTech${bs(e)}_`]=function(){return this.trigger(e)}}),Cs.registerComponent("Player",da);const pa="plugin",ma="activePlugins_",ga={},fa=e=>ga.hasOwnProperty(e),ya=e=>fa(e)?ga[e]:void 0,_a=(e,t)=>{e[ma]=e[ma]||{},e[ma][t]=!0},va=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t),e.trigger(s+":"+t.name,t)},ba=(e,t)=>(t.prototype.name=e,function(...i){va(this,{name:e,plugin:t,instance:null},!0);const s=new t(...[this,...i]);return this[e]=()=>s,va(this,s.getEventHash()),s});class Ta{constructor(e){if(this.constructor===Ta)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),fs(this),delete this.trigger,_s(this,this.constructor.defaultState),_a(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Yi(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[ma][e]=!1,this.player=this.state=null,t[e]=ba(e,ga[e])}static isBasic(e){const t="string"==typeof e?ya(e):e;return"function"==typeof t&&!Ta.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(fa(e))_t.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(da.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ga[e]=t,e!==pa&&(Ta.isBasic(t)?da.prototype[e]=function(e,t){const i=function(){va(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return _a(this,e),va(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i}(e,t):da.prototype[e]=ba(e,t)),t}static deregisterPlugin(e){if(e===pa)throw new Error("Cannot de-register base plugin.");fa(e)&&(delete ga[e],delete da.prototype[e])}static getPlugins(e=Object.keys(ga)){let t;return e.forEach(e=>{const i=ya(e);i&&(t=t||{},t[e]=i)}),t}static getPluginVersion(e){const t=ya(e);return t&&t.VERSION||""}}function Sa(e,t,i,s){return function(e,t){let i=!1;return function(...s){return i||_t.warn(e),i=!0,t.apply(this,s)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}Ta.getPlugin=ya,Ta.BASE_PLUGIN_NAME=pa,Ta.registerPlugin(pa,Ta),da.prototype.usingPlugin=function(e){return!!this[ma]&&!0===this[ma][e]},da.prototype.hasPlugin=function(e){return!!fa(e)};const Ca=e=>0===e.indexOf("#")?e.slice(1):e;function wa(e,t,i){let s=wa.getPlayer(e);if(s)return t&&_t.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&s.ready(i),s;const r="string"==typeof e?Ii("#"+Ca(e)):e;if(!ii(r))throw new TypeError("The element or ID supplied is not val
2id. (videojs)");const a="getRootNode"in r&&r.getRootNode()instanceof n().ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&a.contains(r)||_t.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),dt("beforesetup").forEach(e=>{const i=e(r,Et(t));wt(i)&&!Array.isArray(i)?t=Et(t,i):_t.error("please return an object in beforesetup hooks")});const o=Cs.getComponent("Player");return s=new o(r,t,i),dt("setup").forEach(e=>e(s)),s}if(wa.hooks_=ut,wa.hooks=dt,wa.hook=function(e,t){dt(e,t)},wa.hookOnce=function(e,t){dt(e,[].concat(t).map(t=>{const i=(...s)=>(ht(e,i),t(...s));return i}))},wa.removeHook=ht,!0!==n().VIDEOJS_NO_DYNAMIC_STYLE&&ti()){let e=Ii(".vjs-styles-defaults");if(!e){e=Bi("vjs-styles-defaults");const t=Ii("head");t&&t.insertBefore(e,t.firstChild),Fi(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Ri(1,wa),wa.VERSION=ct,wa.options=da.prototype.options_,wa.getPlayers=()=>da.players,wa.getPlayer=e=>{const t=da.players;let i;if("string"==typeof e){const s=Ca(e),n=t[s];if(n)return n;i=Ii("#"+s)}else i=e;if(ii(i)){const{player:e,playerId:s}=i;if(e||t[s])return e||t[s]}},wa.getAllPlayers=()=>Object.keys(da.players).map(e=>da.players[e]).filter(Boolean),wa.players=da.players,wa.getComponent=Cs.getComponent,wa.registerComponent=(e,t)=>(mn.isTech(t)&&_t.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Cs.registerComponent.call(Cs,e,t)),wa.getTech=mn.getTech,wa.registerTech=mn.registerTech,wa.use=function(e,t){gn[e]=gn[e]||[],gn[e].push(t)},Object.defineProperty(wa,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(wa.middleware,"TERMINATOR",{value:yn,writeable:!1,enumerable:!0}),wa.browser=Jt,wa.obj=At,wa.mergeOptions=Sa(9,"videojs.mergeOptions","videojs.obj.merge",Et),wa.defineLazyProperty=Sa(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",It),wa.bind=Sa(9,"videojs.bind","native Function.prototype.bind",ts),wa.registerPlugin=Ta.registerPlugin,wa.deregisterPlugin=Ta.deregisterPlugin,wa.plugin=(e,t)=>(_t.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ta.registerPlugin(e,t)),wa.getPlugins=Ta.getPlugins,wa.getPlugin=Ta.getPlugin,wa.getPluginVersion=Ta.getPluginVersion,wa.addLanguage=function(e,t){return e=(""+e).toLowerCase(),wa.options.languages=Et(wa.options.languages,{[e]:t}),wa.options.languages[e]},wa.log=_t,wa.createLogger=vt,wa.time=Ls,wa.createTimeRange=Sa(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Es),wa.createTimeRanges=Sa(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Es),wa.formatTime=Sa(9,"videojs.formatTime","videojs.time.formatTime",Ds),wa.setFormatTime=Sa(9,"videojs.setFormatTime","videojs.time.setFormatTime",As),wa.resetFormatTime=Sa(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ps),wa.parseUrl=Sa(9,"videojs.parseUrl","videojs.url.parseUrl",Js),wa.isCrossOrigin=Sa(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",sn),wa.EventTarget=as,wa.any=Zi,wa.on=Xi,wa.one=Qi,wa.off=Ki,wa.trigger=Yi,wa.xhr=l(),wa.TrackList=qs,wa.TextTrack=on,wa.TextTrackList=Ws,wa.AudioTrack=ln,wa.AudioTrackList=Hs,wa.VideoTrack=cn,wa.VideoTrackList=Vs,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{wa[e]=function(){return _t.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Li[e].apply(null,arguments)}}),wa.computedStyle=Sa(9,"videojs.computedStyle","videojs.dom.computedStyle",Pi),wa.dom=Li,wa.fn=ns,wa.num=Kn,wa.str=Ss,wa.url=nn,wa.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};class ka{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class Ea extends wa.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new ka(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Ea.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in Ea.prototype.allowedEvents_)Ea.prototype["on"+e]=null;var xa="4.1.0";const Ia=function(e){return function(e){const t=e.qualityLevels,i=new Ea,s=function(){i.dispose(),e.qualityLevels=t,e.off("dispose",s)};return e.on("dispose",s),e.qualityLevels=()=>i,e.qualityLevels.VERSION=xa,i}(this,wa.obj.merge({},e))};
vendor: 7,079 bytes, line 2
2wa.registerPlugin("qualityLevels",Ia),Ia.VERSION=xa;const Aa=h,Pa=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Da=e=>wa.log.debug?wa.log.debug.bind(wa,"VHS:",`${e} >`):function(){};function La(...e){const t=wa.obj||wa;return(t.merge||t.mergeOptions).apply(t,e)}function Ma(...e){const t=wa.time||wa;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Na=1/30,Oa=.1,Ra=function(e,t){const i=[];let s;if(e&&e.length)for(s=0;s<e.length;s++)t(e.start(s),e.end(s))&&i.push([e.start(s),e.end(s)]);return Ma(i)},Ua=function(e,t){return Ra(e,function(e,i){return e-Oa<=t&&i+Oa>=t})},Ba=function(e,t){return Ra(e,function(e){return e-Na>=t})},Fa=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},ja=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},qa=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},$a=function(e,t){let i=0;if(!e||!e.length)return i;for(let s=0;s<e.length;s++){const n=e.start(s),r=e.end(s);t>r||(i+=t>n&&t<=r?r-t:r-n)}return i},Ha=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},za=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(s,n){e.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),Va=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Wa=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return s+=t&&t.length?t.length:0,s},Ga=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=Va(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Xa=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const s=function(e,t){let i=0,s=t-e.mediaSequence,n=e.segments[s];if(n){if(void 0!==n.start)return{result:n.start,precise:!0};if(void 0!==n.end)return{result:n.end-n.duration,precise:!0}}for(;s--;){if(n=e.segments[s],void 0!==n.end)return{result:i+n.end,precise:!0};if(i+=Ha(e,n),void 0!==n.start)return{result:i+n.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(s.precise)return s.result;const n=function(e,t){let i,s=0,n=t-e.mediaSequence;for(;n<e.segments.length;n++){if(i=e.segments[n],void 0!==i.start)return{result:i.start-s,precise:!0};if(s+=Ha(e,i),void 0!==i.end)return{result:i.end-s,precise:!0}}return{result:-1,precise:!1}}(e,t);return n.precise?n.result:s.result+i},Ka=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return n()[1/0]}return Xa(e,t,i)},Ya=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:s}){let n=0;if(i>s&&([i,s]=[s,i]),i<0){for(let t=i;t<Math.min(0,s);t++)n+=e;i=0}for(let e=i;e<s;e++)n+=t[e].duration;return n},Qa=function(e,t,i,s){if(!e||!e.segments)return null;if(e.endList)return Ka(e);if(null===t)return null;t=t||0;let n=Xa(e,e.mediaSequence+e.segments.length,t);return i&&(n-=s="number"==typeof s?s:Ga(null,e)),Math.max(0,n)},Za=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Ja=function(e){return e.excludeUntil&&e.excludeUntil===1/0},eo=function(e){const t=Za(e);return!e.disabled&&!t},to=function(e,t){return t.attributes&&t.attributes[e]},io=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!eo(e)&&(e.attributes.BANDWIDTH||0)<i).length},so=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),no=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=!1;for(const e in i){for(const n in i[e])if(s=t(i[e][n]),s)break;if(s)break}return!!s},ro=e=>{if(!e||!e.playlists||!e.playlists.length)return no(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],s=i.attributes&&i.attributes.CODECS;if((!s||!s.split(",").every(e=>D(e)))&&!no(e,e=>so(i,e)))return!1}return!0};var ao={liveEdgeDelay:Ga,duration:Ka,seekable:function(e,t,i){const s=t||0;let n=Qa(e,t,!0,i);return null===n?Ma():(n<s&&(n=s),Ma(s,n))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let a=t-n;const o=za(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof s||"number"!=typeof t.partIndex||s===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,r){if(a<0)continue}else if(a+Na<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Ya({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const s=i.duration>Na;if(0!==a&&!(s&&a+Na>=0)||t===o.length-1){if(r){if(a>0)continue}else if(a-Na>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Ya({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:eo,isDisabled:function(e){return e.disabled},isExcluded:Za,isIncompatible:Ja,playlistEnd:Qa,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:to,estimateSegmentRequestTime:function(e,t,i,s=0){return to("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*s)/t:NaN},isLowestEnabledRendition:io,isAudioOnly:ro,playlistMatch:so,segmentDurationWithParts:Ha};const{log:oo}=wa,lo=(e,t)=>`${e}-${t}`,co=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,uo=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(const s in e.mediaGroups[i])for(const n in e.mediaGroups[i][s]){const r=e.mediaGroups[i][s][n];t(r,i,s,n)}})},ho=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},po=(e,t,i=co)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const s=ro(e);uo(e,(t,n,r,a)=>{if(!t.playlists||!t.playlists.length){if(s&&"AUDIO"===n&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r)return}t.playlists=[d({},t)]}
vendor: 6,384 bytes, line 2
2t.playlists.forEach(function(t,s){const o=i(n,r,a,t),l=lo(s,o);t.uri?t.resolvedUri=t.resolvedUri||Aa(e.uri,t.uri):(t.uri=0===s?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];ho({playlist:i,id:lo(t,i.uri)}),i.resolvedUri=Aa(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||oo.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{uo(e,t=>{t.uri&&(t.resolvedUri=Aa(e.uri,t.uri))})})(e)};class mo{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,s)=>{if(!this.processedDateRanges_.has(s)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const go=({requestType:e,request:t,error:i,parseFailure:s})=>{const n=t.status<200||t.status>299,r=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e},o=n&&!r||s;if(i&&r)a.error=d({},i),a.errorType=wa.Error.NetworkRequestFailed;else if(t.aborted)a.errorType=wa.Error.NetworkRequestAborted;else if(t.timedout)a.errorType=wa.Error.NetworkRequestTimeout;else if(o){const e=s?wa.Error.NetworkBodyParserFailed:wa.Error.NetworkBadStatus;a.errorType=e,a.status=t.status,a.headers=t.headers}return a},fo=Da("CodecUtils"),yo=function(e){const t=e.attributes||{};if(t.CODECS)return P(t.CODECS)},_o=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},vo=function(e){const t={};return e.forEach(({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[],t[e].push(A(`${i}${s}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return fo(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]}),t},bo=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},To=function(e,t){const i=t.attributes||{},s=vo(yo(t)||[]);if(_o(e,t)&&!s.audio&&!((e,t)=>{if(!_o(e,t))return!0;const i=t.attributes||{},s=e.mediaGroups.AUDIO[i.AUDIO];for(const e in s)if(!s[e].uri&&!s[e].playlists)return!0;return!1})(e,t)){const t=vo(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var s in i){var n=i[s];if(n.default&&n.playlists)return P(n.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(s.audio=t.audio)}return s},{EventTarget:So}=wa,Co=(e,t)=>{if(!e)return t;const i=La(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let s=0;s<t.parts.length;s++)e.parts&&e.parts[s]&&(i.parts[s]=La(e.parts[s],t.parts[s]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},wo=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Aa(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Aa(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Aa(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Aa(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=Aa(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=Aa(t,e.uri))})},ko=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},Eo=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,xo=(e,t,i=Eo)=>{const s=La(e,{}),n=s.playlists[t.id];if(!n)return null;if(i(n,t))return null;t.segments=ko(t);const r=La(n,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}r.segments=((e,t,i)=>{const s=e.slice(),n=t.slice();i=i||0;const r=[];let a;for(let e=0;e<n.length;e++){const t=s[e+i],o=n[e];t?(a=t.map||a,r.push(Co(t,o))):(a&&!o.map&&(o.map=a),r.push(o))}return r})(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}r.segments.forEach(e=>{wo(e,r.resolvedUri)});for(let e=0;e<s.playlists.length;e++)s.playlists[e].id===t.id&&(s.playlists[e]=r);return s.playlists[t.id]=r,s.playlists[t.uri]=r,uo(e,(e,i,s,n)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=r)}),s},Io=(e,t)=>{const i=e.segments||[],s=i[i.length-1],n=s&&s.parts&&s.parts[s.parts.length-1],r=n&&n.duration||s&&s.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)},Ao=(e,t,i)=>{if(!e)return;const s=[];return e.forEach(e=>{if(!e.attributes)return;const{BANDWIDTH:t,RESOLUTION:i,CODECS:n}=e.attributes;s.push({id:e.id,bandwidth:t,resolution:i,codecs:n})}),{type:t,isLive:i,renditions:s}};class Po extends So{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Da("PlaylistLoader");const{withCredentials:s=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=i.addD
vendor: 14,469 bytes, line 2
2ateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new mo,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=Aa(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let s=t.mediaSequence+t.segments.length;if(e){const n=e.parts||[],r=Wa(t)-1;r>-1&&r!==n.length-1&&(i._HLS_part=r),(r>-1||n.length)&&s--}i._HLS_msn=s}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new(n().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:go({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new C;e&&a.on("warn",e),t&&a.on("info",t),s.forEach(e=>a.addParser(e)),n.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();const o=a.manifest;if(r||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){o.hasOwnProperty(e)&&delete o[e]}),o.segments&&o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=Va(o);if(l.length&&!o.partTargetDuration){const t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),oo.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return i.playlists&&i.playlists.length?(this.excludeAudioOnlyVariants(i.playlists),i):i}catch(e){this.error=e,this.error.metadata={errorType:wa.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){const t=e=>{const t=e.attributes||{},{width:i,height:s}=t.RESOLUTION||{};if(i&&s)return!0;const n=yo(e)||[],r=vo(n);return Boolean(r.video)};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const r=t||this.parseManifest_({url:i,manifestString:e});r.lastRequest=Date.now(),ho({playlist:r,uri:i,id:s});const a=xo(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Io(this.media(),!!a)),n.parsedPlaylist=Ao(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),n().clearTimeout(this.mediaUpdateTimeout),n().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new mo,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(n().clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=n().setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,s=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Io(e,!0)),!s)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Pa(e.resolvedUri,s),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:s.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;return void(this.mediaUpdateTimeout=n().setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e))}this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=n().setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=n().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:go({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Pa(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const s=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Ao(s.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(s)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,po(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=ko(e),e.segments.forEach(t=>{wo(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||n().location.href;this.main=((e,t)=>{const i=lo(0,t),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:n().location.href,resolvedUri:n().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return s.playlists[i]=s.playlists[0],s.playlists[t]=s.playlists[0],s})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,s=e.ID;let n=i.playlists.length;for(;n--;){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const a=r.resolvedUri,o=r.id;if(t){const t=this.createCloneURI_(r.resolvedUri,e),a=lo(s,t),o=this.createCloneAttributes_(s,r.attributes),l=this.createClonePlaylist_(r,a,e,o);i.playlists[n]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(n,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][s])for(const t in i.mediaGroups[e])if(t===s){for(const s in i.mediaGroups[e][t])i.mediaGroups[e][t][s].playlists.forEach((e,t)=>{const s=i.playlists[e.id],n=s.id,r=s.resolvedUri;delete i.playlists[n],delete i.playlists[r]});delete i.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,s=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),r=lo(e.ID,n),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,r,e,a);i.playlists[s]=o,i.playlists[r]=o,i.playlists[n]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(s.mediaGroups[n]&&!s.mediaGroups[n][t])for(const r in s.mediaGroups[n])if(r===i){s.mediaGroups[n][t]={};for(const i in s.mediaGroups[n][r]){const a=s.mediaGroups[n][r][i];s.mediaGroups[n][t][i]=d({},a);const o=s.mediaGroups[n][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((r,a)=>{const l=s.playlists[r.id],c=co(n,t,i),u=lo(t,c);if(l&&!s.playlists[u]){const t=this.createClonePlaylist_(l,u,e),i=t.resolvedUri;s.playlists[u]=t,s.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(r,u,e)})}}})}createClonePlaylist_(e,t,i,s){const n=this.createCloneURI_(e.resolvedUri,i),r={resolvedUri:n,uri:n,id:t};return e.segments&&(r.segments=[]),s&&(r.attributes=s),La(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const s=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(s))i.searchParams.set(e,s[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{t[s]&&(i[s]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const s=e.contentProtection[i].attributes.keyId;t.add(s.toLowerCase())}return t}}const Do=function(e,t,i,s){const n="arraybuffer"===e.responseType?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),s(t,e)},Lo=function(){const e=function e(t,i){t=La({timeout:45e3},t);const s=e.beforeRequest||wa.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||wa.Vhs.xhr._requestCallbackSet||new Set,r=e._responseCallbackSet||wa.Vhs.xhr._responseCallbackSet;s&&"function"==typeof s&&(wa.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));const a=!0===wa.Vhs.xhr.original?wa.xhr:wa.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i})(n,t);n.delete(s);const l=a(o||t,function(e,t){return((e,t,i,s)=>{e&&e.size&&e.forEach(e=>{e(t,i,s)})})(r,l,e,t),Do(l,e,t,i)}),c=l.abort;return l.abort=function(){return l.aborted=!0,c.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},Mo=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?n().BigInt(e.offset)+n().BigInt(e.length)-n().BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},No=function(e,t){return e.start(t)+"-"+e.end(t)},Oo=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Ro=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Uo=function(e){const t={};return Object.keys(e).forEach(i=>{const s=e[i];F(s)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s}),t},Bo=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Fo=function(e){return e.resolvedUri},jo=e=>{const t=Array.prototype.slice.call(e),i=16;let s,n,r="";for(let e=0;e<t.length/i;e++)s=t.slice(e*i,e*i+i).map(Oo).join(""),n=t.slice(e*i,e*i+i).map(Ro).join(""),r+=s+" "+n+"\
2n";return r};var qo=Object.freeze({__proto__:null,createTransferableMessage:Uo,initSegmentId:Bo,segmentKeyId:Fo,hexDump:jo,tagDump:({bytes:e})=>jo(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=No(e,t)+" ";return i}});const $o=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!r.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let s=t.segments[0];if(i<new Date(s.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(s=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const n=t.segments[t.segments.length-1],r=n.dateTimeObject,a=n.videoTimingInfo?(o=n.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:n.duration+.25*n.duration;var o;return i>new Date(r.getTime()+1e3*a)?null:(i>new Date(r)&&(s=n),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:ao.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,c=((e,t)=>{let i,s;try{i=new Date(e),s=new Date(t)}catch(e){}const n=i.getTime();return(s.getTime()-n)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(s(o.estimatedStart+c),void r.one("seeked",()=>{$o({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a})}));const u=l.start+c;r.one("seeked",()=>a(null,r.currentTime())),n&&r.pause(),s(u)},Ho=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:zo}=wa,Vo=function(e,t){if(!Eo(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const s=e.segments[i],n=t.segments[i];if(s.uri!==n.uri)return!1;if(!s.byterange&&!n.byterange)continue;const r=s.byterange,a=n.byterange;if(r&&!a||!r&&a)return!1;if(r.offset!==a.offset||r.length!==a.length)return!1}return!0},Wo=(e,t,i,s)=>`placeholder-uri-${e}-${t}-${s.attributes.NAME||i}`,Go=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Xo=(e,t)=>{const i={};for(const s in e){const n=e[s].sidx;if(n){const e=ce(n);if(!t[e])break;const s=t[e].sidxInfo;Go(s,n)&&(i[e]=t[e])}}return i};class Ko extends zo{constructor(e,t,i={},s){super(),this.isPaused_=!0,this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Da("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const s=e.sidx&&ce(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s])return n().clearTimeout(this.mediaRequest_),void(this.mediaRequest_=n().setTimeout(()=>i(!1),0));const r=Pa(e.sidx.resolvedUri),a=(n,r)=>{if(this.requestErrored_(n,r,t))return;const a=this.mainPlaylistLoader_.sidxMapping_,{requestType:o}=r;let l;try{l=je()(j(r.response).subarray(8))}catch(e){return e.metadata=go({requestType:o,request:r,parseFailure:!0}),void this.requestErrored_(e,r,t)}return a[s]={sidxInfo:e.sidx,sidx:l},se(e,l,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i,s)=>{let n,r=[],a=!1;const o=function(e,t,s,n){return t.abort(),a=!0,i(e,t,s,n)},l=function(e,t){if(a)return;if(e)return e.metadata=go({requestType:s,request:t,error:e}),o(e,t,"",r);const i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}),t.length<=1)return j(t[0]);var s=t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),n=new Uint8Array(s),r=0;return t.forEach(function(e){e=j(e),n.set(e,r),r+=e.byteLength}),n}(r,z(i,!0)),n=n||$e(r),r.length<10||n&&r.length<n+2)return Ho(t,()=>o(e,t,"",r));const l=ot(r);return"ts"===l&&r.length<188||!l&&r.length<376?Ho(t,()=>o(e,t,"",r)):o(null,t,l,r)},c={uri:e,beforeSend(e){e.overrideMimeType("text/plain;
2 charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:i}){return Do(e,null,{statusCode:e.status},l)})}},u=t(c,function(e,t){return Do(u,e,t,l)});return u})(r,this.vhs_.xhr,(t,i,s,n)=>{if(t)return a(t,i);if(!s||"mp4"!==s){const t=s||"unknown";return a({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)}const{offset:o,length:l}=e.sidx.byterange;if(n.length>=l+o)return a(t,{response:n.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",requestType:"dash-sidx",headers:Mo({byterange:e.sidx.byterange})},a)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},n().clearTimeout(this.minimumUpdatePeriodTimeout_),n().clearTimeout(this.mediaRequest_),n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,n().clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(n().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=n().setTimeout(()=>this.load(),e))}this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){if(this.started=!0,!this.isMain_)return n().clearTimeout(this.mediaRequest_),void(this.mediaRequest_=n().setTimeout(()=>this.haveMain_(),0));this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,s)=>{if(i){const{requestType:e}=s;i.metadata=go({requestType:e,request:s,error:i})}if(this.requestErrored_(i,s))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const n=s.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Pa(this.mainPlaylistLoader_.srcUrl,s),n?(this.handleMain_(),void this.syncCl
vendor: 9,510 bytes, line 2
2ientServerClock_(()=>e(s,n))):e(s,n)})}syncClientServerClock_(e){const t=(i=this.mainPlaylistLoader_.mainXml_,(e=>{const t=Ee(e,"UTCTiming")[0];if(!t)return null;const i=Pe(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i})(Ue(i)));var i;return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Aa(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,s)=>{if(!this.request)return;if(i){const{requestType:t}=s;return this.error.metadata=go({requestType:t,request:s,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;n="HEAD"===t.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){n().clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=((e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=t,a=Ee(e,"Period");if(!a.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const o=Ee(e,"Location"),l=Pe(e),c=Le([{baseUrl:i}],Ee(e,"BaseURL")),u=Ee(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=n,o.length&&(l.locations=o.map(xe));const d=[];return a.forEach((e,t)=>{const i=Pe(e),s=d[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:l.type}),d.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:Re(u,r),representationInfo:Y(d.map(Oe(l,c))),eventStream:Y(d.map(Ne))}})(Ue(e),t),s=i.representationInfo.map(ke);return _e({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})})(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});return po(r,t,Wo),r})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(e){this.error=e,this.error.metadata={errorType:wa.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}e&&(i=((e,t,i)=>{let s=!0,n=La(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const r=t.playlists[e];if(r.sidx){const e=ce(r.sidx);i&&i[e]&&i[e].sidx&&se(r,i[e].sidx,r.sidx.resolvedUri)}const a=xo(n,r,Vo);a&&(n=a,s=!1)}return uo(t,(e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=xo(n,e.playlists[0],Vo);o&&(n=o,r in n.mediaGroups[t][i]||(n.mediaGroups[t][i][r]=e),n.mediaGroups[t][i][r].playlists[0]=n.playlists[a],s=!1)}}),((e,t)=>{uo(e,(i,s,n,r)=>{t.mediaGroups[s][n]&&r in t.mediaGroups[s][n]||delete e.mediaGroups[s][n][r]})})(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(s=!1),s?null:n})(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:e,endList:s}=i,n=[];i.playlists.forEach(e=>{n.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})});const r={duration:e,isLive:!s,renditions:n};t.parsedManifest=r,this.trigger({type:"manifestparsecomplete",metadata:t})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(n().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=n().setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Xo(e.playlists,t);return uo(e,(e,s,n,r)=>{if(e.playlists&&e.playlists.length){const s=e.playlists;i=La(i,Xo(s,t))}}),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=n().setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},Io(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes["cenc:default_KID"];s&&t.add(s.replace(/-/g,"").toLowerCase())}return t}}}var Yo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Qo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Zo=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=Qo(new Worker(t));i.objURL=t;const s=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),s.call(this)},i}},Jo=function(e){return`var browserWorkerPolyFill = ${Qo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},el=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},tl=Jo(el(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var s;return!!e[t]&&(s=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(s,1),s>-1)},this.trigger=function(t){var i,s,n,r;if(i=e[t])if(2===arguments.length)for(n=i.length,s=0;s<n;++s)i[s].call(this,arguments[1]);else{for(r=[],s=arguments.length,s=1;s<arguments.length;++s)r.push(arguments[s]);for(n=i.length,s=0;s<n;++s)i[s].apply(this,r)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},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 i,s,n,r,a,o,l,c,u,d,h,p,m,g,f,y,_,v,b,T,S,C,w,k,E,x,I,A,P,D,L,M,N,O,R,U,B,F,j,q,$=t,H=Math.pow(2,32),z={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?
vendor: 4,191 bytes, line 2
2Number(t):t:i.getUint32(0)*H+i.getUint32(4)},MAX_UINT32:H},V=z.MAX_UINT32;!function(){var e;if(C={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in C)C.hasOwnProperty(e)&&(C[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),A={video:x,audio:I},L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),M=new Uint8Array([0,0,0,0,0,0,0,0]),N=M,O=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=M,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(e){var t,i,s=[],n=0;for(t=1;t<arguments.length;t++)s.push(arguments[t]);for(t=s.length;t--;)n+=s[t].byteLength;for(i=new Uint8Array(n+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,n=8;t<s.length;t++)i.set(s[t],n),n+=s[t].byteLength;return i},s=function(){return i(C.dinf,i(C.dref,L))},n=function(e){return i(C.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]))},f=function(e){return i(C.hdlr,A[e])},g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),i(C.mdhd,t)},m=function(e){return i(C.mdia,g(e),f(e.type),o(e))},a=function(e){return i(C.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return i(C.minf,"video"===e.type?i(C.vmhd,P):i(C.smhd,D),s(),_(e))},l=function(e,t){for(var s=[],n=t.length;n--;)s[n]=b(t[n]);return i.apply(null,[C.moof,a(e)].concat(s))},c=function(e){for(var t=e.length,s=[];t--;)s[t]=h(e[t]);return i.apply(null,[C.moov,d(4294967295)].concat(s).concat(u(e)))},u=function(e){for(var t=e.length,s=[];t--;)s[t]=T(e[t]);return i.apply(null,[C.mvex].concat(s))},d=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 i(C.mvhd,t)},y=function(e){var t,s,n=e.samples||[],r=new Uint8Array(4+n.length);for(s=0;s<n.length;s++)t=n[s].flags,r[s+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(C.sdtp,r)},_=function(e){return i(C.stbl,v(e),i(C.stts,R),i(C.stsc,N),i(C.stsz,O),i(C.stco,M))},v=function(e){return i(C.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?U(e):B(e))},U=function(e){var t,s,n=e.sps||[],r=e.pps||[],a=[],o=[];for(t=0;t<n.length;t++)a.push((65280&n[t].byteLength)>>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));for(t=0;t<r.length;t++)o.push((65280&r[t].byteLength)>>>8),o.push(255&r[t].byteLength),o=o.concat(Array.prototype.slice.call(r[t]));if(s=[C.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]),i(C.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],o))),i(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.s
vendor: 7,081 bytes, line 2
2arRatio[0],c=e.sarRatio[1];s.push(i(C.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c])))}return i.apply(null,s)},B=function(e){return i(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},p=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 i(C.tkhd,t)},b=function(e){var t,s,n,r,a,o;return t=i(C.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/V),o=Math.floor(e.baseMediaDecodeTime%V),s=i(C.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(n=S(e,92),i(C.traf,t,s,n)):(r=y(e),n=S(e,r.length+92),i(C.traf,t,s,n,r))},h=function(e){return e.duration=e.duration||4294967295,i(C.trak,p(e),m(e))},T=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]);return"video"!==e.type&&(t[t.length-1]=0),i(C.trex,t)},q=function(e,t){var i=0,s=0,n=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(s=2),void 0!==e[0].flags&&(n=4),void 0!==e[0].compositionTimeOffset&&(r=8)),[0,0,i|s|n|r,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]},j=function(e,t){var s,n,r,a,o,l;for(t+=20+16*(a=e.samples||[]).length,r=q(a,t),(n=new Uint8Array(r.length+16*a.length)).set(r),s=r.length,l=0;l<a.length;l++)o=a[l],n[s++]=(4278190080&o.duration)>>>24,n[s++]=(16711680&o.duration)>>>16,n[s++]=(65280&o.duration)>>>8,n[s++]=255&o.duration,n[s++]=(4278190080&o.size)>>>24,n[s++]=(16711680&o.size)>>>16,n[s++]=(65280&o.size)>>>8,n[s++]=255&o.size,n[s++]=o.flags.isLeading<<2|o.flags.dependsOn,n[s++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,n[s++]=61440&o.flags.degradationPriority,n[s++]=15&o.flags.degradationPriority,n[s++]=(4278190080&o.compositionTimeOffset)>>>24,n[s++]=(16711680&o.compositionTimeOffset)>>>16,n[s++]=(65280&o.compositionTimeOffset)>>>8,n[s++]=255&o.compositionTimeOffset;return i(C.trun,n)},F=function(e,t){var s,n,r,a,o,l;for(t+=20+8*(a=e.samples||[]).length,r=q(a,t),(s=new Uint8Array(r.length+8*a.length)).set(r),n=r.length,l=0;l<a.length;l++)o=a[l],s[n++]=(4278190080&o.duration)>>>24,s[n++]=(16711680&o.duration)>>>16,s[n++]=(65280&o.duration)>>>8,s[n++]=255&o.duration,s[n++]=(4278190080&o.size)>>>24,s[n++]=(16711680&o.size)>>>16,s[n++]=(65280&o.size)>>>8,s[n++]=255&o.size;return i(C.trun,s)},S=function(e,t){return"audio"===e.type?F(e,t):j(e,t)};var W,G,X,K,Y,Q,Z,J,ee={ftyp:r=function(){return i(C.ftyp,w,k,w,E)},mdat:function(e){return i(C.mdat,e)},moof:l,moov:c,initSegment:function(e){var t,i=r(),s=c(e);return(t=new Uint8Array(i.byteLength+s.byteLength)).set(i),t.set(s,i.byteLength),t}},te=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ie={groupNalsIntoFrames:function(e){var t,i,s=[],n=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,s.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(s.length&&(s.duration=i.dts-s.dts,n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s)),(s=[i]).byteLength=i.data.byteLength,s.pts=i.pts,s.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(s.keyFrame=!0),s.duration=i.dts-s.dts,s.byteLength+=i.data.byteLength,s.push(i));return n.length&&(!s.duration||s.duration<=0)&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s),n},groupFramesIntoGops:function(e){var t,i,s=[],n=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(s.length&&(n.push(s),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration),(s=[i]).nalCount=i.length,s.byteLength=i.byteLength,s.pts=i.pts,s.dts=i.dts,s.duration=i.duration):(s.duration+=i.duration,s.nalCount+=i.length,s.byteLength+=i.byteLength,s.push(i));return n.length&&s.duration<=0&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration,n.push(s),n},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,s,n,r,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(r=e[i],s=0;s<r.length;s++)a=r[s],o+=(n=te(a,o)).size,l.push(n);return l},concatenateNalData:function(e){var t,i,s,n,r,a,o=0,l=e.byteLength,c=e.nalCount,u=new Uint8Array(l+4*c),d=new DataView(u.buffer);for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)for(r=n[i],s=0;s<r.length;s++)a=r[s],d.setUint32(o,a.data.byteLength),o+=4,u.set(a.data,o),o+=a.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i,s=[];return i=te(e,t||0),s.push(i),s},concatenateNalDataForFrame:function(e){var t,i,s=0,n=e.byteLength,r=e.length,a=new Uint8Array(n+4*r),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(s,i.data.byteLength),s+=4,a.set(i.data,s),s+=i.data.byteLength;return a}},se=[33,16,5,32,164,27],ne=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],re=function(e){for(var t=[];e--;)t.push(0);return t},ae=9e4;Q=function(e,t){return G(Y(e,t))},Z=function(e,t){return X(K(e),t)},J=function(e,t,i){return K(i?e:e-t)};var oe={ONE_SECOND_IN_TS:ae,secondsToVideoTs:G=function(e){return e*ae},secondsToAudioTs:X=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/ae},audioTsToSeconds:Y=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:Z,metadataTsToSeconds:J},le=oe,ce={prefixWithSilence:function(e,t,i,s){var n,r,a,o,l,c=0,u=0,d=0;if(t.length&&(n=le.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(le.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&s&&(c=n-Math.max(i,s),d=(u=Math.floor(c/r))*r),!(u<1||d>le.ONE_SECOND_IN_TS/2))){for((a=function(){if(!W){var e={96e3:[se,[227,64],re(154),[56]],88200:[se,[231],re(170),[56]],64e3:[se,[248,192],re(240),[56]],48e3:[se,[255,192],re(268),[55,148,128],re(54),[112]],44100:[se,[25
vendor: 4,311 bytes, line 2
25,192],re(268),[55,163,128],re(84),[112]],32e3:[se,[255,192],re(268),[55,234],re(226),[112]],24e3:[se,[255,192],re(268),[55,255,128],re(268),[111,112],re(126),[224]],16e3:[se,[255,192],re(268),[55,255,128],re(268),[111,255],re(269),[223,108],re(195),[1,192]],12e3:[ne,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,253,128],re(259),[56]],11025:[ne,re(268),[3,127,248],re(268),[6,255,240],re(268),[13,255,224],re(268),[27,255,192],re(268),[55,175,128],re(108),[112]],8e3:[ne,re(268),[3,121,16],re(47),[7]]};t=e,W=Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[])),e},{})}var t;return W}()[e.samplerate])||(a=t[0].data),o=0;o<u;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(le.videoTsToAudioTs(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,i,s=[];for(t=0;t<e.length;t++)i=e[t],s.push({size:i.data.byteLength,duration:1024});return s},concatenateFrameData:function(e){var t,i,s=0,n=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],n.set(i.data,s),s+=i.data.byteLength;return n}},ue=oe.ONE_SECOND_IN_TS,de={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,s=e.minSegmentDts;return t||(s-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=s,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/ue,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},he={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},s=0,n=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)s+=255,t++;for(s+=e[t++];255===e[t];)n+=255,t++;if(n+=e[t++],!i.payload&&4===s){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=s,i.payloadSize=n,i.payload=e.subarray(t,t+n);break}i.payload=void 0}t+=n,s=0,n=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,s,n,r,a=[];if(!(64&t[0]))return a;for(s=31&t[0],i=0;i<s;i++)r={type:3&t[2+(n=3*i)],pts:e},4&t[n+2]&&(r.ccData=t[n+3]<<8|t[n+4],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},pe=$,me=he,ge=function(e){e=e||{},ge.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new ke(0,0),new ke(0,1),new ke(1,0),new ke(1,1)],this.parse708captions_&&(this.cc708Stream_=new be({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};ge.prototype=new pe,ge.prototype.push=function(e){var t,i,s;
vendor: 4,443 bytes, line 2
2if("sei_rbsp"===e.nalUnitType&&(t=me.parseSei(e.escapedRBSP)).payload&&t.payloadType===me.USER_DATA_REGISTERED_ITU_T_T35&&(i=me.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));s=me.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(s),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ge.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},ge.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},ge.prototype.flush=function(){return this.flushStream("flush")},ge.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ge.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},ge.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ge.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ge.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ge.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ge.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var fe={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ye=function(e){return 32<=e&&e<=127||160<=e&&e<=255},_e=function(e){this.windowNum=e,this.reset()};_e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},_e.prototype.getText=function(){return this.rows.join("\n")},_e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},_e.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},_e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},_e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var ve=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new _e(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};ve.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new _e(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},ve.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},ve.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var be=function(e){e=e||{},be.prototype.init.call(this);var t,i=this,s=e.captionServices||{},n={};
vendor: 4,326 bytes, line 2
2Object.keys(s).forEach(e=>{t=s[e],/^SERVICE/.test(e)&&(n[e]=t.encoding)}),this.serviceEncodings=n,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};be.prototype=new pe,be.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},be.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,s=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(s)},be.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,s=null,n=0,r=t[n++];for(e.seq=r>>6,e.sizeCode=63&r;n<t.length;n++)s=31&(r=t[n++]),7==(i=r>>5)&&s>0&&(i=r=t[n++]),this.pushServiceBlock(i,n,s),s>0&&(n+=s-1)},be.prototype.pushServiceBlock=function(e,t,i){var s,n=t,r=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,n));n<t+i&&n<r.length;n++)s=r[n],ye(s)?n=this.handleText(n,a):24===s?n=this.multiByteCharacter(n,a):16===s?n=this.extendedCommands(n,a):128<=s&&s<=135?n=this.setCurrentWindow(n,a):152<=s&&s<=159?n=this.defineWindow(n,a):136===s?n=this.clearWindows(n,a):140===s?n=this.deleteWindows(n,a):137===s?n=this.displayWindows(n,a):138===s?n=this.hideWindows(n,a):139===s?n=this.toggleWindows(n,a):151===s?n=this.setWindowAttributes(n,a):144===s?n=this.setPenAttributes(n,a):145===s?n=this.setPenColor(n,a):146===s?n=this.setPenLocation(n,a):143===s?a=this.reset(n,a):8===s?a.currentWindow.backspace():12===s?a.currentWindow.clearText():13===s?a.currentWindow.pendingNewLine=!0:14===s?a.currentWindow.clearText():141===s&&n++},be.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ye(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},be.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},be.prototype.initService=function(e,t){var i,s,n=this;return(i="SERVICE"+e)in this.serviceEncodings&&(s=this.serviceEncodings[i]),this.services[e]=new ve(e,s,n),this.services[e].init(this.getPts(t),function(t){n.flushDisplayed(t,n.services[e])}),this.services[e]},be.prototype.handleText=function(e,t,i){var s,n,r,a,o=i&&i.isExtended,l=i&&i.isMultiByte,c=this.current708Packet.data,u=o?4096:0,d=c[e],h=c[e+1],p=t.currentWindow;if(l?(n=[d,h],e++):n=[d],t.textDecoder_&&!o)s=t.textDecoder_.decode(new Uint8Array(n));else if(l){const e=n.map(e=>("0"+(255&e).toString(16)).slice(-2)).join("");s=String.fromCharCode(parseInt(e,16))}else a=fe[r=u|d]||r,s=4096&r&&r===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(s),e},be.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,s=i[e+1],n=i[e+2];return ye(s)&&ye(n)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},be.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},be.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,s=i[e],n=7&s;t.setCurrentWindow(n);var r=t.currentWindow;return s=i[++e],r.visible=(32&s)>>5,r.rowLock=(16&s)>>4,r.columnLock=(8&s)>>3,r.priority=7&s,s=i[++e],r.relativePositioning=(128&s)>>7,r.anchorVertical=127&s,s=i[++e],r.anchorHorizontal=s,s=i[++e],r.anchorPoint=(240&s)>>4,r.rowCount=15&s,s=i[++e],r.columnCount=63&s,s=i[++e],r.windowStyle=(56&s)>>3,r.penStyle=7&s,r.virtualRowCount=r.rowCount+1,e},be.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.winAttr;return s=i[++e],n.fillOpacity=(192&s)>>6,n.fillRed=(48&s)>>4,n.fillGreen=(12&s)>>2,n.fillBlue=3&s,s=i[++e],n.borderType=(192&s)>>6,n.borderRed=(48&s)>>4,n.borderGreen=(12&s)>>2,n.borderBlue=3&s,s=i[++e],n.borderType+=(128&s)>>5,n.wordWrap=(64&s)>>6,n.printDirection=(48&s)>>4,n.scrollDirection=(12&s)>>2,n.justify=3&s,s=i[++e],n.effectSpeed=(240&s)>>4,n.effectDirection=(12&s)>>2,n.displayEffect=3&s,e},be.prototype.flushDisplayed=function(e,t){for(var i=[],s=0;s<8;s++)t.windows[s].visible&&!t.windows[s].isEmpty()&&i.push(t.windows[s].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},be.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
vendor: 8,585 bytes, line 2
2:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},be.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=1);return e},be.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=0);return e},be.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible^=1);return e},be.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].clearText();return e},be.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].reset();return e},be.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penAttr;return s=i[++e],n.textTag=(240&s)>>4,n.offset=(12&s)>>2,n.penSize=3&s,s=i[++e],n.italics=(128&s)>>7,n.underline=(64&s)>>6,n.edgeType=(56&s)>>3,n.fontStyle=7&s,e},be.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penColor;return s=i[++e],n.fgOpacity=(192&s)>>6,n.fgRed=(48&s)>>4,n.fgGreen=(12&s)>>2,n.fgBlue=3&s,s=i[++e],n.bgOpacity=(192&s)>>6,n.bgRed=(48&s)>>4,n.bgGreen=(12&s)>>2,n.bgBlue=3&s,s=i[++e],n.edgeRed=(48&s)>>4,n.edgeGreen=(12&s)>>2,n.edgeBlue=3&s,e},be.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,s=i[++e],n.row=15&s,s=i[++e],n.column=63&s,e},be.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Te={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},Se=function(e){return null===e?"":(e=Te[e]||e,String.fromCharCode(e))},Ce=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],we=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},ke=function(e,t){ke.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,s,n,r;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),s=t>>>8,n=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=we();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=we();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=we()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(s,n))r=Se((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isExtCharacter(s,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),r=Se((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isMidRowCode(s,n))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~n||this.addFormatting(e.pts,["i"]),1&~n||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(s,n)){const e=3&n;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(s,n)){var a=Ce.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(n)&&(14&~n||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(s)&&(0===n&&(n=null),r=Se(s),r+=Se(n),this[this.mode_](e.pts,r),this.column_+=r.length)}else this.lastControlCode_=null}};ke.prototype=new pe,ke.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,s)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(s)}e.text.length&&i.push({text:e.text,line:s+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(s)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},ke.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=we(),this.nonDisplayed_=we(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},ke.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},ke.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},ke.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},ke.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},ke.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},ke.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},ke.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},ke.prototype.isNormalChar=function(e){return e>=32&&e<=127},ke.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=we(),this.displayed_=we()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},ke.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)},ke.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},ke.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},ke.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},ke.prototype.shiftRowsUp_=function(){var e;
vendor: 6,722 bytes, line 2
2for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},ke.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var Ee={CaptionStream:ge,Cea608Stream:ke,Cea708Stream:be},xe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ie=$,Ae="shared",Pe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},De=function(e){var t,i;De.prototype.init.call(this),this.type_=e||Ae,this.push=function(e){"metadata"!==e.type?this.type_!==Ae&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Pe(e.dts,i),e.pts=Pe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};De.prototype=new Ie;var Le,Me={TimestampRolloverStream:De,handleRollover:Pe},Ne=(e,t,i)=>{if(!e)return-1;for(var s=i;s<e.length;s++)if(e[s]===t)return s;return-1},Oe=function(e,t,i){var s,n="";for(s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n},Re=function(e,t,i){return decodeURIComponent(Oe(e,t,i))},Ue=function(e,t,i){return unescape(Oe(e,t,i))},Be=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Fe={APIC:function(e){var t,i,s=1;3===e.data[0]&&((t=Ne(e.data,0,s))<0||(e.mimeType=Ue(e.data,s,t),s=t+1,e.pictureType=e.data[s],s++,(i=Ne(e.data,0,s))<0||(e.description=Re(e.data,s,i),s=i+1,"--\x3e"===e.mimeType?e.url=Ue(e.data,s,e.data.length):e.pictureData=e.data.subarray(s,e.data.length))))},"T*":function(e){3===e.data[0]&&(e.value=Re(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=Re(e.data,1,t),e.value=Re(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ue(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=Re(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ue(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},je={parseId3Frames:function(e){var t,i=10,s=0,n=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){s=Be(e.subarray(6,10)),s+=10,64&e[5]&&(i+=4,i+=Be(e.subarray(10,14)),s-=Be(e.subarray(16,20)));do{if((t=Be(e.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};r.key=r.id,Fe[r.id]?Fe[r.id](r):"T"===r.id[0]?Fe["T*"](r):"W"===r.id[0]&&Fe["W*"](r),n.push(r),i+=10,i+=t}while(i<s);return n}},parseSyncSafeInteger:Be,frameParsers:Fe},qe=xe,$e=je;(Le=function(e){var t,i={descriptor:e&&e.descriptor},s=0,n=[],r=0;if(Le.prototype.init.call(this),this.dispatchType=qe.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(r=0,n.length=0),0===n.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(n.push(e),r+=e.data.byteLength,1===n.length&&(s=$e.parseSyncSafeInteger(e.data.subarray(6,10)),s+=10),!(r<s)){for(t={data:new Uint8Array(s),frames:[],pts:n[0].pts,dts:n[0].dts},l=0;l<s;)t.data.set(n[0].data.subarray(0,s-l),l),l+=n[0].data.byteLength,r-=n[0].data.byteLength,n.shift();i=10,64&t.data[5]&&(i+=4,i+=$e.parseSyncSafeInteger(t.data.subarray(10,14)),s-=$e.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=$e.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,$e.frameParsers[o.id]?$e.frameParsers[o.id](o):"T"===o.id[0]?$e.frameParsers["T*"](o):"W"===o.id[0]&&$e.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var c=o.data,u=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;u*=4,u+=3&c[7],o.timeStamp=u,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<s);this.trigger("data",t)}}}).prototype=new $;var He,ze,Ve,We=Le,Ge=$,Xe=Ee,Ke=xe,Ye=Me.TimestampRolloverStream,Qe=188;(He=function(){var e=new Uint8Array(Qe),t=0;He.prototype.init.call(this),this.push=function(i){var s,n=0,r=Qe;for(t?((s=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),s.set(i,t),t=0):s=i;r<s.byteLength;)71!==s[n]||71!==s[r]?(n++,r++):(this.trigger("data",s.subarray(n,r)),n+=Qe,r+=Qe);n<s.byteLength&&(e.set(s.subarray(n),0),t=s.byteLength-n)},this.flush=function(){t===Qe&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new Ge,(ze=function(){var e,t,i,s;ze.prototype.init.call(this),s=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,s){var n=0;s.payloadUnitStartIndicator&&(n+=e[n]+1),"pat"===s.type?t(e.subarray(n),s):i(e.subarray(n),s)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],s.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=s.pmtPid},i=function(e,t){var i,n;if(1&e[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var r=e[n],a=(31&e[n+1])<<8|e[n+2];r===Ke.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===Ke.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===Ke.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&e[n+3])<<8|e[n+4])}t.programMapTable=s.programMapTable}},this.push=function(t){var i={},s=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(s+=t[s]+1),0===i.pid)i.type="pat",e(t.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
vendor: 3,061 bytes, line 2
2else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,s,i]):this.processPes_(t,s,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ke.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ke.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new Ge,ze.STREAM_TYPES={h264:27,adts:15},Ve=function(){var e,t=this,i=!1,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},a=function(e,i,s){var n,r,a=new Uint8Array(e.size),o={type:i},l=0,c=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],a.set(r.data,c),c+=r.data.byteLength;!function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===s&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),n="video"===i||o.packetLength<=e.size,(s||n)&&(e.size=0,e.data.length=0),n&&t.trigger("data",o)}};Ve.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ke.H264_STREAM_TYPE:e=s,t="video";break;case Ke.ADTS_STREAM_TYPE:e=n,t="audio";break;case Ke.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var s={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",s)}})[o.type]()},this.reset=function(){s.size=0,s.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(s,"video"),a(n,"audio"),a(r,"timed-metadata")},this.flush=function(){if(!i&&e){var s={type:"metadata",tracks:[]};null!==e.video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",s)}i=!1,this.flushStreams_(),this.trigger("done")}},Ve.prototype=new Ge;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Qe,TransportPacketStream:He,TransportParseStream:ze,ElementaryStream:Ve,TimestampRolloverStream:Ye,CaptionStream:Xe.CaptionStream,Cea608Stream:Xe.Cea608Stream,Cea708Stream:Xe.Cea708Stream,MetadataStream:We};for(var Je in Ke)Ke.hasOwnProperty(Je)&&(Ze[Je]=Ke[Je]);var et,tt=Ze,it=oe.ONE_SECOND_IN_TS,st=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(et=function(e){var t,i=0;et.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts ski
2ping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(s){var n,r,a,o,l,c=0;if(e||(i=0),"audio"===s.type){var u;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+s.data.byteLength)).set(a),t.set(s.data,a.byteLength)):t=s.data;c+7<t.length;)if(255===t[c]&&240==(246&t[c+1])){if("number"==typeof u&&(this.skipWarn_(u,c),u=null),r=2*(1&~t[c+1]),n=(3&t[c+3])<<11|t[c+4]<<3|(224&t[c+5])>>5,l=(o=1024*(1+(3&t[c+6])))*it/st[(60&t[c+2])>>>2],t.byteLength-c<n)break;this.trigger("data",{pts:s.pts+i*l,dts:s.dts+i*l,sampleCount:o,audioobjecttype:1+(t[c+2]>>>6&3),channelcount:(1&t[c+2])<<2|(192&t[c+3])>>>6,samplerate:st[(60&t[c+2])>>>2],samplingfrequencyindex:(60&t[c+2])>>>2,samplesize:16,data:t.subarray(c+7+r,c+n)}),i++,c+=n}else"number"!=typeof u&&(u=c),c++;"number"==typeof u&&(this.skipWarn_(u,c),u=null),t=t.subarray(c)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new $;var nt,rt,at,ot=et,lt=$,ct=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+s},this.loadWord=function(){var n=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(n,n+a)),i=new DataView(r.buffer).getUint32(0),s=8*a,t-=a},this.skipBits=function(e){var n;s>e?(i<<=e,s-=e):(e-=s,e-=8*(n=Math.floor(e/8)),t-=n,this.loadWord(),i<<=e,s-=e)},this.readBits=function(e){var n=Math.min(s,e),r=i>>>32-n;return(s-=n)>0?i<<=n:t>0&&this.loadWord(),(n=e-n)>0?r<<n|this.readBits(n):r},this.skipLeadingZeros=function(){var e;for(e=0;e<s;++e)if(i&2147483648>>>e)return i<<=e,s-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(rt=function(){var e,t,i=0;rt.prototype.init.call(this),this.push=function(s){var n;t?((n=new Uint8Array(t.byteLength+s.data.byteLength)).set(t),n.set(s.data,t.byteLength),t=n):t=s.data;for(var r=t.byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<r);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new lt,at={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},nt=function(){var e,t,i,s,n,r,a,o=new rt;nt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:s,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=n(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=n(a.subarray(1)),o.config=r(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,s=8,n=8;for(i=0;i<e;i++)0!==n&&(n=(s+t.readExpGolomb()+256)%256),s=0===n?s:n},n=function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},r=function(e){var t,i,s,n,r,o,l,c,u,d,h,p,m=0,g=0,f=0,y=0,_=[1,1];if(i=(t=new ct(e)).readUnsignedByte(),n=t.readUnsignedByte(),s=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),at[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==r?8:12,p=0;p<h;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),c=t.readUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}_&&(_[0],_[1])}return{profileIdc:i,levelIdc:s,profileCompatibility:n,width:16*(c+1)-2*m-2*g,height:(2-d)*(u+1)*16-2*f-2*y,sarRatio:_}}},nt.prototype=new lt;var ut,dt={H264Stream:nt,NalByteStream:rt},ht=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],pt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},mt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1
vendor: 4,588 bytes, line 2
2]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=pt(e,t),mt(e,t))},gt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},ft=function(e,t,i){return unescape(function(e,t,i){var s,n="";for(s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n}(e,t,i))},yt={isLikelyAacData:function(e){var t=mt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:pt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,s=e[t+4]<<3;return 6144&e[t+3]|s|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ht[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,s;t=10,64&e[5]&&(t+=4,t+=gt(e.subarray(10,14)));do{if((i=gt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){s=e.subarray(t+10,t+i+10);for(var n=0;n<s.byteLength;n++)if(0===s[n]){if("com.apple.streaming.transportStreamTimestamp"===ft(s,0,n)){var r=s.subarray(n+1),a=(1&r[3])<<30|r[4]<<22|r[5]<<14|r[6]<<6|r[7]>>>2;return(a*=4)+(3&r[7])}break}}t+=10,t+=i}while(t<e.byteLength);return null}},_t=yt;(ut=function(){var e=new Uint8Array,t=0;ut.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var s,n,r,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=_t.parseAdtsSize(e,l))>e.length)break;r={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",r),l+=o}else{if(e.length-l<10)break;if(l+(o=_t.parseId3TagSize(e,l))>e.length)break;n={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",n),l+=o}s=e.length-l,e=s>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new $;var vt,bt,Tt,St,Ct=$,wt=ee,kt=ie,Et=ce,xt=de,It=tt,At=oe,Pt=ot,Dt=dt.H264Stream,Lt=ut,Mt=yt.isLikelyAacData,Nt=oe.ONE_SECOND_IN_TS,Ot=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Rt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ut=function(e,t){t.stream=e,this.trigger("log",t)},Bt=function(e,t){for(var i=Object.keys(t),s=0;s<i.length;s++){var n=i[s];"headOfPipeline"!==n&&t[n].on&&t[n].on("log",Ut.bind(e,n))}},Ft=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},jt=function(e,t,i,s,n,r){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(s-t),pts:e+(n-i)},prependedContentDuration:r,baseMediaDecodeTime:e}};bt=function(e,t){var i,s=[],n=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,bt.prototype.init.call(this),this.push=function(t){xt.collectDtsInfo(e,t),e&&Ot.forEach(function(i){e[i]=t[i]}),s.push(t)},this.setEarliestDts=function(e){n=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){r=e},this.flush=function(){var o,l,c,u,d,h,p;0!==s.length?(o=Et.trimAdtsFramesByEarliestDts(s,e,n),e.baseMediaDecodeTime=xt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=Et.prefixWithSilence(e,o,r,a),e.samples=Et.generateSampleTable(o),c=wt.mdat(Et.concatenateFrameData(o)),s=[],l=wt.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),xt.clearDtsInfo(e),d=Math.ceil(1024*Nt/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",jt(At.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:u}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){xt.clearDtsInfo(e),s=[],this.trigger("reset")}},bt.prototype=new Ct,vt=function(e,t){var i,s,n,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,vt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){xt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.config,e.sps=[t.data],Rt.forEach(function(t){e[t]=s[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var s,n,o,l,c,u,d,h,p=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();
vendor: 5,097 bytes, line 2
2if(0===r.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(s=kt.groupNalsIntoFrames(r),(o=kt.groupFramesIntoGops(s))[0][0].keyFrame||((n=this.getGopForFusion_(r[0],e))?(p=n.duration,o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=kt.extendFirstKeyFrame(o)),a.length){var m;if(!(m=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");xt.clearDtsInfo(e),o=m}xt.collectDtsInfo(e,o),e.samples=kt.generateSampleTable(o),c=wt.mdat(kt.concatenateNalData(o)),e.baseMediaDecodeTime=xt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",jt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=wt.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){xt.clearDtsInfo(e),s=void 0,n=void 0},this.getGopForFusion_=function(t){var i,s,n,r,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)n=(r=this.gopCache_[a]).gop,e.pps&&Ft(e.pps[0],r.pps[0])&&e.sps&&Ft(e.sps[0],r.sps[0])&&(n.dts<e.timelineStartInfo.dts||(i=t.dts-n.dts-n.duration)>=-1e4&&i<=45e3&&(!s||o>i)&&(s=r,o=i));return s?s.gop:null},this.alignGopsAtStart_=function(e){var t,i,s,n,r,o,l,c;for(r=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(s=a[t],n=e[i],s.pts!==n.pts);)n.pts>s.pts?t++:(i++,r-=n.byteLength,o-=n.nalCount,l-=n.duration);return 0===i?e:i===e.length?null:((c=e.slice(i)).byteLength=r,c.duration=l,c.nalCount=o,c.pts=c[0].pts,c.dts=c[0].dts,c)},this.alignGopsAtEnd_=function(e){var t,i,s,n,r,o,l;for(t=a.length-1,i=e.length-1,r=null,o=!1;t>=0&&i>=0;){if(s=a[t],n=e[i],s.pts===n.pts){o=!0;break}s.pts>n.pts?t--:(t===a.length-1&&(r=i),i--)}if(!o&&null===r)return null;if(0===(l=o?i:r))return e;var c=e.slice(l),u=c.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return c.byteLength=u.byteLength,c.duration=u.duration,c.nalCount=u.nalCount,c.pts=c[0].pts,c.dts=c[0].dts,c},this.alignGopsWith=function(e){a=e}},vt.prototype=new Ct,St=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,St.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},St.prototype=new Ct,St.prototype.flush=function(e){var t,i,s,n,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Rt.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Ot.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,s=wt.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(s.byteLength),a.initSegment.set(s),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=At.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=At.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStream
vendor: 6,958 bytes, line 2
2s[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=At.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},St.prototype.setRemux=function(e){this.remuxTracks=e},(Tt=function(e){var t,i,s=this,n=!0;Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new It.MetadataStream,n.aacStream=new Lt,n.audioTimestampRolloverStream=new It.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new It.TimestampRolloverStream("timed-metadata"),n.adtsStream=new Pt,n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",function(e){n.aacStream.setTimestamp(e.timeStamp)}),n.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new bt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Bt(this,n)},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="ts",n.metadataStream=new It.MetadataStream,n.packetStream=new It.TransportPacketStream,n.parseStream=new It.TransportParseStream,n.elementaryStream=new It.ElementaryStream,n.timestampRolloverStream=new It.TimestampRolloverStream,n.adtsStream=new Pt,n.h264Stream=new Dt,n.captionStream=new It.CaptionStream(e),n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new vt(t,e),n.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),n.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,n.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime))}),n.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),n.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new bt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",function(e){e.dispatchType=n.metadataStream.dispatchType,s.trigger("id3Frame",e)}),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Bt(this,n)},this.setBaseMediaDecodeTime=function(s){var n=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,xt.clearDtsInfo(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,xt.clearDtsInfo(t),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(n){var t=Mt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),n=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){n=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new Ct;var qt,$t,Ht={Transmuxer:Tt,VideoSegmentStream:vt,AudioSegmentStream:bt,AUDIO_PROPERTIES:Ot,VIDEO_PROPERTIES:Rt,generateSegmentTimingInfo:jt},zt=function(e){return e>>>0},Vt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Wt=zt,Gt=Vt,Xt=function(e,t){var i,s,n,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)s=Wt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),n=Gt(e.subarray(i+4,i+8)),r=s>1?i+s:e.byteLength,n===t[0]&&(1===t.length?o.push(e.subarray(i+8,r)):(a=Xt(e.subarray(i+8,r),t.slice(1))).length&&(o=o.c
vendor: 4,979 bytes, line 2
2oncat(a))),i=r;return o},Kt=Xt,Yt=zt,Qt=z.getUint64,Zt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Qt(e.subarray(4)):t.baseMediaDecodeTime=Yt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},Jt=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},n=1&s.flags[2],r=2&s.flags[2],a=8&s.flags[2],o=16&s.flags[2],l=32&s.flags[2],c=65536&s.flags[0],u=131072&s.flags[0];return t=8,n&&(t+=4,s.baseDataOffset=i.getUint32(12),t+=4),r&&(s.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(s.defaultSampleDuration=i.getUint32(t),t+=4),o&&(s.defaultSampleSize=i.getUint32(t),t+=4),l&&(s.defaultSampleFlags=i.getUint32(t)),c&&(s.durationIsEmpty=!0),!n&&u&&(s.baseDataOffsetIsMoof=!0),s},ei=z.getUint64,ti=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]}},ii=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},s=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&i.flags[2],r=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],u=s.getUint32(4),d=8;for(n&&(i.dataOffset=s.getInt32(d),d+=4),r&&u&&(t={flags:ti(e.subarray(d,d+4))},d+=4,a&&(t.duration=s.getUint32(d),d+=4),o&&(t.size=s.getUint32(d),d+=4),c&&(1===i.version?t.compositionTimeOffset=s.getInt32(d):t.compositionTimeOffset=s.getUint32(d),d+=4),i.samples.push(t),u--);u--;)t={},a&&(t.duration=s.getUint32(d),d+=4),o&&(t.size=s.getUint32(d),d+=4),l&&(t.flags=ti(e.subarray(d,d+4)),d+=4),c&&(1===i.version?t.compositionTimeOffset=s.getInt32(d):t.compositionTimeOffset=s.getUint32(d),d+=4),i.samples.push(t);return i},si=z.getUint64,ni=function(e){return new Date(1e3*e-20828448e5)},ri=Vt,ai=function(e){var t,i,s=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(t=0;t+4<e.length;t+=i)if(i=s.getUint32(t),t+=4,i<=0)n.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:n.push("slice_layer_without_partitioning_rbsp");break;case 5:n.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:n.push("sei_rbsp");break;case 7:n.push("seq_parameter_set_rbsp");break;case 8:n.push("pic_parameter_set_rbsp");break;case 9:n.push("access_unit_delimiter_rbsp");break;default:n.push("UNKNOWN NAL - "+e[t]&31)}return n},oi={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:qt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,s,n,r=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:[]},o=31&e[5];for(s=6,n=0;n<o;n++)i=r.getUint16(s),s+=2,a.sps.push(new Uint8Array(e.subarray(s,s+i))),s+=i;for(t=e[s],s++,n=0;n<t;n++)i=r.getUint16(s),s+=2,a.pps.push(new Uint8Array(e.subarray(s,s+i))),s+=i;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)}},edts:function(e){return{boxes:qt(e)}},elst:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},n=i.getUint32(4);for(t=8;n;n--)0===s.version?(s.edits.push({segmentDuration:i.getUint32(t),mediaTime:i.getInt32(t+4),mediaRate:i.getUint16(t+8)+i.getUint16(t+10)/65536}),t+=12):(s.edits.push({segmentDuration:si(e.subarray(t)),mediaTime:si(e.subarray(t+8)),mediaRate:i.getUint16(t+16)+i.getUint16(t+18)/65536}),t+=20);return s},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:e[12]>>>2&63,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:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:ri(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},s=8;s<e.byteLength;)i.compatibleBrands.push(ri(e.subarray(s,s+4))),s+=4;return i},dinf:function(e){return{boxes:qt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:qt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:ri(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;
vendor: 4,199 bytes, line 2
2i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:ai(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=4,n={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===n.version?(s+=4,n.creationTime=ni(i.getUint32(s)),s+=8,n.modificationTime=ni(i.getUint32(s)),s+=4,n.timescale=i.getUint32(s),s+=8,n.duration=i.getUint32(s)):(n.creationTime=ni(i.getUint32(s)),s+=4,n.modificationTime=ni(i.getUint32(s)),s+=4,n.timescale=i.getUint32(s),s+=4,n.duration=i.getUint32(s)),s+=4,t=i.getUint16(s),n.language+=String.fromCharCode(96+(t>>10)),n.language+=String.fromCharCode(96+((992&t)>>5)),n.language+=String.fromCharCode(96+(31&t)),n},mdia:function(e){return{boxes:qt(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:qt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=qt(e.subarray(28))[0]),i},moof:function(e){return{boxes:qt(e)}},moov:function(e){return{boxes:qt(e)}},mvex:function(e){return{boxes:qt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,s={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===s.version?(i+=4,s.creationTime=ni(t.getUint32(i)),i+=8,s.modificationTime=ni(t.getUint32(i)),i+=4,s.timescale=t.getUint32(i),i+=8,s.duration=t.getUint32(i)):(s.creationTime=ni(t.getUint32(i)),i+=4,s.modificationTime=ni(t.getUint32(i)),i+=4,s.timescale=t.getUint32(i),i+=4,s.duration=t.getUint32(i)),i+=4,s.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,s.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,s.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,s.nextTrackId=t.getUint32(i),s},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,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12;0===i.version?(i.earliestPresentationTime=t.getUint32(s),i.firstOffset=t.getUint32(s+4),s+=8):(i.earliestPresentationTime=ei(e.subarray(s)),i.firstOffset=ei(e.subarray(s+8)),s+=16),s+=2;var n=t.getUint16(s);for(s+=2;n>0;s+=12,n--)i.references.push({referenceType:(128&e[s])>>>7,referencedSize:2147483647&t.getUint32(s),subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(128&e[s+8]),sapType:(112&e[s+8])>>>4,sapDeltaTime:268435455&t.getUint32(s+8)});return i},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:qt(e)}},ctts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},n=i.getUint32(4);for(t=8;n;t+=8,n--)s.compositionOffsets.push({sampleCount:i.getUint32(t),sampleOffset:i[0===s.version?"getUint32":"getInt32"](t+4)});return s},stss:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},n=i.getUint32(4);for(t=8;n;t+=4,n--)s.syncSamples.push(i.getUint32(t));return s},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},n=i.getUint32(4);for(t=8;n;t+=4,n--)s.chunkOffsets.push(i.getUint32(t));return s},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=i.getUint32(4),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;s;
vendor: 73,589 bytes, line 2
2t+=12,s--)n.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return n},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:qt(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)s.entries.push(i.getUint32(t));return s},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},n=i.getUint32(4);for(t=8;n;t+=8,n--)s.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return s},styp:function(e){return oi.ftyp(e)},tfdt:Zt,tfhd:Jt,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,s={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===s.version?(i+=4,s.creationTime=ni(t.getUint32(i)),i+=8,s.modificationTime=ni(t.getUint32(i)),i+=4,s.trackId=t.getUint32(i),i+=4,i+=8,s.duration=t.getUint32(i)):(s.creationTime=ni(t.getUint32(i)),i+=4,s.modificationTime=ni(t.getUint32(i)),i+=4,s.trackId=t.getUint32(i),i+=4,i+=4,s.duration=t.getUint32(i)),i+=4,i+=8,s.layer=t.getUint16(i),i+=2,s.alternateGroup=t.getUint16(i),i+=2,s.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,s.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,s.width=t.getUint16(i)+t.getUint16(i+2)/65536,i+=4,s.height=t.getUint16(i)+t.getUint16(i+2)/65536,s},traf:function(e){return{boxes:qt(e)}},trak:function(e){return{boxes:qt(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:ii,"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)])}}};qt=function(e){for(var t,i,s,n,r,a=0,o=[],l=new ArrayBuffer(e.length),c=new Uint8Array(l),u=0;u<e.length;++u)c[u]=e[u];for(t=new DataView(l);a<e.byteLength;)i=t.getUint32(a),s=ri(e.subarray(a+4,a+8)),n=i>1?a+i:e.byteLength,(r=(oi[s]||function(e){return{data:e}})(e.subarray(a+8,n))).size=i,r.type=s,o.push(r),a=n;return o},$t=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map(function(e,s){return i+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var s=i+" "+t+": ",n=e[t];if(n instanceof Uint8Array||n instanceof Uint32Array){var r=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);return r?1===r.length?s+"<"+r.join("").slice(1)+">":s+"<\n"+r.map(function(e){return i+" "+e}).join("\n")+"\n"+i+" >":s+"<>"}return s+JSON.stringify(n,null,2).split("\n").map(function(e,t){return 0===t?e:i+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+$t(e.boxes,t+1):"")}).join("\n")};var li,ci,ui,di,hi,pi,mi,gi={inspect:qt,textify:$t,parseType:ri,findBox:Kt,parseTraf:oi.traf,parseTfdt:oi.tfdt,parseHdlr:oi.hdlr,parseTfhd:oi.tfhd,parseTrun:oi.trun,parseSidx:oi.sidx},fi=function(e){for(var t=0,i=String.fromCharCode(e[t]),s="";"\0"!==i;)s+=i,t++,i=String.fromCharCode(e[t]);return s+i},yi=z.getUint64,_i=function(e){return void 0!==e||null!==e},vi={parseEmsgBox:function(e){var t,i,s,n,r,a,o,l=4,c=e[0];if(0===c)l+=(t=fi(e.subarray(l))).length,l+=(i=fi(e.subarray(l))).length,s=(u=new DataView(e.buffer)).getUint32(l),l+=4,r=u.getUint32(l),l+=4,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4;else if(1===c){var u;s=(u=new DataView(e.buffer)).getUint32(l),l+=4,n=yi(e.subarray(l)),l+=8,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4,l+=(t=fi(e.subarray(l))).length,l+=(i=fi(e.subarray(l))).length}var d={scheme_id_uri:t,value:i,timescale:s||1,presentation_time:n,presentation_time_delta:r,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return function(e,t){var i="\0"!==t.scheme_id_uri,s=0===e&&_i(t.presentation_time_delta)&&i,n=1===e&&_i(t.presentation_time)&&i;return!(e>1)&&s||n}(c,d)?d:void 0},scaleTime:function(e,t,i,s){return e||0===e?e/t:s+i/t}},bi="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Ti=zt,Si=function(e){return("00"+e.toString(16)).slice(-2)},Ci=Kt,wi=Vt,ki=vi,Ei=Jt,xi=ii,Ii=Zt,Ai=z.getUint64,Pi=bi,Di=je.parseId3Frames;li=function(e){return Ci(e,["moov","trak"]).reduce(function(e,t){var i,s,n,r,a;return(i=Ci(t,["tkhd"])[0])?(s=i[0],r=Ti(i[n=0===s?12:20]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]),(a=Ci(t,["mdia","mdhd"])[0])?(n=0===(s=a[0])?12:20,e[r]=Ti(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]),e):null):null},{})},ci=function(e,t){var i=Ci(t,["moof","traf"]).reduce(function(t,i){var s,n=Ci(i,["tfhd"])[0],r=Ti(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),a=e[r]||9e4,o=Ci(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let c;return"bigint"==typeof(s=1===o[0]?Ai(o.subarray(4,12)):l.getUint32(4))?c=s/Pi.BigInt(a):"number"!=typeof s||isNaN(s)||(c=s/a),c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),c<t&&(t=c),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},ui=function(e,t){var i,s=Ci(t,["moof","traf"]),n=0,r=0;if(s&&s.length){var a=Ci(s[0],["tfhd"])[0],o=Ci(s[0],["trun"])[0],l=Ci(s[0],["tfdt"])[0];if(a&&(i=Ei(a).trackId),l&&(n=Ii(l).baseMediaDecodeTime),o){var c=xi(o);c.samples&&c.samples.length&&(r=c.samples[0].compositionTimeOffset||0)}}var u=e[i]||9e4;"bigint"==typeof n&&(r=Pi.BigInt(r),u=Pi.BigInt(u));var d=(n+r)/u;return"bigint"==typeof d&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d},di=function(e){var t=Ci(e,["moov","trak"]),i=[];return t.forEach(function(e){var t=Ci(e,["mdia","hdlr"]),s=Ci(e,["tkhd"]);t.forEach(function(e,t){var n,r,a=wi(e.subarray(8,12)),o=s[t];"vide"===a&&(r=0===(n=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),i.push(r))})}),i},pi=function(e){var t=0===e[0]?12:20;return Ti(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},hi=function(e){var t=Ci(e,["moov","trak"]),i=[];return t.forEach(function(e){var t,s,n={},r=Ci(e,["tkhd"])[0];r&&(s=(t=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),n.id=0===s?t.getUint32(12):t.getUint32(20));var a=Ci(e,["mdia","hdlr"])[0];if(a){var o=wi(a.subarray(8,12));n.type="vide"===o?"video":"soun"===o?"audio":o}var l=Ci(e,["mdia","minf","stbl","stsd"])[0];if(l){var c=l.subarray(8);n.codec=wi(c.subarray(4,8));var u,d=Ci(c,[n.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(n.codec)?(u=d.subarray(78),"avcC"===wi(u.subarray(4,8))&&u.length>11?(n.codec+=".",n.codec+=Si(u[9]),n.codec+=Si(u[10]),n.codec+=Si(u[11])):n.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(n.codec)?(u=d.subarray(28),"esds"===wi(u.subarray(4,8))&&u.length>20&&0!==u[19]?(n.codec+="."+Si(u[19]),n.codec+="."+Si(u[20]>>>2&63).replace(/^0/,"")):n.codec="mp4a.40.2"):n.codec=n.codec.toLowerCase())}var h=Ci(e,["mdia","mdhd"])[0];h&&(n.timescale=pi(h)),i.push(n)}),i},mi=function(e,t=0){return Ci(e,["emsg"]).map(e=>{var i=ki.parseEmsgBox(new Uint8Array(e)),s=Di(i.message_data);return{cueTime:ki.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:ki.scaleTime(i.event_duration,i.timescale),frames:s}})};var Li={findBox:Ci,parseType:wi,timescale:li,startTime:ci,compositionStartTime:ui,videoTrackIds:di,tracks:hi,getTimescaleFromMediaHeader:pi,getEmsgID3:mi};const{parseTrun:Mi}=gi,{findBox:Ni}=Li;var Oi=bi,Ri={getMdatTrafPairs:function(e){var t=Ni(e,["moof","traf"]),i=Ni(e,["mdat"]),s=[];return i.forEach(function(e,i){var n=t[i];s.push({mdat:e,traf:n})}),s},parseSamples:function(e,t,i){var s=t,n=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach(function(e){var t=Mi(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=n),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=s,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof s?(e.pts=s+Oi.BigInt(e.compositionTimeOffset),s+=Oi.BigInt(e.duration)):(e.pts=s+e.compositionTimeOffset,s+=e.duration)}),o=o.concat(t)}),o}},Ui=he.discardEmulationPreventionBytes,Bi=Ee.CaptionStream,Fi=Kt,ji=Zt,qi=Jt,{getMdatTrafPairs:$i,parseSamples:Hi}=Ri,zi=function(e,t){for(var i=e,s=0;s<t.length;s++){var n=t[s];if(i<n.size)return n;i-=n.size}return null},Vi=function(){var e,t,i,s,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new Bi,a=!0,r=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,n.captions.push(e),n.captionStreams[e.stream]=!0}),e.on("log",function(e){n.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&s===t[i])},this.parse=function(e,r,a){var o;if(!this.isInitialized())return null;if(!r||!a)return null;if(this.isNewInit(r,a))i=r[0],s=a[i];else if(null===i||!s)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,a)}return o=function(e,t,i){if(null===t)return null;var s=function(e,t){var i={};return $i(e).forEach(function(e){var s,n=e.mdat,r=e.traf,a=Fi(r,["tfhd"]),o=qi(a[0]),l=o.trackId,c=Fi(r,["tfdt"]),u=c.length>0?ji(c[0]).baseMediaDecodeTime:0,d=Fi(r,["trun"]);t===l&&d.length>0&&(s=function(e,t,i){var s,n,r,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(n=0;n+4<e.length;n+=r)if(r=o.getUint32(n),n+=4,!(r<=0))switch(31&e[n]){case 6:var c=e.subarray(n+1,n+1+r),u=zi(n,t);if(s={nalUnitType:"sei_rbsp",size:r,data:c,escapedRBSP:Ui(c),trackId:i},u)s.pts=u.pts,s.dts=u.dts,a=u;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+n+" for trackId "+i+". See mux.js#223."});break}s.pts=a.pts,s.dts=a.dts}l.seiNals.push(s)}return l}(n,Hi(d,u,o),l),i[l]||(i[l]={seiNals:[],logs:[]}),i[l].seiNals=i[l].seiNals.concat(s.seiNals),i[l].logs=i[l].logs.concat(s.logs))}),i}(e,t)[t]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}}(e,i,s),o&&o.logs&&(n.logs=n.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),n):n.logs.length?{logs:n.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;r?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){n.captions=[],n.captionStreams={},n.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,s=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};const{parseTfdt:Wi}=gi,Gi=Kt,{getTimescaleFromMediaHeader:Xi}=Li,{parseSamples:Ki,getMdatTrafPairs:Yi}=Ri;var Qi=function(){let e=9e4;this.init=function(t){const i=Gi(t,["moov","trak","mdia","mdhd"])[0];i&&(e=Xi(i))},this.parseSegment=function(t){const i=[],s=Yi(t);let n=0;return s.forEach(function(t){const s=t.mdat,r=t.traf,a=Gi(r,["tfdt"])[0],o=Gi(r,["tfhd"])[0],l=Gi(r,["trun"]);if(a){const e=Wi(a);n=e.baseMediaDecodeTime}if(l.length&&o){const t=Ki(l,n,o);let r=0;t.forEach(function(t){const n=new TextDecoder("utf-8"),a=s.slice(r,r+t.size);Gi(a,["vtte"])[0]||Gi(a,["vttc"]).forEach(function(s){const r=Gi(s,["payl"])[0],a=Gi(s,["sttg"])[0],o=t.pts/e,l=(t.pts+t.duration)/e;let c,u;if(r)try{c=n.decode(r)}catch(e){console.error(e)}if(a)try{u=n.decode(a)}catch(e){console.error(e)}t.duration&&c&&i.push({cueText:c,start:o,end:l,settings:u})}),r+=t.size})}}),i}},Zi=xe,Ji=function(e){var t=31&e[1];return(t<<=8)|e[2]},es=function(e){return!!(64&e[1])},ts=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},is=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}},ss={parseType:function(e,t){var i=Ji(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=es(e),i=4+ts(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=es(e),s=4+ts(e);if(i&&(s+=e[s]+1),1&e[s+5]){var n;n=3+((15&e[s+1])<<8|e[s+2])-4;for(var r=12+((15&e[s+10])<<8|e[s+11]);r<n;){var a=s+r;t[(31&e[a+1])<<8|e[a+2]]=e[a],r+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:es,parsePesType:function(e,t){switch(t[Ji(e)]){case Zi.H264_STREAM_TYPE:return"video";case Zi.ADTS_STREAM_TYPE:return"audio";case Zi.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!es(e))return null;var t=4+ts(e);if(t>=e.byteLength)return null;var i,s=null;return 192&(i=e[t+7])&&((s={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,s.pts*=4,s.pts+=(6&e[t+13])>>>1,s.dts=s.pts,64&i&&(s.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,s.dts*=4,s.dts+=(6&e[t+18])>>>1)),s},videoPacketContainsKeyFrame:function(e){for(var t=4+ts(e),i=e.subarray(t),s=0,n=0,r=!1;n<i.byteLength-3;n++)if(1===i[n+2]){s=n+5;break}for(;s<i.byteLength;)switch(i[s]){case 0:if(0!==i[s-1]){s+=2;break}if(0!==i[s-2]){s++;break}n+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===is(31&i[n+3])&&(r=!0);do{s++}while(1!==i[s]&&s<i.length);n=s-2,s+=3;break;case 1:if(0!==i[s-1]||0!==i[s-2]){s+=3;break}"slice_layer_without_partitioning_rbsp_idr"===is(31&i[n+3])&&(r=!0),n=s-2,s+=3;break;default:s+=3}return i=i.subarray(n),s-=n,n=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===is(31&i[n+3])&&(r=!0),r}},ns=xe,rs=Me.handleRollover,as={};as.ts=ss,as.aac=yt;var os=oe.ONE_SECOND_IN_TS,ls=188,cs=71,us=function(e,t,i){for(var s,n,r,a,o=0,l=ls,c=!1;l<=e.byteLength;)if(e[o]!==cs||e[l]!==cs&&l!==e.byteLength)o++,l++;else{if(s=e.subarray(o,l),"pes"===as.ts.parseType(s,t.pid)&&(n=as.ts.parsePesType(s,t.table),r=as.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=as.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o+=ls,l+=ls}for(o=(l=e.byteLength)-ls,c=!1;o>=0;)if(e[o]!==cs||e[l]!==cs&&l!==e.byteLength)o--,l--;else{if(s=e.subarray(o,l),"pes"===as.ts.parseType(s,t.pid)&&(n=as.ts.parsePesType(s,t.table),r=as.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=as.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o-=ls,l-=ls}},ds=function(e,t,i){for(var s,n,r,a,o,l,c,u=0,d=ls,h=!1,p={data:[],size:0};d<e.byteLength;)if(e[u]!==cs||e[d]!==cs)u++,d++;else{if(s=e.subarray(u,d),"pes"===as.ts.parseType(s,t.pid)&&(n=as.ts.parsePesType(s,t.table),r=as.ts.parsePayloadUnitStartIndicator(s),"video"===n&&(r&&!h&&(a=as.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),h=!0),!i.firstKeyFrame))){if(r&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)c=p.data.shift(),o.set(c,l),l+=c.byteLength;if(as.ts.videoPacketContainsKeyFrame(o)){var m=as.ts.parsePesTime(o);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(s),p.size+=s.byteLength}if(h&&i.firstKeyFrame)break;u+=ls,d+=ls}for(u=(d=e.byteLength)-ls,h=!1;u>=0;)if(e[u]!==cs||e[d]!==cs)u--,d--;else{if(s=e.subarray(u,d),"pes"===as.ts.parseType(s,t.pid)&&(n=as.ts.parsePesType(s,t.table),r=as.ts.parsePayloadUnitStartIndicator(s),"video"===n&&r&&(a=as.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),h=!0)),h)break;u-=ls,d-=ls}},hs=function(e,t){var i;return i=as.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,s=0,n=null,r=null,a=0,o=0;e.length-o>=3;){switch(as.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=as.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=as.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=as.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=as.aac.parseSampleRate(t)),s++,o+=a;break;default:o++}if(i)return null}if(null===n||null===r)return null;var l=os/n;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*s*l,pts:r+1024*s*l}]}}(e):function(e){var t={pid:null,table:null},i={};for(var s in function(e,t){for(var i,s=0,n=ls;n<e.byteLength;)if(e[s]!==cs||e[n]!==cs)s++,n++;else{switch(i=e.subarray(s,n),as.ts.parseType(i,t.pid)){case"pat":t.pid=as.ts.parsePat(i);break;case"pmt":var r=as.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach(function(e){t.table[e]=r[e]})}s+=ls,n+=ls}}(e,t),t.table)if(t.table.hasOwnProperty(s))switch(t.table[s]){case ns.H264_STREAM_TYPE:i.video=[],ds(e,t,i),0===i.video.length&&delete i.video;break;case ns.ADTS_STREAM_TYPE:i.audio=[],us(e,t,i),0===i.audio.length&&delete i.audio}return i}(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=rs(e.dts,i),e.pts=rs(e.pts,i),e.dtsTime=e.dts/os,e.ptsTime=e.pts/os})}if(e.video&&e.video.length){var s=t;if((void 0===s||isNaN(s))&&(s=e.video[0].dts),e.video.forEach(function(e){e.dts=rs(e.dts,s),e.pts=rs(e.pts,s),e.dtsTime=e.dts/os,e.ptsTime=e.pts/os}),e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=rs(n.dts,s),n.pts=rs(n.pts,s),n.dtsTime=n.dts/os,n.ptsTime=n.pts/os}}}(i,t),i):null};class ps{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Ht.Transmuxer(this.options),function(e,t){t.on("data",function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=t.data;t.data=s.buffer,e.postMessage({action:"data",segment:t,byteOffset:s.byteOffset,byteLength:s.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){const i={start:{decode:oe.videoTsToSeconds(t.start.dts),presentation:oe.videoTsToSeconds(t.start.pts)},end:{decode:oe.videoTsToSeconds(t.end.dts),presentation:oe.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:oe.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=oe.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:oe.videoTsToSeconds(t.start),end:oe.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new Vi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||(this.webVttParser=new Qi);const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||(this.webVttParser=new Qi);const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Li.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Li.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Li.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*oe.ONE_SECOND_IN_TS,s=hs(e,i);let n=null;s&&(n={hasVideo:s.video&&2===s.video.length||!1,hasAudio:s.audio&&2===s.audio.length||!1},n.hasVideo&&(n.videoStart=s.video[0].ptsTime),n.hasAudio&&(n.audioStart=s.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:n,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(oe.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new ps(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new ps(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}));var il=Zo(tl);const sl=e=>{const{transmuxer:t,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:c,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:d,onId3:h,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:y,segment:_,triggerSegmentEventFn:v}=e,b={buffer:[]};let T=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:c}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data},d={type:s,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};void 0!==l&&(d.videoFrameDtsTime=l),void 0!==c&&(d.videoFramePtsTime=c),i(d)})(i,b,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,b),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&c(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:b,callback:m}),nl(t))))},t.onerror=()=>{const e={message:"Received an error message from the transmuxer worker",metadata:{errorType:wa.Error.StreamingFailedToTransmuxSegment,segmentInfo:Bl({segment:_})}};m(null,e)},s&&t.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),void 0!==r&&t.postMessage({action:"setRemux",remux:r}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,s=i instanceof ArrayBuffer?0:i.byteOffset;v({type:"segmenttransmuxingstart",segment:_}),t.postMessage({action:"push",data:e,byteOffset:s,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},nl=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():sl(e.currentTransmux))},rl=(e,t)=>{e.postMessage({action:t}),nl(e)};var al=e=>{((e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void rl(t,e);t.transmuxQueue.push(rl.bind(null,t,e))})("reset",e)};const ol=function(e){const t=e.transmuxer,i=e.endAction||e.action,s=e.callback,n=d({},e,{endAction:null,transmuxer:null,callback:null}),r=n=>{n.data.action===i&&(t.removeEventListener("message",r),n.data.data&&(n.data.data=new Uint8Array(n.data.data,e.byteOffset||0,e.byteLength||n.data.data.byteLength),e.data&&(e.data=n.data.data)),s(n.data))};if(t.addEventListener("message",r),e.data){const i=e.data instanceof ArrayBuffer;n.byteOffset=i?0:e.data.byteOffset,n.byteLength=e.data.byteLength;const s=[i?e.data:e.data.buffer];t.postMessage(n,s)}else t.postMessage(n)},ll=-101,cl=-102,ul="wvtt",dl=e=>{e.forEach(e=>{e.abort()})},hl=(e,t)=>{const{requestType:i}=t,s=go({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:ll,xhr:t,metadata:s}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:cl,xhr:t,metadata:s}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t,metadata:s}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t,metadata:s}:null},pl=(e,t,i,s)=>(n,r)=>{const a=r.response,o=hl(n,r);if(o)return i(o,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:2,xhr:r},e);const l=new DataView(a),c=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=c;const u={uri:r.uri};return s({type:"segmentkeyloadcomplete",segment:e,keyInfo:u}),i(null,e)},ml=(e,t)=>{const i=ot(e.map.bytes);if("mp4"!==i){const s=e.map.resolvedUri||e.map.uri,n=i||"unknown";return t({internal:!0,message:`Found unsupported ${n} container for initialization segment at URL: ${s}`,code:2,metadata:{mediaType:n}})}ol({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>(e.map.bytes=s,i.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),"text"===t.type&&((e,t)=>{t===ul&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})})(e,t.codec))}),t(null))})},gl=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{const m=e.map&&e.map.tracks||{},g=Boolean(m.audio&&m.video);let f=s.bind(null,e,"audio","start");const y=s.bind(null,e,"audio","end");let _=s.bind(null,e,"video","start");const v=s.bind(null,e,"video","end");ol({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:s=>{e.bytes=t=s.data;const m=s.result;m&&(i(e,{hasAudio:m.hasAudio,hasVideo:m.hasVideo,isMuxed:g}),i=null),(e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void sl(e);e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:g,onData:t=>{t.type="combined"===t.type?"video":t.type,u(e,t)},onTrackInfo:t=>{i&&(g&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{f&&void 0!==e.start&&(f(e.start),f=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{_&&void 0!==e.start&&(_(e.start),_=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:t=>{const i={pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),n(t)},onAudioSegmentTimingInfo:t=>{const i={pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}};p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:i}),r(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{c()},onTransmuxerLog:h,onDone:(t,i)=>{d&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),d(i,e,t))},segment:e,triggerSegmentEventFn:p})}})},fl=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=new Uint8Array(t);if(function(e){return Ve(e,["moof"]).length>0}(m)){e.isFmp4=!0;const{tracks:n}=e.map;if(n.text&&(!n.audio||!n.video))return u(e,{data:m,type:"text"}),void((e,t,i)=>{t===ul&&ol({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:({data:t,mp4VttCues:s})=>{e.bytes=t,i(null,e,{mp4VttCues:s})}})})(e,n.text.codec,d);const r={isFmp4:!0,hasVideo:!!n.video,hasAudio:!!n.audio};n.audio&&n.audio.codec&&"enca"!==n.audio.codec&&(r.audioCodec=n.audio.codec),n.video&&n.video.codec&&"encv"!==n.video.codec&&(r.videoCodec=n.video.codec),n.video&&n.audio&&(r.isMuxed=!0),i(e,r);const l=(t,i)=>{u(e,{data:m,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),d(null,e,{})};return void ol({action:"probeMp4StartTime",timescales:e.map.timescales,data:m,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=m=i,r.hasAudio&&!r.isMuxed&&s(e,"audio","start",a),r.hasVideo&&s(e,"video","start",a),ol({action:"probeEmsgID3",data:m,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:s})=>{t=i.buffer,e.bytes=m=i,n.video&&i.byteLength&&e.transmuxer?ol({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:m,timescales:e.map.timescales,trackIds:[n.video.id],callback:i=>{t=i.data.buffer,e.bytes=m=i.data,i.logs.forEach(function(e){h(La(e,{stream:"mp4CaptionParser"}))}),l(i.captions,s)}}):l(void 0,s)}})}})}if(e.transmuxer){if(void 0===e.container&&(e.container=ot(m)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void d(null,e,{});gl({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})}else d(null,e,{})},yl=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s,segment:n,doneFn:r},a){const o=t=>{if(t.data.source===e){s.removeEventListener("message",o);const e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let l;s.onerror=()=>{const e="An error occurred in the decryption worker",t=Bl({segment:n}),i={message:e,metadata:{error:new Error(e),errorType:wa.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};r(i,n)},s.addEventListener("message",o),l=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),s.postMessage(Uo({source:e,encrypted:i,key:l,iv:t.iv}),[i.buffer,l.buffer])},_l=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y})=>{const _=[],v=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{let m=0,g=!1;return(f,y)=>{if(!g){if(f)return g=!0,dl(e),d(f,y);if(m+=1,m===e.length){const m=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),yl({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:d},e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),fl({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})})})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p});fl({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),yl({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:d},t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),ml(y,t=>{if(t)return dl(e),d(t,y);m()})});m()}}}})({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y});if(s.key&&!s.key.bytes){const i=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&i.push(s.map.key);const n=La(t,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=pl(s,i,v,y);y({type:"segmentkeyloadstart",segment:s,keyInfo:{uri:s.key.resolvedUri}});const a=e(n,r);_.push(a)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const i=La(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),n=pl(s,[s.map.key],v,y);y({type:"segmentkeyloadstart",segment:s,keyInfo:{uri:s.map.key.resolvedUri}});const r=e(i,n);_.push(r)}const i=La(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Mo(s.map),requestType:"segment-media-initialization"}),n=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(s,n)=>{const r=hl(s,n);if(r)return t(r,e);const a=new Uint8Array(n.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,ml(e,function(i){if(i)return i.xhr=n,i.status=n.status,t(i,e);t(null,e)})})({segment:s,finishProcessingFn:v,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:s});const r=e(i,n);_.push(r)}const b=La(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Mo(s),requestType:"segment"}),T=(({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:s})=>(n,r)=>{const a=hl(n,r);if(a)return t(a,e);s({type:"segmentloaded",segment:e});const o="arraybuffer"!==i&&r.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(r.responseText.substring(e.lastReachedChar||0)):r.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(r),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)})({segment:s,finishProcessingFn:v,responseType:b.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:s});const S=e(b,T);S.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u})=>i=>{if(!i.target.aborted)return e.stats=La(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)})({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:p,dataFn:m})),_.push(S);const C={};return _.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:C,abortFn:n}))}),()=>dl(_)},vl=Da("PlaylistSelector"),bl=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},Tl=function(e,t){if(!e)return"";const i=n().getComputedStyle(e);return i?i[t]:""},Sl=function(e,t){const i=e.slice();e.sort(function(e,s){const n=t(e,s);return 0===n?i.indexOf(e)-i.indexOf(s):n})},Cl=function(e,t){let i,s;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||n().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(s=t.attributes.BANDWIDTH),s=s||n().Number.MAX_VALUE,i-s};let wl=function(e){const{main:t,bandwidth:i,playerWidth:s,playerHeight:r,playerObjectFit:a,limitRenditionByPlayerDimensions:o,playlistController:l}=e;if(!t)return;const c={bandwidth:i,width:s,height:r,limitRenditionByPlayerDimensions:o};let u=t.playlists;ao.isAudioOnly(t)&&(u=l.getAudioTrackPlaylists_(),c.audioOnly=!0);let d=u.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,s=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||n().Number.MAX_VALUE,{bandwidth:t,width:i,height:s,playlist:e}});Sl(d,(e,t)=>e.bandwidth-t.bandwidth),d=d.filter(e=>!ao.isIncompatible(e.playlist));let h=d.filter(e=>ao.isEnabled(e.playlist));h.length||(h=d.filter(e=>!ao.isDisabled(e.playlist)));const p=h.filter(e=>e.bandwidth*Yo.BANDWIDTH_VARIANCE<i);let m=p[p.length-1];const g=p.filter(e=>e.bandwidth===m.bandwidth)[0];if(!1===o){const e=g||h[0]||d[0];if(e&&e.playlist){let t="sortedPlaylistReps";return g&&(t="bandwidthBestRep"),h[0]&&(t="enabledPlaylistReps"),vl(`choosing ${bl(e)} using ${t} with options`,c),e.playlist}return vl("could not choose a playlist with options",c),null}const f=p.filter(e=>e.width&&e.height);Sl(f,(e,t)=>e.width-t.width);const y=f.filter(e=>e.width===s&&e.height===r);m=y[y.length-1];const _=y.filter(e=>e.bandwidth===m.bandwidth)[0];let v,b,T,S;if(_||(v=f.filter(e=>"cover"===a?e.width>s&&e.height>r:e.width>s||e.height>r),b=v.filter(e=>e.width===v[0].width&&e.height===v[0].height),m=b[b.length-1],T=b.filter(e=>e.bandwidth===m.bandwidth)[0]),l.leastPixelDiffSelector){const e=f.map(e=>(e.pixelDiff=Math.abs(e.width-s)+Math.abs(e.height-r),e));Sl(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),S=e[0]}const C=S||T||_||g||h[0]||d[0];if(C&&C.playlist){let e="sortedPlaylistReps";return S?e="leastPixelDiffRep":T?e="resolutionPlusOneRep":_?e="resolutionBestRep":g?e="bandwidthBestRep":h[0]&&(e="enabledPlaylistReps"),vl(`choosing ${bl(C)} using ${e} with options`,c),C.playlist}return vl("could not choose a playlist with options",c),null};const kl=function(){let e=this.useDevicePixelRatio&&n().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),wl({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Tl(this.tech_.el(),"width"),10)*e,playerHeight:parseInt(Tl(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?Tl(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function El(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const xl={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Il=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Al=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,wa.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},Pl=function(e,t,i){let s,n;if(i&&i.cues)for(s=i.cues.length;s--;)n=i.cues[s],n.startTime>=e&&n.endTime<=t&&i.removeCue(n)},Dl=e=>"number"==typeof e&&isFinite(e),Ll=1/60,Ml=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:c,timeline:u}=e,d=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=` with independent ${e.independent}`);const p="number"==typeof c,m=e.segment.uri?"segment":"pre-segment",g=p?Wa({preloadSegment:s})-1:0;return`${m} [${r+l}/${r+d}]`+(p?` part [${c}/${g}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${h}]`+` playlist [${a}]`},Nl=e=>`${e}TimingInfo`,Ol=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(t===i)return!1;if("audio"===s){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===s&&n){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},Rl=e=>{const t=e.pendingSegment_;if(t&&Ol({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;const t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),s=t&&i,n=s&&t.to!==i.to;return!(!s||-1===t.from||-1===i.from||!n)})(e.timelineChangeController_)){if((e=>{const t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},Ul=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Na,Bl=({type:e,segment:t})=>{if(!t)return;const i=Boolean(t.key||t.map&&t.map.ke),s=Boolean(t.map&&!t.map.bytes),n=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:n,duration:t.duration,isEncrypted:i,isMediaInitialization:s}};class Fl extends wa.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Da(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Rl(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger(d({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Rl(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger(d({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Rl(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Rl(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return(e=>{const t=new il;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state)return this.pendingSegment_&&(this.pendingSegment_=null),void this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,n().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&al(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ma();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Bo(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;const i=Fo(e);let s=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;if(this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${qa(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const r=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${r}]`),null!==this.mediaIndex)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}s&&(s.mediaIndex-=r,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&al(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},s=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const r=()=>{n--,0===n&&i()};!s&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,r)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,s)=>{const n=Math.ceil((t-s)*lt.ONE_SECOND_IN_TS),r=Math.ceil((i-s)*lt.ONE_SECOND_IN_TS),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=r););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=n););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,r));for(const i in this.inbandTextTracks_)Pl(e,t,this.inbandTextTracks_[i]);Pl(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=n().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=n().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Bl({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const s="number"==typeof e&&t.segments[e],n=e+1===t.segments.length,r=!s||!s.parts||i+1===s.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&n&&r}chooseNextRequest_(){const e=this.buffered_(),t=qa(e)||0,i=$a(e,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const s=[];let n=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline&&(s.push(r),n+=a.duration,n>i))return r}return 0===s.length?0:s[s.length-1]}(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=r[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,s;const n=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${n}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(n);if(!t){const e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:wa.Error.StreamingFailedToSelectNextSegment,error:new Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,s=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=ao.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:n,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,s=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${n}`:`currentTime ${n}`,a.mediaIndex=e,a.startOfSegment=s,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!c&&!l.independent)if(0===a.partIndex){const e=r[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const u=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,c=i.segments[s],u="number"==typeof a&&c.parts[a],d={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:u?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:u&&u.duration||c.duration,segment:c,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});const p=qa(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const s=Math.ceil((t-i+3)*lt.ONE_SECOND_IN_TS);let n;for(n=0;n<e.length&&!(e[n].pts>s);n++);return e.slice(n)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>n||e!==t?e<t?i:s.length?s.end(s.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,s=this.pendingSegment_.duration,n=ao.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),r=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const a=function(e){const{main:t,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,c=t.playlists.filter(e=>!ao.isIncompatible(e));let u=c.filter(ao.isEnabled);u.length||(u=c.filter(e=>!ao.isDisabled(e)));const d=u.filter(ao.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{const t=l.getSyncPoint(e,n,o,i)?1:2;return{playlist:e,rebufferingImpact:ao.estimateSegmentRequestTime(r,s,e)*t-a}}),h=d.filter(e=>e.rebufferingImpact<=0);return Sl(h,(e,t)=>Cl(t.playlist,e.playlist)),h.length?h[0]:(Sl(d,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),d[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=n-r-a.rebufferingImpact;let l=.5;r<=Na&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Yo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Ml(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:s}=t,n={segmentInfo:Bl({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),s=Object.keys(t).sort();if(i.length!==s.length)return!1;for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n])return!1;if(e[r]!==t[r])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Rl(this)))}handleTimingInfo_(e,t,i,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,r=Nl(t);n[r]=n[r]||{},n[r][i]=s,this.logger_(`timinginfo: ${t} - ${i} - ${s}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Rl(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach(e=>{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(s).forEach(e=>{const{startTime:t,endTime:r,captions:a}=s[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let s=i;/^cc708_/.test(i)&&(s="SERVICE"+i.split("_")[1]);const n=t.textTracks().getTrackById(s);if(n)e[i]=n;else{let n=i,r=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[s];o&&(n=o.label,r=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:s,default:a,label:n,language:r},!1).track}}}(o,this.vhs_.tech_,e),Pl(t,r,o[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const s=n().WebKitDataCue||n().VTTCue;t.forEach(t=>{const n=t.stream;t.content?t.content.forEach(r=>{const a=new s(t.startTime+i,t.endTime+i,r.text);a.line=r.line,a.align="left",a.position=r.position,a.positionAlign="line-left",e[n].addCue(a)}):e[n].addCue(new s(t.startTime+i,t.endTime+i,t.text))})}({captionArray:a,inbandTextTracks:o,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Ol({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:s,isMuxed:n}=t;return!(s&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Ol({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Rl(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Nl(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let s;t&&(s=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const e=Bo(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const r=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+ja(r).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+ja(a).join(", "));const o=r.length?r.start(0):0,l=r.length?r.end(r.length-1):0,c=a.length?a.start(0):0,u=a.length?a.end(a.length-1):0;if(l-o<=1&&u-c<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${ja(r).join(", ")}, video buffer: ${ja(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=n().setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){s&&(22!==s.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:wa.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const e=[s];let t=s.byteLength;i&&(e.unshift(i),t+=i.byteLength),n=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t})({bytes:t,segments:e})}const r={segmentInfo:Bl({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:r}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,s[n].transmuxedPresentationStart=i.start.presentation,s[n].transmuxedDecodeStart=i.start.decode,s[n].transmuxedPresentationEnd=i.end.presentation,s[n].transmuxedDecodeEnd=i.end.decode,s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Rl(this),void this.loadQueue_.push(()=>{const t=d({},e,{forceTimestampOffset:!0});d(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=null!==this.mediaIndex,n=e.timeline!==this.currentTimeline_&&e.timeline>0,r=i||s&&n;this.logger_(`Requesting\n${El(e.uri)}\n${Ml(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=_l({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.b
vendor: 5,033 bytes, line 2
2ind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:s})=>{this.logger_(`${Ml(e)} logged from transmuxer stream ${s} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:s,timingInfo:n})=>{const r={segmentInfo:Bl({segment:t})};i&&(r.keyInfo=i),s&&(r.trackInfo=s),n&&(r.timingInfo=n),this.trigger({type:e,metadata:r})}})}trimBackBuffer_(e){const t=((e,t,i)=>{let s=t-Yo.BACK_BUFFER_LENGTH;e.length&&(s=Math.max(s,e.start(0)));const n=t-i;return Math.min(n,s)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,s=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,r={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:s,isMediaInitialization:n},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?r.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(r.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=i}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Ll)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`);const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===cl)return;return this.pause(),e.code===ll?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const s=t[0].pts;let n=0;for(;n<e.length&&!(e[n].pts>=s);n++);return e.slice(0,n).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!r)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===s+n?a.start:s}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:s,isMuxed:n}=t,r="main"===this.loaderType_&&s,a=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);r&&e.waitingOnAppends++,a&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}
vendor: 8,125 bytes, line 2
2checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const e={segmentInfo:Bl({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=((e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach(function(i){const s=e[`${i}TimingInfo`];if(!s)return;const{start:r,end:a}=s;let o;"bigint"==typeof r||"bigint"==typeof a?o=n().BigInt(a)-n().BigInt(r):"number"==typeof r&&"number"==typeof a&&(o=a-r),void 0!==o&&o>t&&(t=o)}),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const s=e.playlist.targetDuration,r=Ul({segmentDuration:i,maxDuration:2*s}),a=Ul({segmentDuration:i,maxDuration:s}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||a?{severity:r?"warn":"info",message:o}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?wa.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${Ml(e)}`);this.logger_(`Appended ${Ml(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,s=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,a=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_(`bad ${r?"segment":"part"} ${Ml(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Ll)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,s=t.end;if(!Dl(i)||!Dl(s))return;Pl(i,s,this.segmentMetadataTrack_);const r=n().WebKitDataCue||n().VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:s},o=new r(i,s,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}}function jl(){}const ql=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},$l=["video","audio"],Hl=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},zl=(e,t)=>{if(0===t.queue.length)return;let i=0,s=t.queue[i];if("mediaSource"!==s.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Hl(e,t)){if(s.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const s=t[i];if("mediaSource"===s.type)return null;if(s.type===e)return i}return null})(e,t.queue),null===i)return;s=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=s,s.action(e,t),s.doneFn?void 0:(t.queuePending[e]=null,void zl(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),s.action(t),s.doneFn&&s.doneFn(),zl("audio",t),zl("video",t))},Vl=(e,t)=>{const i=t[`${e}Buffer`],s=ql(e);i&&(i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]),i.removeEventListener("error",t[`on${s}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Wl=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Gl=(e,t,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(Wl(n.mediaSource,r)){n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{r.appendBuffer(e)}catch(e){n.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`),n.queuePending[s]=null,i(e)}}},Xl=(e,t)=>(i,s)=>{const n=s[`${i}Buffer`];if(Wl(s.mediaSource,n)){s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{n.remove(e,t)}catch(n){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},Kl=e=>(t,i)=>{const s=i[`${t}Buffer`];Wl(i.mediaSource,s)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),s.timestampOffset=e)},Yl=e=>(t,i)=>{e()},Ql=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){wa.log.warn("Failed to call media source endOfStream",e)}}},Zl=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){wa.log.warn("Failed to set media source duration",e)}},Jl=(e,t)=>
vendor: 2,647 bytes, line 2
2i=>{const s=ql(e),n=L(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]),r.addEventListener("error",i[`on${s}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=r},ec=e=>t=>{const i=t[`${e}Buffer`];if(Vl(e,t),Wl(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){wa.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},tc=e=>(t,i)=>{const s=i[`${t}Buffer`],n=L(e);if(!Wl(i.mediaSource,s))return;const r=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===r)return;const o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{s.changeType(n),i.codecs[t]=e}catch(e){o.errorType=wa.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),wa.log.warn(`Failed to changeType on ${t}Buffer`,e)}},ic=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n}),zl(e,t)},sc=(e,t)=>i=>{const s=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const s=e.start(i),n=e.end(i);t+=`${s} --\x3e ${n}. Duration (${n-s})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,s),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}zl(e,t)};class nc extends wa.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>zl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Da("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=sc("video",this),this.onAudioUpdateEnd_=sc("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
vendor: 15,846 bytes, line 2
2triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){ic({type:"mediaSource",sourceUpdater:this,action:Jl(e,t),name:"addSourceBuffer"})}abort(e){ic({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(Wl(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){wa.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?ic({type:"mediaSource",sourceUpdater:this,action:ec(e),name:"removeSourceBuffer"}):wa.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!wa.browser.IS_FIREFOX&&n().MediaSource&&n().MediaSource.prototype&&"function"==typeof n().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return n().SourceBuffer&&n().SourceBuffer.prototype&&"function"==typeof n().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?ic({type:e,sourceUpdater:this,action:tc(t),name:"changeType"}):wa.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;if(this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);if(ic({type:s,sourceUpdater:this,action:Gl(n,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===s){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return Wl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ma()}videoBuffered(){return Wl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ma()}buffered(){const e=Wl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Wl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,s=null,n=0;const r=[],a=[];if(!(e&&e.length&&t&&t.length))return Ma();let o=e.length;for(;o--;)r.push({time:e.start(o),type:"start"}),r.push({time:e.end(o),type:"end"});for(o=t.length;o--;)r.push({time:t.start(o),type:"start"}),r.push({time:t.end(o),type:"end"});for(r.sort(function(e,t){return e.time-t.time}),o=0;o<r.length;o++)"start"===r[o].type?(n++,2===n&&(i=r[o].time)):"end"===r[o].type&&(n--,1===n&&(s=r[o].time)),null!==i&&null!==s&&(a.push([i,s]),i=null,s=null);return Ma(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=jl){ic({type:"mediaSource",sourceUpdater:this,action:Zl(e),name:"duration",doneFn:t})}endOfStream(e=null,t=jl){"string"!=typeof e&&(e=void 0),ic({type:"mediaSource",sourceUpdater:this,action:Ql(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=jl){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?ic({type:"audio",sourceUpdater:this,action:Xl(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=jl){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?ic({type:"video",sourceUpdater:this,action:Xl(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Hl("audio",this)&&!Hl("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(ic({type:"audio",sourceUpdater:this,action:Kl(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(ic({type:"video",sourceUpdater:this,action:Kl(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&ic({type:"audio",sourceUpdater:this,action:Yl(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&ic({type:"video",sourceUpdater:this,action:Yl(e),name:"callback"})}dispose(){this.trigger("dispose"),$l.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Vl(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const rc=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),ac=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class oc extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class lc extends Fl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ma();const e=this.subtitlesTrack_.cues;return Ma([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Bo(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const t=ac.byteLength+e.bytes.byteLength,n=new Uint8Array(t);n.set(e.bytes),n.set(ac,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:n}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){Pl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===ll&&this.handleTimeout_(),e.code===cl?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const s=this.pendingSegment_,r=i.mp4VttCues&&i.mp4VttCues.length;r&&(s.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=s.segment;if(a.map&&(a.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!=typeof n().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));a.requested=!0;try{this.parseVTTCues_(s)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:wa.Error.StreamingVttParserError,error:e}})}if(r||this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,s.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(n().VTTCue)(e.startTime,e.endTime,e.text):e)}),function(e){const t=e.cues;if(!t)return;const i={};for(let s=t.length-1;s>=0;s--){const n=t[s],r=`${n.startTime}-${n.endTime}-${n.text}`;i[r]?e.removeCue(n):i[r]=n}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&"vtt"===e.type,s=t&&"text"===t.type;i&&s&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const s=i.start+t,r=i.end+t,a=new(n().VTTCue)(s,r,i.cueText);i.settings&&i.settings.split(" ").forEach(e=>{const t=e.split(":"),i=t[0],s=t[1];a[i]=isNaN(s)?s:Number(s)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if("function"!=typeof n().WebVTT)throw new oc;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof n().TextDecoder?t=new(n().TextDecoder)("utf8"):(t=n().WebVTT.StringDecoder(),i=!0);const s=new(n().WebVTT.Parser)(n(),n().vttjs,t);if(s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=t=>{e.timestampmap=t},s.onparsingerror=e=>{wa.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=rc(t)),s.parse(t)}let r=e.bytes;i&&(r=rc(r)),s.parse(r),s.flush()}updateTimeMapping_(e,t,i){const s=e.segment;if(!t)return;if(!e.cues.length)return void(s.empty=!0);const{MPEGTS:n,LOCAL:r}=e.timestampmap,a=n/lt.ONE_SECOND_IN_TS-r+t.mapping;if(e.cues.forEach(e=>{const i=e.endTime-e.startTime,s=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(s,0),e.endTime=Math.max(s+i,0)}),!i.syncInfo){const t=e.cues[0].startTime,n=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,n-s.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*lt.ONE_SECOND_IN_TS;const s=t*lt.ONE_SECOND_IN_TS;let n;for(n=s<i?-8589934592:8589934592;Math.abs(i-s)>4294967296;)i+=n;return i/lt.ONE_SECOND_IN_TS}}const cc=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const s=i[e];if(t>=s.adStartTime&&t<=s.adEndTime)return s}return null};class uc{constructor({start:e,end:t,segmentIndex:i,partIndex:s=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=s,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class dc{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class hc{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:s}=e;if(this.isReliable_=this.isReliablePlaylist_(i,s),this.isReliable_)return this.updateStorage_(s,i,this.calculateBaseTime_(i,s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const s=new Map;let n="\n",r=i,a=t;this.start_=r,e.forEach((e,t)=>{const i=this.storage_.get(a),o=r,l=o+e.duration,c=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),u=new uc({start:o,end:l,appended:c,segmentIndex:t});e.syncInfo=u;let d=r;const h=(e.parts||[]).map((e,s)=>{const r=d,o=d+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[s]&&i.partsSyncInfo[s].isAppended),c=new uc({start:r,end:o,appended:l,segmentIndex:t,partIndex:s});return d=o,n+=`Media Sequence: ${a}.${s} | Range: ${r} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=c,c});s.set(a,new dc(u,h)),n+=`${El(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${c}\n`,a++,r=l}),this.end_=r,this.storage_=s,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const s=Math.min(...this.storage_.keys());if(e<s){const i=s-e;let n=this.storage_.get(s).segmentSyncInfo.start;for(let e=0;e<i;e++)n-=t[e].duration;return n}return i}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class pc extends hc{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const mc=[{name:"VOD",run:(e,t,i,s,n)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,s,n,r)=>{const a=e.getMediaSequenceSync(r);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(n);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,s,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=za(t);n=n||0;for(let i=0;i<o.length;i++){const s=o[t.endList||0===n?i:o.length-(i+1)],l=s.segment,c=e.timelineToDatetimeMappings[l.timeline];if(!c||!l.dateTimeObject)continue;let u=l.dateTimeObject.getTime()/1e3+c;if(l.parts&&"number"==typeof s.partIndex)for(let e=0;e<s.partIndex;e++)u+=l.parts[e].duration;const d=Math.abs(n-u);if(null!==a&&(0===d||a<d))break;a=d,r={time:u,segmentIndex:s.segmentIndex,partIndex:s.partIndex}}return r}},{name:"Segment",run:(e,t,i,s,n)=>{let r=null,a=null;n=n||0;const o=za(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===n?e:o.length-(e+1)],l=i.segment,c=i.part&&i.part.start||l&&l.start;if(l.timeline===s&&void 0!==c){const e=Math.abs(n-c);if(null!==a&&a<e)break;(!r||null===a||a>=e)&&(a=e,r={time:c,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return r}},{name:"Discontinuity",run:(e,t,i,s,n)=>{let r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let s=0;s<t.discontinuityStarts.length;s++){const a=t.discontinuityStarts[s],o=t.discontinuitySequence+s+1,l=e.discontinuities[o];if(l){const e=Math.abs(n-l.time);if(null!==i&&i<e)break;(!r||null===i||i>=e)&&(i=e,r={time:l.time,segmentIndex:a,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,i,s,n)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class gc extends wa.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new hc,i=new pc(t),s=new pc(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:s},this.logger_=Da("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,s,n){if(t!==1/0)return mc.find(({name:e})=>"VOD"===e).run(this,e,t);const r=this.runStrategies_(e,t,i,s,n);if(!r.length)return null;for(const t of r){const{syncPoint:i,strategy:n}
vendor: 5,112 bytes, line 2
2=t,{segmentIndex:r,time:a}=i;if(r<0)continue;const o=a,l=o+e.segments[r].duration;if(this.logger_(`Strategy: ${n}. Current time: ${s}. selected segment: ${r}. Time: [${o} -> ${l}]}`),s>=o&&s<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(r,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Ya({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s,n){const r=[];for(let a=0;a<mc.length;a++){const o=mc[a],l=o.run(this,e,t,i,s,n);l&&(l.strategy=o.name,r.push({strategy:o.name,syncPoint:l}))}return r}selectSyncPoint_(e,t){let i=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);a<s&&(s=a,i=e[r].syncPoint,n=e[r].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)wa.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let s=i-1;s>=0;s--){const i=e.segments[s];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+s,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment,n=e.part;let r,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,a=t.end+o.mapping}return n&&(n.start=r,n.end=a),(!s.start||r<s.start)&&(s.start=r),s.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s],r=t.discontinuitySequence+s+1,a=n-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let s;s=a<0?i.start-Ya({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+Ya({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[r]={time:s,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class fc extends wa.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if("number"==typeof t&&"number"==typeof i){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const s={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const yc=Jo(el(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);
vendor: 12,817 bytes, line 2
2else for(var n=Array.prototype.slice.call(arguments,1),r=t.length,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)})},e}();let t=null;class i{constructor(e){let i,s,n;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],s=t[4],n=i[4];let r,a,o;const l=[],c=[];let u,d,h,p,m,g;for(r=0;r<256;r++)c[(l[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!s[a];a^=u||1,o=c[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,s[a]=p,n[p]=a,h=l[d=l[u=l[a]]],g=16843009*h^65537*d^257*u^16843008*a,m=257*l[p]^16843008*p,r=0;r<4;r++)t[r][a]=m=m<<24^m>>>8,i[r][p]=g=g<<24^g>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const r=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const c=e.slice(0),u=[];for(this._key=[c,u],i=o;i<4*o+28;i++)n=c[i-1],(i%o===0||8===o&&i%o===4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],i%o===0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[i]=c[i-o]^n;for(s=0;i;s++,i--)n=c[3&s?i:i-4],u[s]=i<=4||s<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}decrypt(e,t,i,s,n,r){const a=this._key[1];let o,l,c,u=e^a[0],d=s^a[1],h=i^a[2],p=t^a[3];const m=a.length/4-2;let g,f=4;const y=this._tables[1],_=y[0],v=y[1],b=y[2],T=y[3],S=y[4];for(g=0;g<m;g++)o=_[u>>>24]^v[d>>16&255]^b[h>>8&255]^T[255&p]^a[f],l=_[d>>>24]^v[h>>16&255]^b[p>>8&255]^T[255&u]^a[f+1],c=_[h>>>24]^v[p>>16&255]^b[u>>8&255]^T[255&d]^a[f+2],p=_[p>>>24]^v[u>>16&255]^b[d>>8&255]^T[255&h]^a[f+3],f+=4,u=o,d=l,h=c;for(g=0;g<4;g++)n[(3&-g)+r]=S[u>>>24]<<24^S[d>>16&255]<<16^S[h>>8&255]<<8^S[255&p]^a[f++],o=u,u=d,d=h,h=p,p=o}}class s extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const n=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class r{constructor(e,t,i,a){const o=r.STEP,l=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength);let u=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c)),u=o;u<l.length;u+=o)i=new Uint32Array([n(l[u-4]),n(l[u-3]),n(l[u-2]),n(l[u-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c));this.asyncStream_.push(function(){var e;a(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,s,r){return function(){const a=function(e,t,s){const r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new i(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let c,u,d,h,p,m,g,f,y;for(c=s[0],u=s[1],d=s[2],h=s[3],y=0;y<r.length;y+=4)p=n(r[y]),m=n(r[y+1]),g=n(r[y+2]),f=n(r[y+3]),a.decrypt(p,m,g,f,l,y),l[y]=n(l[y]^c),l[y+1]=n(l[y+1]^u),l[y+2]=n(l[y+2]^d),l[y+3]=n(l[y+3]^h),c=p,u=m,d=g,h=f;return o}(e,t,s);r.set(a,e.byteOffset)}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},o=("undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{}).BigInt||Number;o("0x1"),o("0x100"),o("0x10000"),o("0x1000000"),o("0x100000000"),o("0x10000000000"),o("0x1000000000000"),o("0x100000000000000"),o("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),s=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new r(i,s,n,function(e,i){self.postMessage(function(e){const t={};return Object.keys(e).forEach(i=>{const s=e[i];var n;n=s,("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s}),t}({source:t.source,decrypted:i}),[i.buffer])})}}));var _c=Zo(yc);const vc=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},bc=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Tc=(e,t)=>{t.activePlaylistLoader=e,e.load()},Sc={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:s}=t,n=i.activeTrack(),r=i.activeGroup(),a=(r.filter(e=>e.default)[0]||r[0]).id,o=i.tracks[a];if(n!==o){wa.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else s({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;wa.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=i.activeTrack();s&&(s.mode="disabled"),i.onTrackChanged()}},Cc={AUDIO:(e,t,i)=>{if(!t)return;const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),n),s.paused()||r.load()}),t.on("error",Sc[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n),r.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),n),s.paused()||r.load()}),t.on("error",Sc[e](e,i))}},wc={AUDIO:(e,t)=>{const{vhs:i,sourceType:s,segmentLoaders:{[e]:n},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:c}},mainPlaylistLoader:u}=t,d=ro(u.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},d&&(a[e].main.default.playlists=u.main.playlists));for(const n in a[e]){o[n]||(o[n]=[]);for(const h in a[e][n]){let p,m=a[e][n][h];if(d?(c(`AUDIO group '${n}' label '${h}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===s&&m.playlists?new Po(m.playlists[0],i,r):m.resolvedUri?new Po(m.resolvedUri,i,r):m.playlists&&"dash"===s?new Ko(m.playlists[0],i,r,u):null,m=La({id:h,playlistLoader:p},m),Cc[e](e,m.playlistLoader,t),o[n].push(m),void 0===l[h]){const e=new wa.AudioTrack({id:h,kind:vc(m),enabled:!1,language:m.language,default:m.default,label:h});l[h]=e}}}n.on("error",Sc[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:c}},mainPlaylistLoader:u}=t;for(const r in o[e]){l[r]||(l[r]=[]);for(const d in o[e][r]){if(!s.options_.useForcedSubtitles&&o[e][r][d].forced)continue;let h,p=o[e][r][d];if("hls"===n)h=new Po(p.resolvedUri,s,a);else if("dash"===n){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;h=new Ko(p.playlists[0],s,a,u)}else"vhs-json"===n&&(h=new Po(p.playlists?p.playlists[0]:p.resolvedUri,s,a));if(p=La({id:d,playlistLoader:h},p),Cc[e](e,p.playlistLoader,t),l[r].push(p),void 0===c[d]){const e=i.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track;c[d]=e}}}r.on("error",Sc[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:n,tracks:r}}}=t;for(const t in s[e]){n[t]||(n[t]=[]);for(const a in s[e][t]){const o=s[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[c.instreamId]&&(c=La(c,l[c.instreamId])),void 0===c.default&&delete c.default,n[t].push(La({id:a},o)),void 0===r[a]){const e=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;r[a]=e}}}}},kc=(e,t)=>{for(let i=0;i<e.length;i++){if(so(t,e[i]))return!0;if(e[i].playlists&&kc(e[i].playlists,t))return!0}return!1},Ec={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class xc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Aa(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class Ic extends wa.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new xc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Da("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=Aa(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const s={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:s}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let n;this.trigger({type:"contentsteeringloadcomplete",metadata:s});try{n=JSON.parse(this.request_.responseText)}catch(e){const t={errorType:wa.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(n);const r={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:r}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new(n().URL)(e),i=new(n().URL)(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(n().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(n().URL)(e),i=this.getPathway(),s=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(s){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,s)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for c
2ontent steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=n().setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){n().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new xc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Aa(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let Ac;const Pc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Dc=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class Lc extends wa.EventTarget{constructor(e){super(),this.fastQualityChange_=(e=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{e.apply(null,i)},100)}})(this.fastQualityChange_.bind(this));const{src:t,withCredentials:i,tech:s,bandwidth:r,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:c,sourceType:u,cacheEncryptionKeys:d,bufferBasedABR:h,leastPixelDiffSelector:p,captionServices:m,experimentalUseMMS:g}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:f}=e;null==f&&(f=1/0),Ac=a,this.bufferBasedABR=Boolean(h),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.player_=e.player_,this.sourceType_=u,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=f,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:f,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:jl,activeTrack:jl,getActiveGroup:jl,onGroupChanged:jl,onTrackChanged:jl,lastTrack_:null,logger_:Da(`MediaGroups[${t}]`)}}),e})(),g&&n().ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new(n().ManagedMediaSource),this.usingManagedMediaSource_=!0,wa.log("Using ManagedMediaSource")):n().MediaSource&&(this.mediaSource=new(n().MediaSource)),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Ma(),this.hasPlayed_=!1,this.syncController_=new gc(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new _c,this.sourceUpdater_=new nc(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new fc,this.keyStatusMap_=new Map;const y={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:m,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Ko(t,this.vhs_,La(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Po(t,this.vhs_,La(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Fl(La(y,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Fl(La(y,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new lc(La(y,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>
vendor: 11,985 bytes, line 2
2{function i(){s.off("vttjserror",n),e()}function n(){s.off("vttjsloaded",i),t()}s.one("vttjsloaded",i),s.one("vttjserror",n),s.addWebVttScript_()})}),e),this.contentSteeringController_=new Ic(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Pc.forEach(e=>{this[e+"_"]=Dc.bind(this,e)}),this.logger_=Da("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const _="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(_,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const s=this.media(),n=s&&(s.id||s.uri),r=e&&(e.id||e.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${t}`);const i={renditionInfo:{id:r,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,s=this.contentSteeringController_.getPathway();if(i&&s){const t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===s);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=n().setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(n().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||s.length&&i[s[0]];for(const t in e)if(e[t].default){n={label:t};break}}if(!n)return t;const r=[];for(const t in i)if(i[t][n.label]){const s=i[t][n.label];if(s.playlists&&s.playlists.length)r.push.apply(r,s.playlists);else if(s.uri)r.push(s);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const s=e.playlists[i];s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===t&&r.push(s)}}return r.length?r:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;io(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{wc[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[e]:{groups:n}}}=t,r=s.media();if(!r)return null;let a=null;r.attributes[e]&&(a=n[r.attributes[e]]);const o=Object.keys(n);if(!a)if("AUDIO"===e&&o.length>1&&ro(t.main))for(let e=0;e<o.length;e++){const t=n[o[e]];if(kc(t,r)){a=t;break}}else n.main?a=n.main:1===o.length&&(a=n[o[0]]);return void 0===i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null})(i,e),t[i].activeTrack=Ec[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:s},mediaTypes:{[e]:n}}=t,r=n.activeTrack(),a=n.getActiveGroup(),o=n.activePlaylistLoader,l=n.lastGroup_;a&&l&&a.id===l.id||(n.lastGroup_=a,n.lastTrack_=r,bc(i,n),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),Tc(a.playlistLoader,n)):o&&s.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;s.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:s,main:n},mediaTypes:{[e]:r}}=t,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,c=r.lastTrack_;if((!c||!a||c.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,bc(s,r),o)){if(o.isMainPlaylist){if(!a||!c||a.id===c.id)return;const e=t.vhs.playlistController_,s=e.selectPlaylist();if(e.media()===s)return;return r.logger_(`track change. Switching main audio from ${c.id} to ${a.id}`),i.pause(),n.resetEverything(),void e.fastQualityChange_(s)}if("AUDIO"===e){if(!o.playlistLoader)return n.setAudio(!0),void n.resetEverything();s.setAudio(!0),n.setAudio(!1)}l!==o.playlistLoader?(s.track&&s.track(a),s.resetEverything(),Tc(o.playlistLoader,r)):Tc(o.playlistLoader,r)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const e in t.AUDIO.tracks)s.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;io(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(d({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=!0;const n=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e])i.AUDIO[e][t].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ac.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!s)return wa.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e)return l(`${c} as current playlist is not set`),!0;if(s.id===e.id)return!1;const u=Boolean(Ua(t,i).length);if(!e.endList)return u||"number"!=typeof e.partTargetDuration?(l(`${c} as current playlist is live`),!0):(l(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const d=$a(t,i),h=o?Yo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Yo.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${c} as duration < max low water line (${a} < ${h})`),!0;const p=s.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!o||d<r)){let e=`${c} as next bandwidth < current bandwidth (${p} < ${m})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${r})`),l(e),!0}if((!o||p>m)&&d>=n){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${d} >= ${n})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${c} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n
vendor: 2,813 bytes, line 2
2,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;const t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})
vendor: 11,488 bytes, line 2
2,["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(d({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(d({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(d({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let s=i;if(e.start){const n=e.start.timeOffset;if(n<0){const r=this.mainPlaylistLoader_.main,a=i+Ac.Playlist.liveEdgeDelay(r,e);s=Math.max(Math.min(a+n,i),t.start(0))}else s=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=Ac.Playlist.playlistEnd(e,t),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-s<=Oa;const r=n.end(n.length-1);return r-s<=Oa&&i-r<=Oa}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,n=s.filter(eo),r=1===n.length&&n[0]===e;if(1===s.length&&i!==1/0)return wa.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i)}let t=!1;s.forEach(i=>{if(i===e)return;const s=i.excludeUntil;void 0!==s&&s!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(wa.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:wa.log.warn,c=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5e3,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],s="all"===e;(s||"main"===e)&&i.push(this.mainPlaylistLoader_);const n=[];(s||"audio"===e)&&n.push("AUDIO"),(s||"subtitle"===e)&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{const s=this[`${t}SegmentLoader_`];!s||e!==t&&"all"!==e||i.push(s)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){const t=Ua(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Ac.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const s=this.syncController_.getMediaSequenceSync(t);if(s&&s.isReliable){const e=s.start,t=s.end;if(!isFinite(e)||!isFinite(t))return null;const n=Ac.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i);return Ma([[e,Math.max(e,t-n)]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(null===n)return null;const r=Ac.Playlist.seekable(i,n,Ac.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return r.length?r:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),s=e.end(0),n=t.start(0),r=t.end(0);return n>s||i>r?e:Ma([[Math.max(i,n),Math.min(s,r)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_)return;if(i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${Fa(this.seekable_)}]`);const s={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:s}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=Ac.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=To(this.main(),t),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(s.video+=`,${i.audio||e.main.audioCodec||O}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(s.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||O,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const r=(e,t)=>e?M(t,this.usingManagedMediaSource_):N(t),a={};let o;if(["video","audio"].forEach(function(t){if(s.hasOwnProperty(t)&&!r(e[t].isFmp4,s[t])){const i=e[t].isFmp4?"browser":"muxer";a[i]=a[i]||[],a[i].push(s[t]),"audio"===t&&(o=i)}}),n&&o&&t.attributes.AUDIO){const e=t.attributes.AUDIO;
vendor: 36,460 bytes, line 2
2this.main().playlists.forEach(i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${o} does not support codec(s): "${s.audio}"`)}if(Object.keys(a).length){const e=Object.keys(a).reduce((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${a[t].join(",")}"`),"")+".";return void this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const i=(P(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,n=(P(s[t]||"")[0]||{}).type;i&&n&&i.toLowerCase()!==n.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${s[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return s}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const s=e[i];if(-1!==t.indexOf(s.id))return;t.push(s.id);const n=To(this.main,s),r=[];!n.audio||N(n.audio)||M(n.audio,this.usingManagedMediaSource_)||r.push(`audio codec ${n.audio}`),!n.video||N(n.video)||M(n.video,this.usingManagedMediaSource_)||r.push(`video codec ${n.video}`),n.text&&"stpp.ttml.im1t"===n.text&&r.push(`text codec ${n.text}`),r.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,s=vo(P(e)),n=bo(s),r=s.video&&P(s.video)[0]||null,a=s.audio&&P(s.audio)[0]||null;Object.keys(i).forEach(e=>{const s=i[e];if(-1!==t.indexOf(s.id)||s.excludeUntil===1/0)return;t.push(s.id);const o=[],l=To(this.mainPlaylistLoader_.main,s),c=bo(l);if(l.audio||l.video){if(c!==n&&o.push(`codec count "${c}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&P(l.video)[0]||null,t=l.audio&&P(l.audio)[0]||null;e&&r&&e.type.toLowerCase()!==r.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${r.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let s,r=i;for(let i=0;i<e.segments.length;i++){const a=e.segments[i];if(s||(s=cc(t,r+a.duration/2)),s){if("cueIn"in a){s.endTime=r,s.adEndTime=r,r+=a.duration,s=null;continue}if(r<s.endTime){r+=a.duration;continue}s.endTime+=a.duration}else if("cueOut"in a&&(s=new(n().VTTCue)(r,r+a.duration,a.cueOut),s.adStartTime=r,s.adEndTime=r+parseFloat(a.cueOut),t.addCue(s)),"cueOutCont"in a){const[e,i]=a.cueOutCont.split("/").map(parseFloat);s=new(n().VTTCue)(r,r+a.duration,""),s.adStartTime=r-e,s.adEndTime=s.adStartTime+i,t.addCue(s)}r+=a.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Yo.GOAL_BUFFER_LENGTH,i=Yo.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Yo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Yo.BUFFER_LOW_WATER_LINE,i=Yo.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Yo.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Yo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Yo.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Al(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const s=n().WebKitDataCue||n().VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(Il.has(t))continue;const n=new s(e.startTime,e.endTime,"");n.id=e.id,n.type="com.apple.quicktime.HLS",n.value={key:xl[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(n)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Al(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:s})=>{if(!t)return;const r=n().WebKitDataCue||n().VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach(e=>{const t=e.cueTime+i;!("number"!=typeof t||n().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{const i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(wa.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(wa.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(wa.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),a.addCue(i)})}),!a.cues||!a.cues.length)return;const o=a.cues,l=[];for(let e=0;e<o.length;e++)o[e]&&l.push(o[e]);const c=l.reduce((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),u=Object.keys(c).sort((e,t)=>Number(e)-Number(t));u.forEach((e,t)=>{const i=c[e],n=isFinite(s)?s:e,r=Number(u[t+1])||n;i.forEach(e=>{e.endTime=r})})})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(d({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const s of e.playlists){const e=s.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let s=!1;Object.keys(t).forEach(n=>{const r=t[n],a=this.pathwayAttribute_(r),o=a&&e!==a;r.excludeUntil===1/0&&"content-steering"===r.lastExcludeReason_&&!o&&(delete r.excludeUntil,delete r.lastExcludeReason_,s=!0);const l=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&o&&l&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,s]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(s),this.contentSteeringController_.excludePathway(e));for(const[s,n]of i.entries()){const i=t.get(s);i?this.equalPathwayClones_(i,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(s)):(e.filter(e=>e.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(n,e)}),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,s=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==s[e])return!1;for(const e in s)if(i[e]!==s[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);s&&s.size&&s.forEach(s=>{const n="usable",r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;r?r&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${n}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,s=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&s&&(delete e.excludeUntil,wa.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class Mc{constructor(e,t,i){const{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var r,a,o;this.codecs=To(s.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=n,e=>{const t=r.main.playlists[a],i=Ja(t),s=eo(t);if(void 0===e)return s;e?delete t.disabled:t.disabled=!0;const n={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===s||i||(e?(o(t),r.trigger({type:"renditionenabled",metadata:n})):r.trigger({type:"renditiondisabled",metadata:n})),e})}}const Nc=["seeking","seeked","pause","playing","error"];class Oc extends wa.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Da("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)});const c=e=>{["main","audio"].forEach(t=>{a[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(Nc,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(Nc,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(e=>{a[`${e}SegmentLoader_`].off("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)}),this.checkCurrentTimeTimeout_&&n().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&n().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=n().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],s=i.buffered_(),n=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,n){const i={bufferedRanges:s};return t.trigger({type:"bufferedrangeschanged",metadata:i}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:ja(s)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Oa>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Ma([this.lastRecordedTime,e]));const t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:Oa)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Fa(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const s=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),r=s.audioBuffer?s.audioBuffered():null,a=s.videoBuffer?s.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Na),c=[r,a];for(let e=0;e<c.length;e++)if(c[e]&&$a(c[e],t)<l)return!1;const u=Ba(n,t);return 0!==u.length&&(i=u.start(0)+Oa,this.logger_(`Buffered region starts (${u.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ua(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Ba(s,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Oa;const r=!i.endList,a="number"==typeof i.partTargetDuration;return r&&(a||s)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let s;if(e.length&&t.length){const n=Ua(e,i-3),r=Ua(e,i),a=Ua(t,i);a.length&&!r.length&&n.length&&(s={start:n.end(0),end:a.end(0)})}else Ba(e,i).length||(s=this.gapFromVideoUnderflow_(e,i));return!!s&&(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),s=Ba(t,i);if(this.resetTimeUpdate_(),0===s.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Na);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return Ma();const t=[];for(let i=1;i<e.length;i++){const s=e.end(i-1),n=e.start(i);t.push([s,n])}return Ma(t)}(e);for(let e=0;e<i.length;e++){const s=i.start(e),n=i.end(e);if(t-s<4&&t-s>2)return{start:s,end:n}}return null}}const Rc={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Uc=function(e,t){let i=0,s=0;const n=La(Rc,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){s&&e.currentTime(s)},a=function(t){null!=t&&(s=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",r),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*n.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(n.getSource&&"function"==typeof n.getSource)return i=Date.now(),n.getSource.call(e,a);wa.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",r),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),Uc(e,t)}};var Bc="3.17.4";const Fc={PlaylistLoader:Po,Playlist:ao,utils:qo,STANDARD_PLAYLIST_SELECTOR:kl,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(ao.isEnabled);return Sl(e,(e,t)=>Cl(e,t)),e.filter(e=>!!To(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:kl,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&n().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),wl({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(Tl(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(Tl(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?Tl(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:Cl,comparePlaylistResolution:function(e,t){let i,s;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||n().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(s=t.attributes.RESOLUTION.width),s=s||n().Number.MAX_VALUE,i===s&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-s},xhr:Lo()};Object.keys(Yo).forEach(e=>{Object.defineProperty(Fc,e,{get:()=>(wa.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Yo[e]),set(t){wa.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?wa.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Yo[e]=t}})});const jc="videojs-vhs",qc=function(e,t){const i=t.media();let s=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){s=t;break}e.selectedIndex_=s,e.trigger({selectedIndex:s,type:"change"})};Fc.canPlaySource=function(){return wa.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const $c=()=>{if(!n().localStorage)return null;const e=n().localStorage.getItem(jc);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Hc=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},zc=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Vc=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Wc=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Fc.supportsNativeHls=function(){if(!a()||!a().createElement)return!1;const e=a().createElement("video");return!!wa.getTech("Html5").isSupported()&&["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))})}(),Fc.supportsNativeDash=!!(a()&&a().createElement&&wa.getTech("Html5").isSupported())&&/maybe|probably/i.test(a().createElement("video").canPlayType("application/dash+xml")),Fc.supportsTypeNatively=e=>"hls"===e?Fc.supportsNativeHls:"dash"===e&&Fc.supportsNativeDash,Fc.isSupported=function(){return wa.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Fc.xhr.onRequest=function(e){Hc(Fc.xhr,e)},Fc.xhr.onResponse=function(e){zc(Fc.xhr,e)},Fc.xhr.offRequest=function(e){Vc(Fc.xhr,e)},Fc.xhr.offResponse=function(e){Wc(Fc.xhr,e)};const Gc=wa.getComponent("Component");class Xc extends Gc{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Da("VhsHandler"),t.options_&&t.options_.playerId){const e=wa.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=a().fullscreenElement||a().webkitFullscreenElement||a().mozFullScreenElement||a().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=La(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=$c();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Yo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Yo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=Fc,this.options_.sourceType=B(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Lc(this.options_);const s=La({liveRangeSafeTimeDelta:Oa},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Oc(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const e=wa.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const r=this.options_.bufferBasedABR?Fc.movingAverageBandwidthSelector(.55):Fc.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Fc.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=n().navigator.connection||n().navigator.mozConnection||n().navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const s=1e3*t.downlink*1e3;e=s>=i&&e>=i?Math.max(e,s):s}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){wa.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>ja(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>ja(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!n().localStorage)return!1;let t=$c();t=t?La(t,e):e;try{n().localStorage.setItem(jc,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=ro(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!Ja(e)).map((t,i)=>new Mc(e,t,t.id)):[]}}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=n().URL.createObjectURL(this.playlistController_.mediaSource),(wa.browser.IS_ANY_SAFARI||wa.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const n=(o=i?s.concat([i]):s,l=Object.keys(t),o.reduce((e,t)=>{if(!t.contentProtection)return e;const i=l.reduce((e,i)=>{const s=t.contentProtection[i];return s&&s.pssh&&(e[i]={pssh:s.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])),r=[],a=[];var o,l;return n.forEach(t=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),r.push(new Promise((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?s(e):i()})}))}),Promise.race([Promise.all(r),Promise.race(a)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=((e,t,i)=>{if(!e)return e;let s={};t&&t.attributes&&t.attributes.CODECS&&(s=vo(P(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);const n=L(s.video),r=L(s.audio),a={};for(const i in e)a[i]={},r&&(a[i].audioContentType=r),n&&(a[i].videoContentType=n),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return La(e,a)})(t,i,s);return!(!n||(e.currentSource().keySystems=n,n&&!e.eme&&(wa.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=wa.players[this.tech_.options_.playerId];
2e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{!function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),qc(e,t.playlists)}(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{qc(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Bc,"mux.js":"7.1.0","mpd-parser":"1.3.1","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return nc.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&n().URL.revokeObjectURL&&(n().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const s=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,s=0;for(let n=0;n<t.segments.length&&(i=t.segments[n],s=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:s+i.duration,!(e<=s));n++);const n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>s){if(e>s+.25*n.duration)return null;i=n}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:s-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!s)return i({message:"valid programTime was not found"});if("estimate"===s.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const n={mediaSeconds:t},r=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,s=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*s)})(t,s.segment);return r&&(n.programDateTime=r.toISOString()),i(null,n)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,s=2){return $o({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Hc(this.xhr,e)},this.xhr.onResponse=e=>{zc(this.xhr,e)},this.xhr.offRequest=e=>{Vc(this.xhr,e)},this.xhr.offResponse=e=>{Wc(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(d({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(d({},e))})})}}const Kc={name:"videojs-http-streaming",VERSION:Bc,canHandleSource(e,t={}){const i=La(wa.options,t);return!(!i.vhs.experimentalUseMMS&&!M("avc1.4d400d,mp4a.40.2",!1))&&Kc.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=La(wa.options,i);return t.vhs=new Xc(e,t,s),t.vhs.xhr=Lo(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=B(e);if(!i)return"";const s=Kc.getOverrideNative(t);return!Fc.supportsTypeNatively(i)||s?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(wa.browser.IS_ANY_SAFARI||wa.browser.IS_IOS),{overrideNative:s=i}=t;return s}};M("avc1.4d400d,mp4a.40.2",!0)&&wa.getTech("Html5").registerSourceHandler(Kc,0),wa.VhsHandler=Xc,wa.VhsSourceHandler=Kc,wa.Vhs=Fc,wa.use||wa.registerComponent("Vhs",Fc),wa.options.vhs=wa.options.vhs||{},wa.getPlugin&&wa.getPlugin("reloadSourceOnError")||wa.registerPlugin("reloadSourceOnError",function(e){Uc(this,e)})},48(e,t,i){e.exports=function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e);const s=i.default.getComponent("Component"),n=i.default.dom||i.default;s.registerComponent("TouchOverlay",class extends s{constructor(e,t){super(e,t),this.seekSeconds=t.seekSeconds,this.tapTimeout=t.tapTimeout,this.taps=0,this.addChild("playToggle",{}),e.on(["playing","userinactive"],e=>{this.removeClass("show-play-toggle")}),0===this.player_.options_.inactivityTimeout&&(this.player_.options_.inactivityTimeout=5e3),this.handleTaps_=i.default.fn.debounce(e=>{const t=(this.taps-1)*this.seekSeconds;if(this.taps=0,t<1)return;const i=this.el_.getBoundingClientRect(),s=e.changedTouches[0].clientX-i.left;if(s<.4*i.width)this.player_.currentTime(Math.max(0,this.player_.currentTime()-t)),this.addClass("reverse");else{if(!(s>i.width-.4*i.width))return;this.player_.currentTime(Math.min(this.player_.duration(),this.player_.currentTime()+t)),this.removeClass("reverse")}this.removeClass("show-play-toggle"),this.setAttribute("data-skip-text",`${t} ${this.localize("seconds")}`),this.removeClass("skip"),window.requestAnimationFrame(()=>{this.addClass("skip")})},this.tapTimeout),this.enable()}createEl(){return n.createEl("div",{className:"vjs-touch-overlay",tabIndex:-1})}handleTap(e){e.target===this.el_&&(e.cancelable&&e.preventDefault(),this.taps+=1,1===this.taps&&(this.removeClass("skip"),this.toggleClass("show-play-toggle")),this.handleTaps_(e))}enable(){this.firstTapCaptured=!1,this.on("touchend",this.handleTap)}disable(){this.off("touchend",this.handleTap)}});const r={fullscreen:{enterOnRotate:!0,exitOnRotate:!0,lockOnRotate:!0,lockToLandscapeOnEnter:!1,swipeToFullscreen:!1,swipeFromFullscreen:!1,disabled:!1}
vendor: 4,054 bytes, line 2
2,touchControls:{seekSeconds:10,tapTimeout:300,disableOnEnd:!1,disabled:!1}},a=window.screen,o=()=>{if(a){const e=((a.orientation||{}).type||a.mozOrientation||a.msOrientation||"").split("-")[0];if("landscape"===e||"portrait"===e)return e}return"number"==typeof window.orientation?0===window.orientation||180===window.orientation?"portrait":"landscape":"portrait"},l=(e,t)=>{if(e.addClass("vjs-mobile-ui"),!t.touchControls.disabled){(t.touchControls.disableOnEnd||"function"==typeof e.endscreen)&&e.addClass("vjs-mobile-ui-disable-end");const i=e.children_.indexOf(e.getChild("ControlBar"));e.touchOverlay=e.addChild("TouchOverlay",t.touchControls,i)}if(t.fullscreen.disabled)return;(t.fullscreen.swipeToFullscreen||t.fullscreen.swipeFromFullscreen)&&((e,t)=>{const{swipeToFullscreen:i,swipeFromFullscreen:s}=t.fullscreen;i&&e.addClass("using-fs-swipe-up"),s&&e.addClass("using-fs-swipe-down");let n=0,r=!1;const a=t=>{const a=e.isFullscreen();!a&&!i||a&&!s?r=!1:(n=t.changedTouches[0].clientY,r=!0,e.tech_.el().style.transition="")},o=t=>{if(!r)return;const i=t.touches[0].clientY,s=n-i,a=e.isFullscreen();let o=1;!a&&s>0?(o=1+Math.min(.1,s/500),e.tech_.el().style.transform=`scale(${o})`):a&&s<0&&(o=1-Math.min(.1,Math.abs(s)/500),e.tech_.el().style.transform=`scale(${o})`)},l=t=>{if(!r)return;if(r=!1,e.tech_.el().style.transition="transform 0.3s ease-out",e.tech_.el().style.transform="scale(1)","touchcancel"===t.type)return;const i=t.changedTouches[0].clientY,s=n-i;s>30&&!e.isFullscreen()?e.requestFullscreen().catch(t=>{e.log.warn("Browser refused fullscreen",t)}):s<-30&&e.isFullscreen()&&e.exitFullscreen()};e.el().addEventListener("touchstart",a,{passive:!0}),e.el().addEventListener("touchmove",o,{passive:!0}),e.el().addEventListener("touchend",l,{passive:!0}),e.el().addEventListener("touchcancel",l,{passive:!0}),e.on("dispose",()=>{e.el().removeEventListener("touchstart",a,{passive:!0}),e.el().removeEventListener("touchmove",o,{passive:!0}),e.el().removeEventListener("touchend",l,{passive:!0}),e.el().removeEventListener("touchcancel",l,{passive:!0}),e.tech_.el().style.transform="",e.tech_.el().style.transition=""})})(e,t);let s=!1;const n=()=>{const n=o();"landscape"===n&&t.fullscreen.enterOnRotate?e.paused()||e.isFullscreen()||(e.requestFullscreen().catch(t=>{e.log.warn("Browser refused fullscreen request:",t)}),(t.fullscreen.lockOnRotate||t.fullscreen.lockToLandscapeOnEnter)&&a.orientation&&a.orientation.lock&&a.orientation.lock("landscape").then(()=>{s=!0}).catch(e=>{i.default.log.warn("Browser refused orientation lock:",e)})):"portrait"===n&&t.fullscreen.exitOnRotate&&!s&&e.isFullscreen()&&e.exitFullscreen()};(t.fullscreen.enterOnRotate||t.fullscreen.exitOnRotate)&&(i.default.browser.IS_IOS?(window.addEventListener("orientationchange",n),e.on("dispose",()=>{window.removeEventListener("orientationchange",n)})):a.orientation&&(a.orientation.onchange=n,e.on("dispose",()=>{a.orientation.onchange=null}))),e.on("fullscreenchange",n=>{e.log("fullscreenchange",e.isFullscreen(),t.fullscreen.lockToLandscapeOnEnter,o()),e.isFullscreen()&&t.fullscreen.lockToLandscapeOnEnter&&"portrait"===o()?a.orientation.lock("landscape").then(()=>{s=!0}).catch(e=>{i.default.log("Browser refused orientation lock:",e)}):!e.isFullscreen()&&s&&(a.orientation.unlock(),s=!1)}),e.on("ended",e=>{!0===s&&(a.orientation.unlock(),s=!1)})},c=function(e={}){(e.forceForTesting||i.default.browser.IS_ANDROID||i.default.browser.IS_IOS)&&this.ready(()=>{l(this,i.default.obj.merge(r,e))})};return i.default.registerPlugin("mobileUi",c),c.VERSION="1.2.6",c}(i(879))},784(e,t,i){var s=i(840),n=e.exports={WebVTT:i(311),VTTCue:i(184),VTTRegion:i(891)};s.vttjs=n,s.WebVTT=n.WebVTT;var r=n.VTTCue,a=n.VTTRegion,o=s.VTTCue,l=s.VTTRegion;n.shim=function(){s.VTTCue=r,s.VTTRegion=a},n.restore=function(){s.VTTCue=o,s.VTTRegion=l},s.VTTCue||n.shim()},311(e,t,i){var s=i(697),n=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}}();
vendor: 18,623 bytes, line 2
2function r(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,s){return 3600*(0|e)+60*(0|t)+(0|i)+(0|s)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=n(null)}function l(e,t,i,s){var n=s?e.split(s):[e];for(var r in n)if("string"==typeof n[r]){var a=n[r].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}function c(e,t,i){var s=e;function n(){var t=a(e);if(null===t)throw new r(r.Errors.BadTimeStamp,"Malformed timestamp: "+s);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=n(),c(),"--\x3e"!==e.substr(0,3))throw new r(r.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+s);e=e.substr(3),c(),t.endTime=n(),c(),function(e,t){var s=new o;l(e,function(e,t){switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){s.set(e,i[n].region);break}break;case"vertical":s.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];s.integer(e,a),s.percent(e,a)&&s.set("snapToLines",!1),s.alt(e,a,["auto"]),2===r.length&&s.alt("lineAlign",r[1],["start","center","end"]);break;case"position":r=t.split(","),s.percent(e,r[0]),2===r.length&&s.alt("positionAlign",r[1],["start","center","end"]);break;case"size":s.percent(e,t);break;case"align":s.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=s.get("region",null),t.vertical=s.get("vertical","");try{t.line=s.get("line","auto")}catch(e){}t.lineAlign=s.get("lineAlign","start"),t.snapToLines=s.get("snapToLines",!0),t.size=s.get("size",100);try{t.align=s.get("align","center")}catch(e){t.align=s.get("align","middle")}try{t.position=s.get("position","auto")}catch(e){t.position=s.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=s.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}r.prototype=n(Error.prototype),r.prototype.constructor=r,r.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var s=0;s<i.length;++s)if(t===i[s]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var u=s.createElement&&s.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},p={v:"title",lang:"lang"},m={rt:"ruby"};function g(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function s(e){return u.innerHTML=e,e=u.textContent,u.textContent="",e}function n(e,t){return!m[t.localName]||m[t.localName]===e.localName}function r(t,i){var s=d[t];if(!s)return null;var n=e.document.createElement(s),r=p[t];return r&&i&&(n[r]=i.trim()),n}for(var o,l=e.document.createElement("div"),c=l,g=[];null!==(o=i());)if("<"!==o[0])c.appendChild(e.document.createTextNode(s(o)));else{if("/"===o[1]){g.length&&g[g.length-1]===o.substr(2).replace(">","")&&(g.pop(),c=c.parentNode);continue}var f,y=a(o.substr(1,o.length-2));if(y){f=e.document.createProcessingInstruction("timestamp",y),c.appendChild(f);continue}var _=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!_)continue;if(!(f=r(_[1],_[3])))continue;if(!n(c,f))continue;if(_[2]){var v=_[2].split(".");v.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(h.hasOwnProperty(i)){var s=t?"background-color":"color",n=h[i];f.style[s]=n}}),f.className=v.join(" ")}g.push(_[1]),c.appendChild(f),c=f}return l}var f=[[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 y(e){for(var t=0;t<f.length;t++){var i=f[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function _(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function s(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function n(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var r=i.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):i}return"ruby"===t.tagName?n(e):t.childNodes?(s(e,t),n(e)):void 0}for(s(t,e);i=n(t);)for(var r=0;r<i.length;r++)if(y(i.charCodeAt(r)))return"rtl";return"ltr"}function v(){}function b(e,t,i){v.call(this),this.cue=t,this.cueDiv=g(e,t.text);var s={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(s,this.cueDiv),this.div=e.document.createElement("div"),s={direction:_(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":case"line-left":n=t.position;break;case"center":n=t.position-t.size/2;break;case"end":case"line-right":n=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")}):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")})}}function T(e){var t,i,s,n;if(e.div){i=e.div.offsetHeight,s=e.div.offsetWidth,n=e.div.offsetTop;var r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();e=e.div.getBoundingClientRect(),t=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0}this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||i,this.bottom=e.bottom||n+(e.height||i),this.width=e.width||s,this.lineHeight=void 0!==t?t:e.lineHeight}function S(e,t,i,s){var n=new T(t),r=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,s=0,n=0;n<i.length&&i[n]!==t;n++)"showing"===i[n].mode&&s++;return-1*++s}(r),o=[];if(r.snapToLines){var l;switch(r.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var c=n.lineHeight,u=c*Math.round(a),d=i[l]+c,h=o[0];Math.abs(u)>d&&(u=u<0?-1:1,u*=Math.ceil(d/c)*c),a<0&&(u+=""===r.vertical?i.height:i.width,o=o.reverse()),n.move(h,u)}else{var p=n.lineHeight/i.height*100;switch(r.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],n=new T(t)}var m=function(e,t){for(var n,r=new T(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(s);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(n=new T(e),a=l),e=new T(r)}return n||r}(n,o);t.move(m.toCSSCompatValues(i))}function C(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=n(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},T.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},T.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,s=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||s,height:e.height||t,bottom:e.bottom||s+(e.height||t),width:e.width||i}},C.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},C.convertCueToDOMTree=function(e,t){return e&&t?g(e,t):null},C.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var s=e.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",i.appendChild(s),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var n=[],r=T.getSimpleBoxPosition(s),a={font:Math.round(.05*r.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new b(e,o,a),s.appendChild(i.div),S(0,i,r,n),o.displayState=i.div,n.push(T.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)s.appendChild(t[o].displayState)},C.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},C.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof r))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var s=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),s}function s(e){e.match(/X-TIMESTAMP-MAP/)?l(e,function(e,i){"X-TIMESTAMP-MAP"===e&&function(e){var i=new o;l(e,function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",a(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)},/=/):l(e,function(e,i){"Region"===e&&function(e){var i=new o;if(l(e,function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var s=t.split(",");if(2!==s.length)break;var n=new o;if(n.percent("x",s[0]),n.percent("y",s[1]),!n.has("x")||!n.has("y"))break;i.set(e+"X",n.get("x")),i.set(e+"Y",n.get("y"));break;case"scroll":i.alt(e,t,["up"])}},/=/,/\s/),i.has("id")){var s=new(t.vttjs.VTTRegion||t.window.VTTRegion);s.width=i.get("width",100),s.lines=i.get("lines",3),s.regionAnchorX=i.get("regionanchorX",0),s.regionAnchorY=i.get("regionanchorY",100),s.viewportAnchorX=i.get("viewportanchorX",0),s.viewportAnchorY=i.get("viewportanchorY",100),s.scroll=i.get("scroll",""),t.onregion&&t.onregion(s),t.regionList.push({id:i.get("id"),region:s})}}(i)},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var n;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var u=(n=i()).match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new r(r.Errors.BadSignature);t.state="HEADER"}for(var d=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(d?d=!1:n=i(),t.state){case"HEADER":/:/.test(n)?s(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===n.indexOf("--\x3e")){t.cue.id=n;continue}case"CUE":try{c(n,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var h=-1!==n.indexOf("--\x3e");if(!n||h&&(d=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=n.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":n||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new r(r.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=C},184(e){var t={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function s(e){return"string"==typeof e&&!!i[e.toLowerCase()]&&e.toLowerCase()}function n(e,i,n){this.hasBeenReset=!1;var r="",a=!1,o=e,l=i,c=n,u=null,d="",h=!0,p="auto",m="start",g="auto",f="auto",y=100,_="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(e){c=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return h},set:function(e){h=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=s(e);t?(m=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=s(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(e){var t=s(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");_=t,this.hasBeenReset=!0}}}),this.displayState=void 0}n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=n},891(e){var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,s=3,n=0,r=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");s=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a}
2,set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):l=i}}})}},542(){},634(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var r=t[s]={exports:{}};return e[s].call(r.exports,r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";i.d(s,{default:()=>lo});var e=i(697),t=i.n(e),n=i(879);i(48);const r=n.default.getComponent("Component");class a extends r{constructor(e,t){super(e,t),this.addClass("videopress-spinner"),t.className&&this.addClass(t.className);const i=t.size||66;this.el().style.width=`${i}px`,this.el().style.height=`${i}px`}show(){this.addClass("show")}hide(){this.removeClass("show")}}const o="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8cGF0aAoJZmlsbC1ydWxlPSJldmVub2RkIgoJY2xpcC1ydWxlPSJldmVub2RkIgoJZmlsbD0id2hpdGUiCgoJZD0iTTE3IDEwaC0xLjJWN2MwLTIuMS0xLjctMy44LTMuOC0zLjgtMi4xIDAtMy44IDEuNy0zLjggMy44djNIN2MtLjYgMC0xIC40LTEgMXY4YzAgLjYuNCAxIDEgMWgxMGMuNiAwIDEtLjQgMS0xdi04YzAtLjYtLjQtMS0xLTF6bS0yLjggMEg5LjhWN2MwLTEuMiAxLTIuMiAyLjItMi4yczIuMiAxIDIuMiAyLjJ2M3oiIC8+Cjwvc3ZnPgo=",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyOSAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoCiAgICAgICAgZmlsbC1ydWxlPSJldmVub2RkIgogICAgICAgIGNsaXAtcnVsZT0iZXZlbm9kZCIKICAgICAgICBkPSJNMi43OTAzNyAwLjU5Mzc1QzQuMDM2MyAwLjU5Mzc1IDUuMTMxMDIgMS40MTY1OCA1LjQ3MjE1IDIuNjA5NDdMOC44NDUyIDE0LjQwNDRDOC44NDg2IDE0LjQxNjQgOC44NTQxMSAxNC40MjczIDguODYxMjQgMTQuNDM2OEwxMi44NTcyIDAuNTkzNzVIMTUuMDkyN0gyMS4yNzIxQzI1LjYwMzMgMC41OTM3NSAyOC41MDY2IDMuMzk4OTIgMjguNTA2NiA3LjY0NTY1QzI4LjUwNjYgMTEuOTQxMSAyNS41MjcyIDE0LjYxOTYgMjEuMDgxOCAxNC42MTk2SDE4LjE0OTlIMTQuMzcxOUwxMy42Mzc5IDE2Ljg4MTNDMTIuOTc5NiAxOC45MDk1IDExLjA4MjcgMjAuMjgzOSA4Ljk0MTUyIDIwLjI4MzlDNi44MDAzNSAyMC4yODM5IDQuOTAzNDEgMTguOTA5NSA0LjI0NTE3IDE2Ljg4MTNMMC4xMzcwNjkgNC4yMjI3NkMtMC40NDQ2NzEgMi40MzAyMiAwLjg5ODAzOCAwLjU5Mzc1IDIuNzkwMzcgMC41OTM3NVpNMTUuNzM3NCAxMC40MTE5SDIwLjAxNTZDMjEuODcxOCAxMC40MTE5IDIyLjk4NTYgOS4zNTAxOCAyMi45ODU2IDcuNjQ1NjVDMjIuOTg1NiA1LjkzMTM3IDIxLjg3MTggNC45MTgzOSAyMC4wMTU2IDQuOTE4MzlIMTcuNTIwMkwxNS43Mzc0IDEwLjQxMTlaIgogICAgICAgIGZpbGw9IndoaXRlIiAvPgo8L3N2Zz4=",c=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),u=e=>{const t=document.createElement("textarea");return t.innerHTML=String(e??""),t.value},d=n.default.getComponent("Component"),h=n.default.getComponent("Component"),p=class extends h{constructor(e,t){super(e,t),this.addClass("videopress-focus-anchor")}},m=n.default.getComponent("ProgressControl"),g=n.default.getComponent("SeekBar"),f={abovePx:0,belowPx:8},y={abovePx:8,belowPx:0},_=(e,t,i=f)=>{const s=t.changedTouches?t.changedTouches[0]:t;if("number"!=typeof s?.clientY)return!0;const n=e.el()?.closest(".vjs-progress-control");if(!n)return!0;const r=n.getBoundingClientRect();return s.clientY>=r.top-i.abovePx&&s.clientY<=r.bottom+i.belowPx},v=(e,t=f)=>class extends e{constructor(e,i){super(e,i),((e,t)=>{e.el().addEventListener("touchstart",i=>{_(e,i,t)||i.preventDefault()},{passive:!1})})(this,t)}handleMouseDown(e){_(this,e,t)&&super.handleMouseDown(e)}}
2,b=v(m,y),T=v(g,y),S=y,C=b,w=T,k="DONE",E="ERROR",x={Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",GreaterThan:">",LessThan:"<",Tab:"Tab"},I=()=>({selectPreviousSubMenuItem:e=>{if(!e.length)return;let t=0;for(let i=0;i<e.length;++i)if(document.activeElement===e[i]){t=i;break}t--,t<0&&(t=0),e[t].focus()},selectNextSubMenuItem:e=>{if(!e.length)return;let t=-1;for(let i=0;i<e.length;++i)if(document.activeElement===e[i]){t=i;break}t++,t>=e.length&&(t=e.length-1),e[t].focus()}});function A(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const P=n.default.getComponent("Menu"),D=n.default.dom,L=n.default.getComponent("ChaptersButton"),M=n.default.getComponent("ChaptersTrackMenuItem");class N extends P{constructor(e,t={}){t.contentElType="ol",super(e,t)}createEl(){const e=this.options_.contentElType||"ol";this.contentEl_=D.createEl(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),this.contentEl_.classList.add("vp-chapters-menu-content");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),t.classList.add("vp-chapters-menu"),this.player_.on(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}}class O extends M{buildWrapperCSSClass(){return`vp-chapter-menu-item ${super.buildWrapperCSSClass()}`}constructor(e,t={}){super(e,t),this.el().title=t?.cue?.text??this.player.localize("Chapter")}}const R=n.default.getComponent("Button"),U=n.default.getComponent("Component");function B(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const F=n.default.getComponent("Component"),j="vp-playback-progress-";function q(){return Y("quality")?Y("quality"):null}function $(){return Y("volume")?parseInt(Y("volume"))/100:null}function H(){return Y("captionsLanguage")?Y("captionsLanguage"):null}const z=["elapsed","remaining"];function V(){const e=Y("timeDisplayMode");return z.includes(e)?e:null}function W(e,t){const i=(new Date).getTime();Q(j+e,JSON.stringify({progress:t,expiry:i}))}function G(e){!function(e){try{return localStorage.removeItem(e)}catch{}}(j+e)}const X="vp-force-mse-";function K(e){return!!e&&null!==Y(X+e)}function Y(e){try{return localStorage.getItem(e)}catch{return null}}function Q(e,t){try{return localStorage.setItem(e,t)}catch{}}const Z=()=>te("vp09.00.50.08.00.02.02.02.00,mp4a.40.2")&&!n.default.browser.IS_ANY_SAFARI,J=()=>te("hvc1.1.6.L150.90,mp4a.40.2"),ee=e=>"vp9"===e?Z():"hevc"===e?J():"avc"===e,te=e=>"MediaSource"in window&&MediaSource.isTypeSupported(`video/mp4; codecs="${e}"`),ie="https://public-api.wordpress.com/rest/v1.1/videos",se=(e,t)=>`${ie}/${e}/playlist/${t}`,ne=(e,t)=>t?(0===(t=t.replace(/^http:\/\//,"https://")).indexOf("https://")?"":e)+t:null,re=(e,t)=>e&&t&&!/[?&]metadata_token=/.test(e)?((e,t,i)=>{const s=e.includes("?")?"&":"?";return e+s+"metadata_token="+encodeURIComponent(i)})(e,0,t):e;var ae=i(147),oe=i.n(ae);function le(e){const t=t=>{e(t,globalThis.io)};globalThis.io?setTimeout(t.bind(null,null),10):oe()("https://cdn.socket.io/4.1.1/socket.io.min.js",t)}function ce(e,{localize:t=e=>e,persistedQuality:i=null}={}){const s=[],n=e.file_url_base.https;let r=[];
2Object.keys(e.format_meta).forEach(t=>{const i=e.format_meta[t];let s=!1;i&&Object.keys(i).length>0&&ee(i.codec)&&(s=!0),r.push({name:i.label,internalName:t,isSupported:s,vertical_lines:i.vertical_lines})}),null!==e.adaptive_streaming&&r.push({name:t("Auto"),internalName:"adaptive",isSupported:!0,vertical_lines:0}),r=[...r].sort((e,t)=>e.vertical_lines-t.vertical_lines).reverse();let a=0;const o={};return r.forEach(t=>{if(!t.isSupported)return;if(o[t.name]||o["240p"]&&"224p"===t.name&&"std"!==i)return;let r=!1,l=null,c=null;if("adaptive"===t.internalName)r=!0,c=e.adaptive_streaming;else{const i=e?.files_status?.[t.internalName]?.mp4;if(!i)return;if(E===i)return;r=k===i,r&&(l=n+e.files[t.internalName].mp4,c=ne(n,e.files[t.internalName].hls))}s.push({id:a,name:t.name,internalName:t.internalName,mp4Source:l,hlsSource:c,ready:r,verticalLines:t.vertical_lines}),a++,o[t.name]=!0}),s}function ue(e,t){if(!t)return null;let i=e.find(e=>[e.mp4Source,e.hlsSource].indexOf(t)>-1);return i||(i=e.find(e=>"adaptive"===e.internalName&&t.search(/adaptive_\d(-\d)?.m3u8/)>-1||"avc_240p"===e.internalName&&t.search(/_std(-\d)?.mp4/)>-1)),i??null}function de(e,t){const i=/([0-9]{3,})(?:p|i)/i;let s=-1,n=null,r="";const a=(e,t)=>!(!t.name.includes(e)&&!t.internalName.includes(e)||(r=t.name,0));return e.some(e=>((e=>{const r=e.name.match(i)||e.internalName.match(i);if(!r)return;const a=parseInt(r[1]);if(isNaN(a)||a<t)return;const o=a-t;(s<0||o<s)&&(n=e.name,s=o)})(e),a(t+"p",e)||a(t+"i",e))),r.length||(r=n&&n.length?n:t+"p"),r}function he(e,t){if(!t)return"";const i=t.selectedIndex,s=i>=0?t[i]:null;if(!s||!1===s.enabled)return"";const n=s.height??0,r=s.width??0;let a=n;return(a<=0||r>0&&r<n)&&(a=r),a>0?de(e,a):""}const pe=new WeakMap;function me(e,t,i){let s=null,n=!1;return le((r,a)=>{if(n)return;const o=pe.get(e);if(o&&(o.disconnect(),pe.delete(e)),r)return;s=a("https://io.videopress.com",{upgrade:!1,query:{guid:t.guid}}),pe.set(e,s);const l=[];i.forEach(e=>{e.ready||l.push(e.internalName+"_mp4")});const c=i=>{-1!==l.indexOf(i.type)&&("ready"===i.status&&(e.api.wpcom.videoInfo(t.guid,e.director().getViewerBirthDate(),!0),l.splice(l.indexOf(i.type),1)),0===l.length&&(s.off("video status",c),s.disconnect()))};s.on("video status",c)}),()=>{n=!0,s&&(s.disconnect(),pe.get(e)===s&&pe.delete(e),s=null)}}function ge(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const fe=n.default.getComponent("MenuButton"),ye=n.default.getComponent("MenuItem"),_e=n.default.getComponent("Menu"),ve=n.default.dom,be={index:-1,disableAuto:!0};class Te extends fe{constructor(e,t){super(e,t),ge(this,"updateAutoLabel",()=>{let e="",t=null;const i=this.qualityLevels.some(e=>{const i="adaptive"===e.internalName;return i&&(t=e),i&&e.isCurrent}),s=this.player.qualityLevels();i&&s&&(e+=he(this.qualityLevels,s)),t&&this.autoButton&&(this.autoButton.innerHTML="<span>"+t.name+'<span class="current-auto-quality-label">'+e+"</span></span>",this.player.trigger("refresh-settings-menu-items"))}),ge(this,"findQualityLabelFromResolution",e=>de(this.qualityLevels,e)),ge(this,"buildQualityLevels",(e,t)=>{this.qualityLevels=ce(t,{localize:e=>this.localize(e),persistedQuality:q()});const i=ue(this.qualityLevels,this.player.src());i?this.setCurrentQualityLevel(i.internalName):this.refreshButton(),this.qualityLevels.some(e=>!e.ready)&&me(this.player,t,this.qualityLevels)}),ge(this,"getQualityDisplayString",e=>e?e.name:""),ge(this,"changeLevel",e=>{if(this.player.director().isChangingSrc())return;
2this.qualityLevels.forEach(t=>{t.id===e?t.isCurrent=!0:t.isCurrent=!1});const t=this.qualityLevels.find(t=>e===t.id);this.player.director().trigger("toggle-source",{quality:t.internalName})}),ge(this,"setCurrentQualityLevel",e=>{const t=this.qualityLevels.find(t=>e===t.internalName);t?(this.$(".vjs-icon-placeholder").innerHTML=this.getQualityDisplayString(t),this.qualityLevels.forEach(e=>{e.isCurrent=t.internalName===e.internalName}),this.refreshButton()):this.refreshButton()}),ge(this,"refreshButton",()=>{this.items=this.qualityLevels,this.update(),this.player.trigger("refresh-settings-menu-items")}),ge(this,"handleSubmenuKeyPress",e=>{if(void 0===e.currentTarget.dataset.id)return;const t=parseInt(e.currentTarget.dataset.id,10);this.changeLevel(t)}),ge(this,"createButton",(e,t,i,s)=>{const n=ve.createEl("li",{className:t,innerHTML:i,tabIndex:-1},{"data-id":s}),r=new ye(this.player_,{el:n});return r.on("click",this.handleMenuItemClick.bind(this)),r.on("touchend",this.handleMenuItemClick.bind(this)),e.addItem(r),n}),ge(this,"createMenu",()=>{const e=new _e(this.player_,{menuButton:this});if(this.items){this.autoMode||this.options.disableAuto||this.createButton(e,"vjs-menu-item",this.options.autoLabel,-1);for(let t=0;t<this.items.length;t++){const i=this.items[t];let s="vjs-menu-item";s+=i.isCurrent?" vjs-selected":"",s+=i.ready?"":" videopress-quality-transcoding";const n=this.createButton(e,s,this.getQualityDisplayString(i),i.id);"adaptive"===i.internalName&&(this.autoButton=n)}}return this.updateAutoLabel(),e}),this.options=n.default.obj.merge(be,t),this.parent=this.options.parent,this.autoButton=null,this.items=[],this.addClass("vjs-max-quality-selector-button"),this.defaults=be,this.qualityLevels=[],this.player=e,e.on("ready",()=>{e.director().on("build-quality-levels",this.buildQualityLevels),e.ready(()=>{this.player.addClass("vjs-quality-selector")}),e.director().on("source-set",(e,{quality:t})=>{this.setCurrentQualityLevel(t)});let t=null;e.qualityLevels().on("change",()=>{clearTimeout(t),t=setTimeout(()=>this.updateAutoLabel(),200)})})}handleMenuItemClick(e){const t=e.currentTarget||e.target;if(!t.dataset)return;const i=parseInt(t.dataset.id,10);this.changeLevel(i)}}n.default.registerComponent("maxQualityButton",Te);const Se=Te,Ce=n.default.getComponent("MenuItem"),we=n.default.getComponent("PlaybackRateMenuButton"),ke=n.default.getComponent("MaxQualityButton"),Ee=n.default.getComponent("SubsCapsButton"),xe=n.default.getComponent("Component");class Ie extends Ce{constructor(e,t,i){super(e,t);const s=n.default.getComponent(i);if(!s)throw new Error(`Component ${i} does not exist`);this.subMenu=new s(e,t),this.titleText="",this.subMenu instanceof we?this.titleText=this.localize("Speed"):this.subMenu instanceof ke?this.titleText=this.localize("Quality"):this.subMenu instanceof Ee&&(this.titleText=this.localize("Captions")),this.settingsSubMenuTitleEl_.innerHTML=this.titleText,this.update(),e.on("subs-caps-button-updated",()=>{this.update()}),e.on("refresh-settings-menu-items",()=>{this.update()}),e.on("ratechange",()=>{this.update()}),this.on("keyup",t=>{if(t.key)switch(t.key){case x.ArrowUp:e.trigger("settings-menu-up");break;case x.ArrowDown:e.trigger("settings-menu-down")}})}createEl(){const e=n.default.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1});return this.settingsSubMenuTitleEl_=n.default.dom.createEl("div",{className:"vjs-settings-sub-menu-title"}),e.appendChild(this.settingsSubMenuTitleEl_),this.settingsSubMenuValueEl_=n.default.dom.createEl("div",{className:"vjs-settings-sub-menu-value"}),e.appendChild(this.settingsSubMenuValueEl_),this.settingsSubMenuEl_=n.default.dom.createEl("div",{className:"vjs-settings-sub-menu"}),e.appendChild(this.settingsSubMenuEl_),e}handleClick(){this.player().trigger("show-settings-detail",{content:this.settingsSubMenuEl_,title:this.titleText,subMenu:this.subMenu})}update(){const e=this.update.bind(this),t=this.player.bind(this),i=function(){setTimeout(e,0),t().trigger("settings-changed")};for(const e of this.subMenu.menu.children())e instanceof xe&&(e.on("click",i),e.on("tap",i));if(this.settingsSubMenuEl_.appendChild(this.subMenu.menu.el_),this.subMenu instanceof we)this.settingsSubMenuValueEl_.innerHTML=this.subMenu.labelEl_.innerHTML;else for(const e of this.subMenu.menu.children_)e instanceof xe&&(e.options_.selected||e.hasClass("vjs-selected"))&&(this.settingsSubMenuValueEl_.innerHTML=e.options_.label??e.o
2ptions_.el.innerHTML)}}Ie.prototype.contentElType="button",n.default.registerComponent("SettingsMenuItem",Ie);const Ae=Ie;function Pe(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const De=n.default.getComponent("Component"),Le=n.default.getComponent("Menu"),Me=n.default.getComponent("MenuButton"),Ne=n.default.getComponent("SubsCapsButton");class Oe extends Me{constructor(e,t){super(e,t),Pe(this,"isMenuVisible",()=>this.player().hasClass("videopress-settings-open")),Pe(this,"showMenu",()=>{n.default.dom.hasClass(this.el_,"settings-menu-button__active")||n.default.dom.addClass(this.el_,"settings-menu-button__active"),this.player().hasClass("videopress-settings-open")||this.player().addClass("videopress-settings-open"),this.children().forEac
2h(e=>{e.hasClass("vjs-menu")&&e.removeClass("vjs-hidden")})}),Pe(this,"hideMenu",()=>{this.hideSubMenu(),n.default.dom.removeClass(this.el_,"settings-menu-button__active"),n.default.dom.removeClass(this.el_,"open"),this.player().removeClass("videopress-settings-open")}),Pe(this,"handleClick",()=>{this.toggleMenuVisibility()}),Pe(this,"isSubMenuVisible",()=>n.default.dom.hasClass(this.el_,"settings-menu-button__active")),this.controlText(this.localize("Settings Menu")),this.addClass("vjs-settings-menu-button"),e.on("show-settings-detail",(e,{content:t,title:i,subMenu:s})=>{this.detailContent.replaceChildren(t),this.detailHeaderTitle.innerHTML=i,s instanceof Ne&&this.shouldShowCaptionsSettings()?this.addClass("settings-menu-button__show-captions-settings"):this.removeClass("settings-menu-button__show-captions-settings")}),e.on("settings-changed",()=>this.hideMenu()),this.on(this.menuButton_,"mouseenter",()=>{this.removeClass("vjs-hover")}),e.on("click",this.hideMenuOnClickOutside.bind(this)),e.on("touchend",this.hideMenuOnClickOutside.bind(this)),this.on("keyup",e=>{e.key&&x.Escape===e.key&&(this.isSubMenuVisible()?this.hideSubMenu():this.hideMenu())});const i=I();e.on("settings-menu-up",()=>i.selectPreviousSubMenuItem(this.detailContent.getElementsByTagName("li"))),e.on("settings-menu-down",()=>i.selectNextSubMenuItem(this.detailContent.getElementsByTagName("li"))),window.addEventListener("blur",()=>this.hideMenu())}shouldShowCaptionsSettings(){return!this.player().tech({IWillNotUseThisInPlugins:!0}).featuresNativeTextTracks&&this.player().getChild("textTrackSettings")}buildCSSClass(){return`vjs-settings-menu-button ${super.buildCSSClass()}`}hideMenuOnClickOutside(e){this.isShowingMenuOrDetailView()&&!this.el_.contains(e.target)&&this.hideMenu()}isShowingMenuOrDetailView(){return n.default.dom.hasClass(this.el_,"settings-menu-button__active")||n.default.dom.hasClass(this.el_,"open")}toggleMenuVisibility(){this.isMenuVisible()?this.hideMenu():this.showMenu()}createEl(){const e=super.createEl(),t=n.default.dom.createEl("div",{className:"settings-menu-button__detail"}),i=n.default.dom.createEl("div",{className:"settings-menu-button__detail-header"});this.detailHeaderTitle=n.default.dom.createEl("div",{className:"settings-menu-button__detail-header-title"}),this.detailHeaderTitle.addEventListener("click",this.hideSubMenu.bind(this)),this.detailHeaderTitle.addEventListener("touchend",this.hideSubMenu.bind(this)),i.appendChild(this.detailHeaderTitle);const s=n.default.dom.createEl("div",{className:"settings-menu-button__detail-header-button",innerHTML:"Settings"});return s.addEventListener("click",()=>this.player().getChild("textTrackSettings").open()),s.addEventListener("touchend",()=>this.player().getChild("textTrackSettings").open()),i.appendChild(s),t.appendChild(i),this.detailContent=n.default.dom.createEl("div",{className:"settings-menu-button__detail-content"}),t.appendChild(this.detailContent),e.appendChild(t),e}hideSubMenu(){n.default.dom.removeClass(this.el_,"open"),n.default.dom.addClass(this.el_,"settings-menu-button__active")}showSubMenu(){const e=this.el_.querySelector(".settings-menu-button__detail .vjs-menu-content"),t=this.el_.querySelector(".settings-menu-button__detail .settings-menu-button__detail-header");if(e&&t){const i=this.player().height(),s=this.player().controlBar.el().offsetHeight,r=n.default.browser.TOUCH_ENABLED?28:18,a=i-t.offsetHeight-s-r,o=45;e.style.maxHeight=`${Math.max(a,o)}px`;const l=e.querySelector(".vjs-menu-item.vjs-selected");l&&l.scrollIntoView({block:"nearest"})}n.default.dom.addClass(this.el_,"open"),n.default.dom.removeClass(this.el_,"settings-menu-button__active")}createMenu(){const e=new Le(this.player());e.contentEl().classList.add("settings-menu-button__content");const t=this.options_.entries;if(t)for(const i of t){const t=new Ae(this.player(),this.options_,i);e.addChild(t),t.on("click",this.showSubMenu.bind(this)),t.on("touchend",this.showSubMenu.bind(this))}return e}}De.registerComponent("SettingsMenuButton",Oe);const Re=Oe,Ue=n.default.getComponent("SubsCapsButton"),Be=n.default.getComponent("OffTextTrackMenuItem"),Fe=n.default.getComponent("CaptionSettingsMenuItem"),je=e=>"subtitles"===e||"captions"===e;function qe(e){const t=e.textTracks(),i=[];for(let e=0;e<t.length;e++){const s=t[e];je(s.kind)&&s.label&&i.push(s)}return i}function $e(e){return qe(e).some(e=>"showing"===e.mode)}function He(e){const t=H();if(t){const i=t=>e.some(e=>e.language===t);let s=t;if(t.startsWith("auto_")){const e=t.replace("auto_","");i(e)&&(s=e)}else!i(t)&&i("auto_"+t)&&(s="auto_"+t);const n=e.find(e=>e.language===s);if(n)return n}return e[0]}function ze(e){const t=qe(e);
2if(0!==t.length)if($e(e))t.forEach(e=>{e.mode="disabled"});else{const e=He(t);t.forEach(t=>{t.mode=t===e?"showing":"disabled"})}}function Ve(e){return!e.tech({IWillNotUseThisInPlugins:!0}).featuresNativeTextTracks&&!!e.getChild("textTrackSettings")}const We=n.default.getComponent("Button"),Ge=n.default.getComponent("Button"),Xe=n.default.getComponent("Button"),Ke=new Map,Ye=(e,t)=>{Ke.set(e,t)},Qe=e=>!!e?.hasClass?.("vp2"),Ze=(e,t)=>{const i=n.default.getComponent("Component");return class extends i{constructor(i,s={}){const n=Qe(i)&&(e=>Ke.get(e))(e)||t;return new n(i,s)}}};n.default.registerComponent("MaxQualityButton",Se),n.default.registerComponent("SettingsMenuButton",Re),n.default.registerComponent("SettingsMenuCapsButton",class extends Ue{constructor(e,t){super(e,t),this.label_=this.localize("Captions"),e.on("refresh-subs-caps-button",()=>this.update())}update(){super.update(),this.player_.trigger("subs-caps-button-updated")}createItems(){const e=super.createItems(),t=[];return t.push(new Be(this.player_,{kinds:this.kinds_,kind:this.kind_,label:this.localize("Off")})),e.forEach(e=>{e instanceof Fe||e instanceof Be||e.track&&!e.track.label||t.push(e)}),t}}),n.default.registerComponent("CaptionsToggleButton",class extends We{constructor(e,t){super(e,t);const i=()=>this.update();this.on(e,"refresh-subs-caps-button",i);const s=e.textTracks();
2this.on(s,"change",i),this.on(s,"addtrack",i),this.on(s,"removetrack",i),this.update()}buildCSSClass(){return`vjs-captions-toggle-button ${super.buildCSSClass()}`}captionTracks(){return qe(this.player_)}isActive(){return $e(this.player_)}resolveTrack(e){return He(e)}handleClick(){ze(this.player_),this.update()}update(){if(0===this.captionTracks().length)return void this.hide();this.show();const e=this.isActive();this.toggleClass("vjs-captions-on",e),this.el_.setAttribute("aria-pressed",e?"true":"false"),this.controlText(e?this.localize("Disable captions"):this.localize("Enable captions"))}}),n.default.registerComponent("ShareButton",Ze("ShareButton",class extends U{constructor(e,t){super(e,t),function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(this,"handleClick",function(){this.player().director().trigger("share-dialog-open")}),this.addClass("videopress-share");const i=document.createElement("div");i.appendChild(document.createTextNode(u(t.title))),this.addChild("Component",{el:i});const s=new R(e,{clickHandler:this.handleClick,name:"Button"});s.addClass("vjs-control"),s.addClass("vjs-share-ui-button"),s.controlText(this.localize("Share Button")),this.addChild(s)}})),n.default.registerComponent("PlayPauseAnimation",class extends F{constructor(e,t){super(e,t),B(this,"disableAnimation",()=>{this.canAnimate=!1,this.hideElement()}),B(this,"hideElement",()=>{this.el().style.display="none"}),B(this,"enableAnimation",()=>{this.canAnimate=!0}),this.seekedTime=Date.now(),this.canAnimate=!1,this.addClass("videopress-play-pause-animation"),this.el().addEventListener("animationend",()=>this.hideElement());const i=()=>{!this.canAnimate||Date.now()-this.seekedTime<500||setTimeout(()=>{this.canAnimate&&(this.el().style.display="block")},30)};e.on("play",i),e.on("pause",i),e.on("firstplay",()=>setTimeout(()=>this.enableAnimation(),10)),e.on("seeking",()=>this.disableAnimation()),e.on("seeked",()=>{this.seekedTime=Date.now(),this.enableAnimation()}),e.on("ended",()=>this.disableAnimation()),e.director().on("toggle-source",()=>this.disableAnimation())}}),n.default.registerComponent("ChapterTitleButton",class extends L{constructor(e,t={}){super(e,t),A(this,"hideMenuOnClickOutside",e=>{if(this.isMenuOpen()&&!this.el_.contains(e.target)){if(document.querySelector(".vjs-control-bar").contains(e.target))return void this.closeMenu();this.handleClick()}}),A(this,"_removeMouseXEvents",()=>{this.menuButton_.off("mouseenter"),this.menuButton_.off("mouseleave")}),A(this,"changeButtonText",()=>{if(!this.track_||!this.track_.activeCues)return;const e=this.track_.activeCues[0];e&&this.controlText(e.text.trim())}),this._removeMouseXEvents(),e.on("chapters-track-changed",e=>this.update(e)),e.on("vp-chapters-set-from-bar",()=>{this.closeMenu()}),e.on("click",this.hideMenuOnClickOutside.bind(this)),e.on("touchend",this.hideMenuOnClickOutside.bind(this));const i=I();this.on("keyup",e=>{if(e.key&&this.isMenuOpen()&&(!this.menuItemFocusActivated||![x.ArrowUp,x.ArrowDown].includes(e.key)))switch(e.key){case x.ArrowUp:e.preventDefault(),i.selectPreviousSubMenuItem(this.el().getElementsByTagName("li")),this.menuItemFocusActivated=!0;break;case x.ArrowDown:e.preventDefault(),i.selectNextSubMenuItem(this.el().getElementsByTagName("li")),this.menuItemFocusActivated=!0;break;default:this.menuItemFocusActivated=!1}})}isMenuOpen(){return this.player().hasClass("videopress-chapters-menu-open")}closeMenu(){this.isMenuOpen()&&this.player().removeClass("videopress-chapters-menu-open"),this.unpressButton()}openMenu(){this.isMenuOpen()||this.player().addClass("videopress-chapters-menu-open"),this.pressButton()}handleClick(){this.buttonPressed_?this.closeMenu():this.openMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i<s;i++){const s=t[i],n=new O(this.player_,{track:this.track_,cue:s,index:i,maxIndex:t.length});e.push(n)}return e}buildWrapperCSSClass(){return`vp-chapter-text-button ${super.buildWrapperCSSClass()}`}setTrack(e){if(this.track_===e)return;let t=this.track_;t&&t.removeEventListener("cuechange",this.changeButtonText),super.setTrack(e),t&&t!==this.track_&&(t=null),this.track_&&this.track_.addEventListener("cuechange",this.changeButtonText)}controlText(e,t=this.el()){super.controlText(e,t),t.setAttribute("title",this.localize("Chapters"))}createMenu(){const e=new N(this.player_,{menuButton:this,contentElType:"ol"});if(this.hideThreshold_=0,this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}}),n.default.registerComponent("AirplayButton",class extends Ge{constructor(e,t){if(super(e,t),this.hide(),this.controlText(this.localize("AirPlay")),!window.WebKitPlaybackTargetAvailabilityEvent)return;const i=e.el().querySelector("video");i?(this.videoEl_=i,this.on(i,"webkitplaybacktargetavailabilitychanged",e=>this.updateAvailability(e)),this.on(i,"webkitcurrentplaybacktargetiswirelesschanged",()=>this.updateWirelessState())):n.default.log.warn("AirPlay: no video element found; AirPlay stays unavailable")}buildCSSClass(){return`vjs-airplay-button ${super.buildCSSClass()}`}updateAvailability(e){"available"===e.availability?this.show():this.hide()}updateWirelessState(){const e=!!this.videoEl_.webkitCurrentPlaybackTargetIsWireless;this.toggleClass("vjs-airplay-on",e),this.player_.trigger("cast-session-changed",{casting:e,platform:"airplay"})}handleClick(){this.videoEl_.webkitShowPlaybackTargetPicker()}}),n.default.registerComponent("CastButton",class extends Xe{constructor(e,t){super(e,t),this.hide(),this.controlText(this.localize("Play on TV")),this.on(e,"cast-availability-changed",(e,t)=>this.updateAvailability(t)),this.on(e,"cast-session-changed",(e,t)=>this.updateSession(t))}buildCSSClass(){return`vjs-cast-button ${super.buildCSSClass()}`}updateAvailability(e){"chromecast"===e?.platform&&(e.available?this.show():this.hide())}updateSession(e){"chromecast"===e?.platform&&(this.toggleClass("vjs-cast-connected",!!e.casting),this.controlText(e.casting?this.localize("Stop casting"):this.localize("Play on TV")))}handleClick(){this.player_.cast?.()?.toggleCast()}});const Je=n.default.getComponent("Component"),et=n.default.getComponent("Button");const tt=n.default.getComponent("TextTrackSettings"),it={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",textOpacity:"1",windowColor:"#000",windowOpacity:"0",fontFamily:"proportionalSansSerif"};var st,nt,rt,at,ot,lt,ct,ut,dt,ht,pt,mt,gt,ft,yt,_t={},vt=[],bt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tt=Array.isArray;function St(e,t){for(var i in t)e[i]=t[i];return e}function Ct(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function wt(e,t,i){var s,n,r,a={};for(r in t)"key"==r?s=t[r]:"ref"==r?n=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?st.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return kt(e,a,s,n,null)}function kt(e,t,i,s,n){var r={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++rt:n,__i:-1,__u:0};return null==n&&null!=nt.vnode&&nt.vnode(r),r}function Et(e){return e.children}function xt(e,t){this.props=e,this.context=t}function It(e,t){if(null==t)return e.__?It(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?It(e):null}function At(e){if(e.__P&&e.__d){var t=e.__v,i=t.__e,s=[],n=[],r=St({},t);r.__v=t.__v+1,nt.vnode&&nt.vnode(r),qt(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[i]:null,s,null==i?It(t):i,!!(32&t.__u),n),r.__v=t.__v,r.__.__k[r.__i]=r,Ht(s,r,n),t.__e=t.__=null,r.__e!=i&&Pt(r)}}function Pt(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Pt(e)}function Dt(e){(!e.__d&&(e.__d=!0)&&at.push(e)&&!Lt.__r++||ot!=nt.debounceRendering)&&((ot=nt.debounceRendering)||lt)(Lt)}function Lt(){try{for(var e,t=1;at.length;)at.length>t&&at.sort(ct),e=at.shift(),t=at.length,At(e)}finally{at.length=Lt.__r=0}}function Mt(e,t,i,s,n,r,a,o,l,c,u){var d,h,p,m,g,f,y,_=s&&s.__k||vt,v=t.length;for(l=Nt(i,t,_,l,v),d=0;d<v;d++)null!=(p=i.__k[d])&&(h=-1!=p.__i&&_[p.__i]||_t,p.__i=d,f=qt(e,p,h,n,r,a,o,l,c,u),m=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Wt(h.ref,null,p),u.push(p.ref,p.__c||m,p)),null==g&&null!=m&&(g=m),(y=!!(4&p.__u))||h.__k===p.__k?(l=Ot(p,l,e,y),y&&h.__e&&(h.__e=null)):"function"==typeof p.t
vendor: 7,922 bytes, line 2
2ype&&void 0!==f?l=f:m&&(l=m.nextSibling),p.__u&=-7);return i.__e=g,l}function Nt(e,t,i,s,n){var r,a,o,l,c,u=i.length,d=u,h=0;for(e.__k=new Array(n),r=0;r<n;r++)null!=(a=t[r])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[r]=kt(null,a,null,null,null):Tt(a)?a=e.__k[r]=kt(Et,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[r]=kt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[r]=a,l=r+h,a.__=e,a.__b=e.__b+1,o=null,-1!=(c=a.__i=Ut(a,i,l,d))&&(d--,(o=i[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(n>u?h--:n<u&&h++),"function"!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[r]=null;if(d)for(r=0;r<u;r++)null!=(o=i[r])&&!(2&o.__u)&&(o.__e==s&&(s=It(o)),Gt(o,o));return s}function Ot(e,t,i,s){var n,r;if("function"==typeof e.type){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Ot(n[r],t,i,s));return t}e.__e!=t&&(s&&(t&&e.type&&!t.parentNode&&(t=It(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Rt(e,t){return t=t||[],null==e||"boolean"==typeof e||(Tt(e)?e.some(function(e){Rt(e,t)}):t.push(e)),t}function Ut(e,t,i,s){var n,r,a,o=e.key,l=e.type,c=t[i],u=null!=c&&!(2&c.__u);if(null===c&&null==o||u&&o==c.key&&l==c.type)return i;if(s>(u?1:0))for(n=i-1,r=i+1;n>=0||r<t.length;)if(null!=(c=t[a=n>=0?n--:r++])&&!(2&c.__u)&&o==c.key&&l==c.type)return a;return-1}function Bt(e,t,i){"-"==t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||bt.test(t)?i:i+"px"}function Ft(e,t,i,s,n){var r,a;e:if("style"==t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)i&&t in i||Bt(e.style,t,"");if(i)for(t in i)s&&i[t]==s[t]||Bt(e.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(pt,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?s?i[ht]=s[ht]:(i[ht]=mt,e.addEventListener(t,r?ft:gt,r)):e.removeEventListener(t,r?ft:gt,r);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function jt(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t[dt])t[dt]=mt++;else if(t[dt]<i[ht])return;return i(nt.event?nt.event(t):t)}}}function qt(e,t,i,s,n,r,a,o,l,c){var u,d,h,p,m,g,f,y,_,v,b,T,S,C,w,k=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),r=[o=t.__e=i.__e]),(u=nt.__b)&&u(t);e:if("function"==typeof k)try{if(y=t.props,_=k.prototype&&k.prototype.render,v=(u=k.contextType)&&s[u.__c],b=u?v?v.props.value:u.__:s,i.__c?f=(d=t.__c=i.__c).__=d.__E:(_?t.__c=d=new k(y,b):(t.__c=d=new xt(y,b),d.constructor=k,d.render=Xt),v&&v.sub(d),d.state||(d.state={}),d.__n=s,h=d.__d=!0,d.__h=[],d._sb=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=St({},d.__s)),St(d.__s,k.getDerivedStateFromProps(y,d.__s))),p=d.props,m=d.state,d.__v=t,h)_&&null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==k.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),t.__v==i.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)){t.__v!=i.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),vt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),_&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,m,g)})}if(d.context=b,d.props=y,d.__P=e,d.__e=!1,T=nt.__r,S=0,_)d.state=d.__s,d.__d=!1,T&&T(t),u=d.render(d.props,d.state,d.context),vt.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,T&&T(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(s=St(St({},s),d.getChildContext())),_&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,m)),C=null!=u&&u.type===Et&&null==u.key?zt(u.props.children):u,o=Mt(e,Tt(C)?C:[C],t,i,s,n,r,a,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),f&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=r)if(e.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,t.__e=o}else{for(w=r.length;w--;)Ct(r[w]);$t(t)}else t.__e=i.__e,t.__k=i.__k,e.then||$t(t);nt.__e(e,t,i)}else null==r&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):o=t.__e=Vt(i.__e,t,i,s,n,r,a,l,c);return(u=nt.diffed)&&u(t),128&t.__u?void 0:o}function $t(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some($t))}function Ht(e,t,i){for(var s=0;s<i.length;s++)Wt(i[s],i[++s],i[++s]);nt.__c&&nt.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){nt.__e(e,t.__v)}})}function zt(e){return"object"!=typeof e||null==e||e.__b>0?e:Tt(e)?e.map(zt):void 0!==e.constructor?null:St({},e)}function Vt(e,t,i,s,n,r,a,o,l){var c,u,d,h,p,m,g,f=i.props||_t,y=t.props,_=t.type;if("svg"==_?n="http://www.w3.org/2000/svg":"math"==_?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((p=r[c])&&"setAttribute"in p==!!_&&(_?p.localName==_:3==p.nodeType)){e=p,r[c]=null;break}if(null==e){if(null==_)return document.createTextNode(y);e=document.createElementNS(n,_,y.is&&y),o&&(nt.__m&&nt.__m(t,r),o=!1),r=null}if(null==_)f===y||o&&e.data==y||(e.data=y);else{if(r="textarea"==_&&null!=y.defaultValue?null:r&&st.call(e.childNodes),!o&&null!=r)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"dangerouslySetInnerHTML"==c?d=p:"children"==c||c in y||"value"==c&&"defaultValue"in y||"checked"==c&&"defaultChecked"in y||Ft(e,c,null,p,n);for(c in y)p=y[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?m=p:"checked"==c?g=p:o&&"function"!=typeof p||f[c]===p||Ft(e,c,p,f[c],n);if(u)o||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Mt("template"==t.type?e.content:e,Tt(h)?h:[h],t,i,s,"foreignObject"==_?"http://www.w3.org/1999/xhtml":n,r,a,r?r[0]:i.__k&&It(i,0),o,l),null!=r)for(c=r.length;c--;)Ct(r[c]);o&&"textarea"!=_||(c="value","progress"==_&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[c]||"progress"==_&&!m||"option"==_&&m!=f[c])&&Ft(e,c,m,f[c],n),c="checked",null!=g&&g!=e[c]&&Ft(e,c,g,f[c],n))}return e}function Wt(e,t,i){try{if("function"==typeof e){var s="function"==typeof e.__u;s&&e.__u(),s&&null==t||(e.__u=e(t))}else e.current=t}catch(e){nt.__e(e,i)}}function Gt(e,t,i){var s,n;if(nt.unmount&&nt.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||Wt(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){nt.__e(e,t)}s.base=s.__P=null}if(s=e.__k)for(n=0;n<s.length;n++)s[n]&&Gt(s[n],t,i||"function"!=typeof e.type);i||Ct(e.__e),e.__c=e.__=e.__e=void 0}function Xt(e,t,i){return this.constructor(e,i)}function Kt(e,t,i){var s,n,r,a;t==document&&(t=document.documentElement),nt.__&&nt.__(e,t),n=(s="function"==typeof i)?null:i&&i.__k||t.__k,r=[],a=[],qt(t,e=(!s&&i||t).__k=wt(Et,null,[e]),n||_t,_t,t.namespaceURI,!s&&i?[i]:n?null:t.firstChild?st.call(t.childNodes):null,r,!s&&i?i:n?n.__e:t.firstChild,s,a),Ht(r,e,a)}function Yt(e){function t(e){var i,s;return this.getChildContext||(i=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&i.forEac
vendor: 10,193 bytes, line 2
2h(function(e){e.__e=!0,Dt(e)})},this.sub=function(e){i.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i&&i.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+yt++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}st=vt.slice,nt={__e:function(e,t,i,s){for(var n,r,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,s||{}),a=n.__d),a)return n.__E=n}catch(t){e=t}throw e}},rt=0,xt.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=St({},this.state),"function"==typeof e&&(e=e(St({},i),this.props)),e&&St(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),Dt(this))},xt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Dt(this))},xt.prototype.render=Et,at=[],lt="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ct=function(e,t){return e.__v.__b-t.__v.__b},Lt.__r=0,ut=Math.random().toString(8),dt="__d"+ut,ht="__a"+ut,pt=/(PointerCapture)$|Capture$/i,mt=0,gt=jt(!1),ft=jt(!0),yt=0;var Qt,Zt,Jt,ei,ti=0,ii=[],si=nt,ni=si.__b,ri=si.__r,ai=si.diffed,oi=si.__c,li=si.unmount,ci=si.__;function ui(e,t){si.__h&&si.__h(Zt,e,ti||t),ti=0;var i=Zt.__H||(Zt.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function di(e){return ti=1,hi(Ei,e)}function hi(e,t,i){var s=ui(Qt++,2);if(s.t=e,!s.__c&&(s.__=[i?i(t):Ei(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],i=s.t(t,e);t!==i&&(s.__N=[i,s.__[1]],s.__c.setState({}))}],s.__c=Zt,!Zt.__f)){var n=function(e,t,i){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter(function(e){return e.__c});if(n.every(function(e){return!e.__N}))return!r||r.call(this,e,t,i);var a=s.__c.props!==e;return n.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),r&&r.call(this,e,t,i)||a};Zt.__f=!0;var r=Zt.shouldComponentUpdate,a=Zt.componentWillUpdate;Zt.componentWillUpdate=function(e,t,i){if(this.__e){var s=r;r=void 0,n(e,t,i),r=s}a&&a.call(this,e,t,i)},Zt.shouldComponentUpdate=n}return s.__N||s.__}function pi(e,t){var i=ui(Qt++,3);!si.__s&&ki(i.__H,t)&&(i.__=e,i.u=t,Zt.__H.__h.push(i))}function mi(e,t){var i=ui(Qt++,4);!si.__s&&ki(i.__H,t)&&(i.__=e,i.u=t,Zt.__h.push(i))}function gi(e){return ti=5,fi(function(){return{current:e}},[])}function fi(e,t){var i=ui(Qt++,7);return ki(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function yi(e,t){return ti=8,fi(function(){return e},t)}function _i(e){var t=Zt.context[e.__c],i=ui(Qt++,9);return i.c=e,t?(null==i.__&&(i.__=!0,t.sub(Zt)),t.props.value):e.__}function vi(){var e=ui(Qt++,11);if(!e.__){for(var t=Zt.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var i=t.__m||(t.__m=[0,0]);e.__="P"+i[0]+"-"+i[1]++}return e.__}function bi(){for(var e;e=ii.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ci),t.__h.some(wi),t.__h=[]}catch(i){t.__h=[],si.__e(i,e.__v)}}}si.__b=function(e){Zt=null,ni&&ni(e)},si.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ci&&ci(e,t)},si.__r=function(e){ri&&ri(e),Qt=0;var t=(Zt=e.__c).__H;t&&(Jt===Zt?(t.__h=[],Zt.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ci),t.__h.some(wi),t.__h=[],Qt=0)),Jt=Zt},si.diffed=function(e){ai&&ai(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ii.push(t)&&ei===si.requestAnimationFrame||((ei=si.requestAnimationFrame)||Si)(bi)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Jt=Zt=null},si.__c=function(e,t){t.some(function(e){try{e.__h.some(Ci),e.__h=e.__h.filter(function(e){return!e.__||wi(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],si.__e(i,e.__v)}}),oi&&oi(e,t)},si.unmount=function(e){li&&li(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.some(function(e){try{Ci(e)}catch(e){t=e}}),i.__H=void 0,t&&si.__e(t,i.__v))};var Ti="function"==typeof requestAnimationFrame;function Si(e){var t,i=function(){clearTimeout(s),Ti&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(i,35);Ti&&(t=requestAnimationFrame(i))}function Ci(e){var t=Zt,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),Zt=t}function wi(e){var t=Zt;e.__c=e.__(),Zt=t}function ki(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function Ei(e,t){return"function"==typeof t?t(e):t}function xi(e,t){for(var i in t)e[i]=t[i];return e}function Ii(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var s in t)if("__source"!==s&&e[s]!==t[s])return!0;return!1}function Ai(e,t){var i=t(),s=di({t:{__:i,u:t}}),n=s[0].t,r=s[1];return mi(function(){n.__=i,n.u=t,Pi(n)&&r({t:n})},[e,i,t]),pi(function(){return Pi(n)&&r({t:n}),e(function(){Pi(n)&&r({t:n})})},[e]),i}function Pi(e){try{return!((t=e.__)===(i=e.u())&&(0!==t||1/t==1/i)||t!=t&&i!=i)}catch(e){return!0}var t,i}function Di(e,t){this.props=e,this.context=t}(Di.prototype=new xt).isPureReactComponent=!0,Di.prototype.shouldComponentUpdate=function(e,t){return Ii(this.props,e)||Ii(this.state,t)};var Li=nt.__b;nt.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Li&&Li(e)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Mi=nt.__e;nt.__e=function(e,t,i,s){if(e.then)for(var n,r=t;r=r.__;)if((n=r.__c)&&n.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),n.__c(e,t);Mi(e,t,i,s)};var Ni=nt.unmount;function Oi(e,t,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=xi({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Oi(e,t,i)})),e}function Ri(e,t,i){return e&&i&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ri(e,t,i)}),e.__c&&e.__c.__P===t&&(e.__e&&i.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=i)),e}function Ui(){this.__u=0,this.o=null,this.__b=null}function Bi(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Fi(){this.i=null,this.l=null}nt.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ni&&Ni(e)},(Ui.prototype=new xt).__c=function(e,t){var i=t.__c,s=this;null==s.o&&(s.o=[]),s.o.push(i);var n=Bi(s.__v),r=!1,a=function(){r||s.__z||(r=!0,i.__R=null,n?n(l):l())};i.__R=a;var o=i.__P;i.__P=null;var l=function(){if(! --s.__u){if(s.state.__a){var e=s.state.__a;s.__v.__k[0]=Ri(e,e.__c.__P,e.__c.__O)}var t;for(s.setState({__a:s.__b=null});t=s.o.pop();)t.__P=o,t.forceUpdate()}};s.__u++||32&t.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(a,a)},Ui.prototype.componentWillUnmount=function(){this.o=[]},Ui.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=Oi(this.__b,i,s.__O=s.__P)}this.__b=null}var n=t.__a&&wt(Et,null,e.fallback);return n&&(n.__u&=-33),[wt(Et,null,t.__a?null:e.children),n]};var ji=function(e,t,i){if(++i[1]===i[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(i=e.i;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.i=i=i[2]}};function qi(e){return this.getChildContext=function(){return e.context},e.children}function $i(e){var t=this,i=e.h;if(t.componentWillUnmount=function(){Kt(null,t.v),t.v=null,t.h=null},t.h&&t.h!==i&&t.componentWillUnmount(),!t.v){for(var s=t.__v;null!==s&&!s.__m&&null!==s.__;)s=s.__;t.h=i,t.v={nodeType:1,parentNode:i,childNodes:[],__k:{__m:s.__m},contains:function(){return!0},namespaceURI:i.namespaceURI,insertBefore:function(e,i){this.childNodes.push(e),t.h.insertBefore(e,i)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}Kt(wt(qi,{context:t.context},e.__v),t.v)}function Hi(e,t){var i=wt($i,{__v:e,h:t});return i.containerInfo=t,i}(Fi.prototype=new xt).__a=function(e){var t=this,i=Bi(t.__v),s=t.l.get(e);return s[0]++,function(n){var r=function(){t.props.revealOrder?(s.push(n),ji(t,e,s)):n()};i?i(r):r()}},Fi.prototype.render=function(e){this.i=null,this.l=new Map;var t=Rt(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.l.set(t[i],this.i=[1,0,this.i]);return e.children},Fi.prototype.componentDidUpdate=Fi.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,i){ji(e,i,t)})};var zi="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Vi=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Wi=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gi=/[A-Z0-9]/g,Xi="undefined"!=typeof document,Ki=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};xt.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(xt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Yi=nt.event;nt.event=function(e){return Yi&&(e=Yi(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Qi={configurable:!0,get:function(){return this.class}},Zi=nt.vnode;nt.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,i=e.type,s={},n=-1==i.indexOf("-");for(var r in t){var a=t[r];if(!("value"===r&&"defaultValue"in t&&null==a||Xi&&"children"===r&&"noscript"===i||"class"===r||"className"===r)){var o=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===a?a="":"translate"===o&&"no"===a?a=!1:"o"===o[0]&&"n"===o[1]?"ondoubleclick"===o?r="ondblclick":"onchange"!==o||"input"!==i&&"textarea"!==i||Ki(t.type)?"onfocus"===o?r="onfocusin":"onblur"===o?r="onfocusout":Wi.test(r)&&(r=o):o=r="oninput":n&&Vi.test(r)?r=r.replace(Gi,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===o&&s[r=o]&&(r="oninputCapture"),s[r]=a}}"select"==i&&(s.multiple&&Array.isArray(s.value)&&(s.value=Rt(t.children).forEac
2h(function(e){e.props.selected=-1!=s.value.indexOf(e.props.value)})),null!=s.defaultValue&&(s.value=Rt(t.children).forEach(function(e){e.props.selected=s.multiple?-1!=s.defaultValue.indexOf(e.props.value):s.defaultValue==e.props.value}))),t.class&&!t.className?(s.class=t.class,Object.defineProperty(s,"className",Qi)):t.className&&(s.class=s.className=t.className),e.props=s}(e),e.$$typeof=zi,Zi&&Zi(e)};var Ji=nt.__r;nt.__r=function(e){Ji&&Ji(e),e.__c};var es=nt.diffed;nt.diffed=function(e){es&&es(e);var t=e.props,i=e.__e;null!=i&&"textarea"===e.type&&"value"in t&&t.value!==i.value&&(i.value=null==t.value?"":t.value)};var ts=function(e,t,i){return null==t.__k&&(t.textContent=""),Kt(e,t),"function"==typeof i&&i(),e?e.__c:null},is=function(e){return!!e.__k&&(Kt(null,e),!0)},ss=wt,ns=Et,rs=xt;const as=["playerresize","fullscreenchange"];function os(e){return Ai(e.subscribe,e.getSnapshot)}const ls=Yt(null);function cs(){const e=_i(ls);return"function"==typeof e?e():null}function us(e,t,i){const[s,n]=di(0);return pi(()=>{if(!e)return;const s=e.querySelector(".vjs-progress-holder"),r=e.querySelector(".vjs-play-progress");if(!s||!r)return;let a=null;const o=()=>{const e=s.getBoundingClientRect().width,t=r.getBoundingClientRect().width;var i;n(e>0?(i=t/e,Math.min(Math.max(i,0),1)):0)};if(t){const e=()=>{o(),a=requestAnimationFrame(e)};return a=requestAnimationFrame(e),()=>{null!==a&&cancelAnimationFrame(a)}}if(!i)return;const l=()=>{null===a&&(a=requestAnimationFrame(()=>{a=null,o()}))};return i.on(["timeupdate","seeked"],l),()=>{i.off(["timeupdate","seeked"],l),null!==a&&cancelAnimationFrame(a)}},[e,t,i]),s}const ds=e=>Math.min(Math.max(e,0),1);function hs(e,t,i){if(!(Array.isArray(e)&&0!==e.length&&t>0))return null;const s=ds(i);for(let i=0;i<e.length;i++){const n=ds(e[i].startTime/t),r=ds(e[i].endTime/t),a=i===e.length-1;if(s>=n&&(s<r||a&&s<=r))return{start:n,end:r,width:r-n,index:i}}return null}function ps({player:e,store:t,progressEl:i,hoverFraction:s,hovering:n}){const{chapters:r,duration:a,bufferedPercent:o}=os(t),l=Array.isArray(r)&&r.length>1,c=n&&l?hs(r,a,s):null,u=us(i,!!c);if(pi(()=>{const t=i?i.querySelector(".vjs-progress-holder"):null;if(!t)return;const s=()=>{t.classList.remove("vp2-seek--segmented"),i.style.removeProperty("--vp2-seek-mask")};if(!l)return void s();const n=()=>{const e=function(e,t,i){if(!(Array.isArray(e)&&!(e.length<2)&&t>0&&i>0))return null;const s=[];let n=0;for(let r=1;r<e.length;r++){const a=ds(e[r].startTime/t)*i;a-n<4||i-a<4||(s.push(a),n=a)}if(0===s.length)return null;const r=["#000 0"];return s.forEach(e=>{const t=(e-1).toFixed(2),i=(e+1).toFixed(2);r.push(`#000 ${t}px`,`transparent ${t}px`,`transparent ${i}px`,`#000 ${i}px`)}
2),r.push("#000 100%"),`linear-gradient(to right, ${r.join(", ")})`}(r,a,t.getBoundingClientRect().width);e?(i.style.setProperty("--vp2-seek-mask",e),t.classList.add("vp2-seek--segmented")):s()};return n(),e.on("playerresize",n),()=>{e.off("playerresize",n),s()}},[e,i,r,a,l]),!(c&&c.width>0))return null;const d=100*ds((u-c.start)/c.width),h=100*ds(((o||0)-c.start)/c.width);return ss("div",{className:"vp2-seek__amp","aria-hidden":"true",style:{left:100*c.start+"%",width:100*c.width+"%"}},ss("div",{className:"vp2-seek__amp-track vjs-slider"}),ss("div",{className:"vp2-seek__amp-load vjs-load-progress",style:{width:`${h}%`}}),ss("div",{className:"vp2-seek__amp-play vjs-play-progress",style:{width:`${d}%`}}))}function ms({hovering:e,fraction:t,x:i,playedFraction:s}){if(!(e&&t>s))return null;const n=`inset(0 calc(100% - ${i}px) 0 ${100*s}%)`;return ss("div",{className:"vp2-seek__ghost","aria-hidden":"true",style:{clipPath:n,WebkitClipPath:n}})}function gs({fraction:e}){return ss("div",{className:"vp2-seek__dot","aria-hidden":"true",style:{left:100*e+"%"}})}function fs({player:e,store:t,fraction:i,visible:s,bandEl:r}){const{duration:a,chapters:o}=os(t),l=function(e,t,i=!0){const[,s]=di(0),[n,r]=di(()=>!!e.isFullscreen()),[a,o]=di(()=>new Set);pi(()=>{const t=()=>s(e=>e+1),i=()=>r(!!e.isFullscreen());return e.on("vp2-thumbnails-ready",t),e.on("fullscreenchange",i),()=>{e.off("vp2-thumbnails-ready",t),e.off("fullscreenchange",i)}},[e]);const l=e.usingPlugin&&e.usingPlugin("thumbnails")?e.thumbnails():null,c=l&&l.isReady()?l.getFrameAt(t):null,u=c?c.sheetUrl:null,d=!!u&&(a.has(u)||l.isSheetL
2oaded(u));if(pi(()=>{if(!i||!l||!u||d)return;let e=!1;return l.onSheetLoaded(u,()=>{e||o(e=>{const t=new Set(e);return t.add(u),t})}),()=>{e=!0}},[i,l,u,d]),!c)return null;const h=n||e.hasClass("vjs-touch-enabled"),p=h?108:90,m=h?192:160,g=c.height>0?c.width/c.height:16/9,f=Math.min(m,Math.max(90,Math.round(p*g))),y=c.width>0?Math.round(c.frameLeft/c.width):0,_=c.height>0?Math.round(c.frameTop/c.height):0;return{sheetUrl:u,frameLeft:y*f,frameTop:_*p,width:f,height:p,cols:c.cols,rows:c.rows,loaded:d}}(e,i,s),c=cs(),u=gi(null),d=(h=i||0,Math.min(Math.max(h,0),1));var h;if(mi(()=>{const e=u.current,t=e?e.parentElement:null;if(!e||!t||!r)return;const i=r.getBoundingClientRect(),s=t.getBoundingClientRect(),n=i.left-s.left,a=e.offsetWidth,o=n+d*i.width,l=Math.min(Math.max(o-a/2,n),n+Math.max(i.width-a,0));e.style.left=`${l}px`}),!(s&&c&&a>0))return null;const p=d*a,m=n.default.time.formatTime(p,a),g=hs(o,a,d),f=g&&o[g.index]&&o[g.index].text?o[g.index].text.trim():"";return Hi(ss("div",{className:"vp2-preview",ref:u,"aria-hidden":"true"},l&&ss("div",{className:"vp2-preview__img","data-loaded":String(!!l.loaded),style:{width:`${l.width}px`,height:`${l.height}px`,backgroundImage:`url(${l.sheetUrl})`,backgroundSize:`${l.width*l.cols}px ${l.height*l.rows}px`,backgroundPosition:`-${l.frameLeft}px -${l.frameTop}px`}},!l.loaded&&ss("span",{className:"vp2-preview__spinner"})),ss("div",{className:"vp2-preview__pill"},ss("span",{className:"vp2-preview__time"},m),f&&ss("span",{className:"vp2-preview__chapter"},f))),c)}const ys={hovering:!1,scrubbing:!1,fraction:0,x:0};function _s({store:e,player:t,progressEl:i}){const s=function(e,t,i){const[s,n]=di(ys);return pi(()=>{if(!t)return;const e=t.ownerDocument,s={el:()=>t};let r=ys,a=null,o=-1/0;const l=()=>{a=null,n(r)},c=e=>{r={...r,...e},null===a&&(a=requestAnimationFrame(l))},u=e=>{const i=e.changedTouches?e.changedTouches[0]:e,s=t.getBoundingClientRect(),n=(r=i.clientX-s.left,a=s.width,Math.min(Math.max(r,0),a));var r,a;return{x:n,fraction:s.width>0?n/s.width:0}},d=e=>t.classList.toggle("vp2-seek--scrubbing",e),h=()=>Date.now()-o<700,p=e=>c(u(e)),m=t=>{e.removeEventListener("mousemove",p),e.removeEventListener("mouseup",m),d(!1),c({scrubbing:!1,...u(t)})},g=t=>{h()||0!==t.button||_(s,t,S)&&(d(!0),c({scrubbing:!0,hovering:!0,...u(t)}),e.addEventListener("mousemove",p),e.addEventListener("mouseup",m))},f=e=>{h()||c({hovering:!0,...u(e)})},y=e=>{h()||c({hovering:!0,...u(e)})},v=()=>c({hovering:!1}),b=e=>{o=Date.now(),_(s,e,S)&&(d(!0),c({scrubbing:!0,...u(e)}))},T=e=>{o=Date.now(),r.scrubbing&&c(u(e))},C=e=>{o=Date.now(),r.scrubbing&&(d(!1),c({scrubbing:!1,hovering:!1,...u(e)}))};let w=null,k=!1;const E=()=>(e.removeEventListener("mouseup",E,!0),e.removeEventListener("touchend",E,!0),e.removeEventListener("touchcancel",E,!0),k=!1,void(w=setTimeout(()=>{w=null,i?.releasePlaybackState()},0))),x=n=>{i&&!k&&(n.target===t||t.contains(n.target))&&("mousedown"===n.type&&0!==n.button||_(s,n,S)&&(null!==w&&(clearTimeout(w),w=null),k=!0,i.holdPlaybackState(),e.addEventListener("mouseup",E,!0),e.addEventListener("touchend",E,!0),e.addEventListener("touchcancel",E,!0)))};return e.addEventListener("mousedown",x,!0),e.addEventListener("touchstart",x,!0),t.addEventListener("mouseenter",f),t.addEventListener("mousemove",y),t.addEventListener("mouseleave",v),t.addEventListener("mousedown",g),t.addEventListener("touchstart",b,{passive:!0}),t.addEventListener("touchmove",T,{passive:!0}),t.addEventListener("touchend",C),t.addEventListener("touchcancel",C),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mousemove",y),t.removeEventListener("mouseleave",v),t.removeEventListener("mousedown",g),t.removeEventListener("touchstart",b),t.removeEventListener("touchmove",T),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C),e.removeEventListener("mousemove",p),e.removeEventListener("mouseup",m),e.removeEventListener("mousedown",x,!0),e.removeEventListener("touchstart",x,!0),e.removeEventListener("mouseup",E,!0),e.removeEventListener("touchend",E,!0),e.removeEventListener("touchcancel",E,!0),null!==w&&clearTimeout(w),(k||null!==w)&&i?.releasePlaybackState(),null!==a&&cancelAnimationFrame(a),d(!1)}},[e,t,i]),s}(t,i,e),{paused:n,ended:r}=os(e),a=us(i,!n&&!r||s.hovering||s.scrubbing,t);return ss(ns,null,ss(ps,{player:t,store:e,progressEl:i,hoverFraction:s.fraction,hovering:s.hovering}),ss(ms,{hovering:s.hovering,fraction:s.fraction,x:s.x,playedFraction:a}),ss(gs,{fraction:a}),ss(fs,{player:t,store:e,fraction:s.fraction,visible:s.hovering||s.scrubbing,bandEl:i}))}let vs=-1/0;function bs(){return bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},bs.apply(null,arguments)}function Ts({icon:e,label:t,shortcut:i,className:s,onClick:n,pressed:r,expanded:a,focusName:o,disabled:l,hasPopup:c}){const{handlers:u,tooltipNode:d}=function({label:e,shortcut:t}={}){const i=cs(),[s,n]=di("hidden"),r=gi("hidden"),a=gi(null),o=gi(null),l=gi({show:null,fade:null}),c=yi(e=>{r.current=e,n(e)},[]),u=yi(e=>{if("function"==typeof window.matchMedia&&window.matchMedia("(hover: none)").matches)return;e&&e.currentTarget&&(a.current=e.currentTarget);const t=l.current;clearTimeout(t.show),clearTimeout(t.fade),"visible"!==r.current&&"showing"!==r.current&&("fading"!==r.current?Date.now()-vs<300?c("showing"):t.show=setTimeout(()=>c("showing"),300):c("visible"))},[c]),d=yi(()=>{const e=l.current;clearTimeout(e.show),"showing"!==r.current?"visible"===r.current&&(vs=Date.now(),c("fading"),e.fade=setTimeout(()=>c("hidden"),100)):c("hidden")},[c]);pi(()=>()=>{clearTimeout(l.current.show),clearTimeout(l.current.fade)},[]),mi(()=>{const e=o.current,t=a.current;if("hidden"===s||!e||!t)return;const i=e.parentElement;if(!i)return;const n=i.getBoundingClientRect(),r=t.getBoundingClientRect(),l=e.offsetWidth,c=r.left+r.
2width/2-n.left,u=Math.max(n.width-l,0),d=Math.min(Math.max(c-l/2,0),u);e.style.left=`${d}px`},[s,e,t]),mi(()=>{if("showing"!==s)return;const e=requestAnimationFrame(()=>c("visible"));return()=>cancelAnimationFrame(e)},[s,c]);const h=t?`${e} (${t})`:e;return{handlers:fi(()=>({onMouseEnter:u,onMouseLeave:d,onFocus:u,onBlur:d}),[u,d]),tooltipNode:i&&"hidden"!==s?Hi(ss("div",{className:"vp2-tooltip"+("visible"===s?" vp2-tooltip--visible":""),"aria-hidden":"true",ref:o},h),i):null}}({label:t,shortcut:i});return ss(ns,null,ss("button",bs({type:"button",className:"vp2-button vjs-control vjs-button"+(s?` ${s}`:""),"aria-label":t,"aria-pressed":r,"aria-expanded":a,"aria-haspopup":c?"true":void 0,"data-vp2-focus":o,disabled:l,onClick:n},u),ss("span",{className:"vp2-button__icon","aria-hidden":"true"},e)),d)}function Ss({size:e=24,className:t,children:i}){return ss("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},i)}const Cs=()=>ss("path",{d:"M12.5 5 7.5 9H3.5v6h4l5 4V5Z",fill:"currentColor",strokeWidth:"1.5"}),ws=()=>ss("path",{d:"M8 5.5v13L19.5 12 8 5.5Z",fill:"currentColor",strokeWidth:"1.5"}),ks=()=>ss(ns,null,ss("rect",{x:"6.5",y:"5",width:"4",height:"14",rx:"1.5",fill:"currentColor",stroke:"none"}),ss("rect",{x:"13.5",y:"5",width:"4",height:"14",rx:"1.5",fill:"currentColor",stroke:"none"})),Es=e=>ss(Ss,e,ss(ws,null)),xs=e=>ss(Ss,e,ss(ks,null)),Is=()=>ss("path",{d:"M13.75 4.194a8 8 0 0 0-4.812.415l-.301.132a8 8 0 0 0-3.203 2.691L4 6v4h4L6.517 8.515q.333-.525.758-.976l.013-.014a6.5 6.5 0 0 1 2.942-1.78q.033-.008.065-.018.095-.026.19-.049l.082-.018q.104-.024.207-.044l.059-.01q.33-.06.673-.086l.1-.008.131-.006q.102-.004.203-.005L12 5.5h.046l.225.006q.042.002.083.003a7 7 0 0 1 .476.044l.092.012.183.03q.029.004.056.009l.149.027a6.5 6.5 0 0 1 1.607.559l.018.01q.394.2.756.45.086.06.17.12.047.035.093.071a7 7 0 0 1 .381.316l.059.053q.082.075.162.154l.053.052q.293.294.548.627.014.017.028.036l.073.1.096.134.07.106q.047.071.092.142l.069.112a6.7 6.7 0 0 1 .578 1.26 6.5 6.5 0 0 1 .255 1.037l.018.12a6 6 0 0 1 .038.33 7 7 0 0 1 .018.88q-.003.071-.009.142l-.01.133a7 7 0 0 1-.055.453l-.025.144a6.5 6.5 0 0 1-.808 2.153l-.07.112a6 6 0 0 1-.257.383l-.073.1-.028.037q-.255.331-.548.626l-.063.062a7 7 0 0 1-.592.512q-.045.035-.093.071-.077.057-.157.111-.364.253-.76.456l-.027.013a6.5 6.5 0 0 1-1.995.625q-.045.007-.092.012a7 7 0 0 1-.476.044l-.083.003-.225.006L12 18.5l-.06-.002-.203-.006-.132-.006-.1-.008a7 7 0 0 1-.672-.086l-.059-.01-.207-.044-.082-.018-.19-.049-.065-.018a6.5 6.5 0 0 1-3.858-3.004l-1.3.75a8 8 0 0 0 3.565 3.26l.301.131a8 8 0 0 0 11.055-7.061l.007-.33c0-1.76-.581-3.473-1.653-4.87l-.206-.256a8 8 0 0 0-4.07-2.601zM10 14.999l5-3-5-3z",fill:"currentColor",stroke:"none"}),As=e=>ss(Ss,e,ss(Is,null)),Ps=["m15.75 9.75 4.5 4.5","m20.25 9.75-4.5 4.5"],Ds=e=>ss(Ss,e,ss("g",{className:"vp2-icon-playback__play"},ss(ws,null)),ss("g",{className:"vp2-icon-playback__pause"},ss(ks,null)),ss("g",{className:"vp2-icon-playback__replay"},ss(Is,null))),Ls=e=>ss(Ss,e,ss(Cs,null),ss("path",{className:"vp2-icon-vol__wave1",d:"M15.05 9.45a3.6 3.6 0 0 1 0 5.1"}),ss("path",{className:"vp2-icon-vol__wave2",d:"M17.05 7.45a6.45 6.45 0 0 1 0 9.1"}),ss("g",{className:"vp2-icon-vol__cross"},Ps.map(e=>ss("path",{key:e,d:e})))),Ms=e=>ss(Ss,e,$s.map(([e,t])=>ss("path",{key:e,className:`vp2-icon-fs__arrow vp2-icon-fs__arrow--${e}`,d:t}))),Ns="M10.6 10.5a2.2 2.2 0 1 0 0 3M16.6 10.5a2.2 2.2 0 1 0 0 3",Os=e=>ss(Ss,e,ss("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),ss("path",{d:Ns})),Rs=e=>{const t=`vp2-icon-cc-mask-${vi()}`;return ss(Ss,e,ss("mask",{id:t},ss("rect",{x:"0",y:"0",width:"24",height:"24",fill:"#fff",stroke:"none"}),ss("path",{d:Ns,fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round"})),ss("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5",fill:"currentColor",stroke:"none",mask:`url(#${t})`}))},Us=e=>ss(Ss,e,ss("path",{fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58ZM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6Z"})),Bs=e=>ss(Ss,e,ss("path",{d:"M7 18H4.5A2.5 2.5 0 0 1 2 15.5v-10A2.5 2.5 0 0 1 4.5 3h15A2.5 2.5 0 0 1 22 5.5v10a2.5 2.5 0 0 1-2.5 2.5H17"}),ss("path",{d:"m12 15-5 6h10l-5-6Z",fill:"currentColor"})),Fs=e=>ss(Ss,e,ss("path",{d:"M3 8V5.5A2.5 2.5 0 0 1 5.5 3h13A2.5 2.5 0 0 1 21 5.5v13a2.5 2.5 0 0 1-2.5 2.5H14"}),ss("path",{d:"M3 17a4 4 0 0 1 4 4"}),ss("path",{d:"M3 12.5A8.5 8.5 0 0 1 11.5 21"}),ss("circle",{cx:"3",cy:"21",r:"1",fill:"currentColor",stroke:"none"})),js=e=>ss(Ss,e,ss("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2.5"}),ss("rect",{x:"12.5",y:"11.5",width:"6",height:"5",rx:"1",fill:"currentColor",stroke:"none"}),ss("path",{d:"M7.5 8.5 11 12"}),ss("path",{d:"M11 9.5V12H8.5"})),qs=e=>ss(Ss,e,ss("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2.5"}),ss("rect",{x:"12.5",y:"11.5",width:"6",height:"5",rx:"1",fill:"currentColor",stroke:"none"}),ss("path",{d:"M11 12 7.5 8.5"}),ss("path",{d:"M7.5 11V8.5H10"})),$s=[["tl","M4.75 9.5V4.75H9.5M4.75 4.75 9.5 9.5"],["br","M19.25 14.5V19.25H14.5M19.25 19.25 14.5 14.5"]],Hs=e
2=>ss(Ss,e,ss("path",{d:"m9.5 6 6 6-6 6"})),zs=e=>ss(Ss,e,ss("path",{d:"m14.5 6-6 6 6 6"})),Vs=e=>ss(Ss,e,ss("path",{d:"m5 12.5 4.5 4.5L19 7"})),Ws=e=>ss(Ss,e,ss("path",{d:"M6.34 19.16a8 8 0 1 1 11.32 0"}),ss("path",{d:"m12 13.5 3.5-4.5"}),ss("circle",{cx:"12",cy:"13.5",r:"1.4",fill:"currentColor",stroke:"none"})),Gs=e=>ss(Ss,e,ss("rect",{x:"4.5",y:"13",width:"3.5",height:"6",rx:"1.25",fill:"currentColor",stroke:"none"}),ss("rect",{x:"10.25",y:"9",width:"3.5",height:"10",rx:"1.25",fill:"currentColor",stroke:"none"}),ss("rect",{x:"16",y:"5",width:"3.5",height:"14",rx:"1.25",fill:"currentColor",stroke:"none"})),Xs=e=>ss(Ss,e,ss("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),ss("path",{d:"M6.5 11.5H14"}),ss("path",{d:"M17 11.5h.5"}),ss("path",{d:"M6.5 15h.5"}),ss("path",{d:"M10 15h7.5"})),Ks=e=>ss(Ss,e,ss("path",{d:"M7.25 15.5 12 5l4.75 10.5"}),ss("path",{d:"M9.06 11.5h5.88"}),ss("path",{d:"M6 19.5h12"})),Ys=e=>ss(Ss,e,ss("path",{d:"M6 6l12 12"}),ss("path",{d:"M18 6 6 18"})),Qs=e=>ss(Ss,e,ss("path",{fill:"currentColor",stroke:"none",d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Zs=e=>ss(Ss,e,ss("path",{d:"m8.5 7-5 5 5 5"}),ss("path",{d:"m15.5 7 5 5-5 5"}),ss("path",{d:"m13.5 5-3 14"})),Js=e=>ss(Ss,e,ss("path",{d:"M12 3v11"}),ss("path",{d:"m7.5 10 4.5 4.5 4.5-4.5"}),ss("path",{d:"M5 15.5V20h14v-4.5"})),en=e=>ss(Ss,e,ss("rect",{x:"5",y:"10",width:"14",height:"11",rx:"2.5"}),ss("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"}),ss("path",{d:"M12 14v3"}));function tn({store:e,player:t}){const{paused:i,ended:s}=os(e);let n=t.localize("Pause");s?n=t.localize("Replay"):i&&(n=t.localize("Play"));return ss(Ts,{className:`vjs-play-control${`${i?"":" vjs-playing"}${s?" vjs-ended":""}`}`,icon:ss(Ds,null),label:n,shortcut:"k",focusName:"play",onClick:()=>t.paused()?t.play():t.pause()})}const sn=e=>Math.min(1,Math.max(0,e));function nn({player:e,value:t,onDraggingChange:i}){const s=gi(null),n=gi(!1),r=t=>{const i=s.current?.getBoundingClientRect();if(!i||!i.width)return;const n=sn((t-i.left)/i.width);e.muted()&&n>0&&e.muted(!1),e.volume(n)},a=()=>{n.current=!1,i(!1)},o=Math.round(100*sn(t));return ss("div",{ref:s,className:"vp2-volume__slider",role:"slider",tabIndex:-1,"data-vp2-focus":"volume-slider","aria-label":e.localize("Volume"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":o,"aria-valuetext":`${o}%`,onPointerDown:e=>{e.preventDefault(),n.current=!0,i(!0);try{e.currentTarget.setPointerCapture?.(e.pointerId)}catch{}e.currentTarget.focus?.(),r(e.clientX)},onPointerMove:e=>{n.current&&r(e.clientX)},onPointerUp:a,onPointerCancel:a,onKeyDown:t=>{let i=0;"ArrowLeft"===t.key||"ArrowDown"===t.key?i=-.1:"ArrowRight"!==t.key&&"ArrowUp"!==t.key||(i=.1),i&&(t.preventDefault(),t.stopPropagation(),e.muted()&&e.muted(!1),e.volume(sn(e.volume()+i)))}},ss("div",{className:"vp2-volume__slider-track"},ss("div",{className:"vp2-volume__slider-fill",style:{width:`${o}%`}}),ss("div",{className:"vp2-volume__slider-knob",style:{left:`${o}%`}})))}function rn({store:e,player:t}){const{volume:i,muted:s}=os(e),[n,r]=di(!1),[a,o]=di(!1),[l,c]=di(!1),u=n||a||l;let d=3;s||0===i?d=0:i<.33?d=1:i<.66&&(d=2);const h=s?t.localize("Unmute"):t.localize("Mute");return ss("div",{className:"vp2-volume vjs-control vjs-volume-panel"+(u?" vp2-volume--expanded":""),onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>o(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o(!1)}},ss(Ts,{className:`vjs-mute-control vjs-vol-${d}`,icon:ss(Ls,null),label:h,shortcut:"m",focusName:"volume",onClick:()=>t.muted(!t.muted())}),ss(nn,{player:t,value:s?0:i,onDraggingChange:c}))}function an(e){const[t,i]=di(!1);return mi(()=>{if(!t)return;e.current;const s=requestAnimationFrame(()=>i(!1));return()=>cancelAnimationFrame(s)},[t,e]),[t,()=>i(!0)]}function on({store:e,player:t}){const{currentTime:i,duration:s,timeDisplayMode:r}=os(e),a="remaining"===r,o=gi(null),[l,c]=an(o),u=a?t.localize("Show elapsed time"):t.localize("Show remaining time"),d=a&&Number.isFinite(s)?`-${n.default.time.formatTime(Math.max(s-i,0),Math.min(s,600))}`:n.default.time.formatTime(i,s);return ss("button",{type:"button",className:"vp2-button vp2-pill vp2-time vjs-control vjs-button"+(a?" vp2-time--remaining":""),"aria-label":u,"data-vp2-focus":"time",onClick:()=>{e.setTimeDisplayMode(a?"elapsed":"remaining"),c()}},ss("span",{key:r,ref:o,className:"vjs-current-time"+(l?" vp2-time__current--entering":"")},d),ss("span",{className:"vjs-time-divider"}," / "),ss("span",{className:"vjs-duration"},n.default.time.formatTime(s,s)))}function ln({store:e}){const{chapters:t,currentChapter:i,openPanel:s}=os(e);if(!t.length)return null;const n=i?.text??t[0].text,r="chapters"===s;return ss("button",{type:"button",className:"vp2-button vp2-pill vjs-control vjs-button vp-chapter-text-button","aria-expanded":r,"aria-haspopup":"true","data-vp2-focus":"chapter",onClick:()=>e.setOpenPanel(r?null:"chapters")},ss("span",{className:"vp2-chapter-pill__text"},n),ss(Hs,{size:16}))}function cn({store:e,player:t}){const{captionsAvailable:i,captionsActive:s}=os(e);return i?ss(Ts,{className:"vjs-captions-toggle-button"+(s?" vjs-captions-on":""),icon:ss(s?Rs:Os,null),label:t.localize("Captions"),pressed:s,focusName:"captions",onClick:()=>ze(t)}):null}function un({store:e,player:t}){const{openPanel:i}=os(e),s="settings"===i;return ss(Ts,{className:"vjs-settings-menu-button",icon:ss(Us,null),label:t.localize("Settings"),expanded:s,hasPopup:!0,focusName:"settings",onClick:()=>e.setOpenPanel(s?null:"settings")})}function dn({player:e}){const t=window.WebKitPlaybackTargetAvailabilityEvent?e.el().querySelector("video"):null,[i,s]=di(!1),[n,r]=di(()=>Boolean(t?.webkitCurrentPlaybackTargetIsWireless));pi(()=>
2{if(!t)return;const i=e=>{s("available"===e.availability)},n=()=>{const i=!!t.webkitCurrentPlaybackTargetIsWireless;r(i),e.trigger("cast-session-changed",{casting:i,platform:"airplay"})};return t.addEventListener("webkitplaybacktargetavailabilitychanged",i),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",n),()=>{t.removeEventListener("webkitplaybacktargetavailabilitychanged",i),t.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",n)}},[e,t]);const a=!!t&&(i||n);return pi(()=>{e.trigger("vp2-chrome-rendered")},[e,a]),a?ss(Ts,{className:"vjs-airplay-button"+(n?" vjs-airplay-on":""),icon:ss(Bs,null),label:e.localize("AirPlay"),pressed:n,focusName:"airplay",onClick:()=>t.webkitShowPlaybackTargetPicker()}):null}function hn({player:e}){const[t,i]=di(!1),[s,n]=di(()=>e.hasClass("vjs-casting"));pi(()=>{const t=(e,t)=>{"chromecast"===t?.platform&&i(!!t.available)},s=(e,t)=>{"chromecast"===t?.platform&&n(!!t.casting)};return e.on("cast-availability-changed",t),e.on("cast-session-changed",s),()=>{e.off("cast-availability-changed",t),e.off("cast-session-changed",s)}},[e]);const r=t||s;if(pi(()=>{e.trigger("vp2-chrome-rendered")},[e,r]),!r)return null;const a=s?e.localize("Stop casting"):e.localize("Play on TV");return ss(Ts,{className:"vjs-cast-button"+(s?" vjs-cast-connected":""),icon:ss(Fs,null),label:a,pressed:s,focusName:"cast",onClick:()=>e.cast?.()?.toggleCast?.()})}function pn({store:e,player:t}){const{pipAvailable:i,isPip:s}=os(e);if(!i)return null;const n=s?t.localize("Exit Picture-in-Picture"):t.localize("Picture-in-Picture");return ss(Ts,{className:"vjs-picture-in-picture-control",icon:ss(s?qs:js,null),label:n,pressed:s,focusName:"pip",onClick:()=>s?t.exitPictureInPicture():t.requestPictureInPicture()})}function mn({store:e,player:t}){const{isFullscreen:i}=os(e),s=i?t.localize("Exit full screen"):t.localize("Full screen");return ss(Ts,{className:"vjs-fullscreen-control",icon:ss(Ms,null),label:s,shortcut:"f",focusName:"fullscreen",onClick:()=>i?t.exitFullscreen():t.requestFullscreen()})}function gn(e){const t=e.filter(e=>!e.isConnected||null!==e.offsetParent);return t.length>0?t:e}const fn=['[role="menuitem"]','[role="menuitemradio"]','[role="radio"]','input[type="range"]',"button.vp2-panel__header","button.vp2-panel__header-back","button.vp2-panel__header-action","button.vp2-panel__reset","a.vp2-powered-by"].join(",");function yn(e){return e?gn([...e.querySelectorAll(fn)].filter(e=>!e.disabled&&!e.closest('[aria-hidden="true"]')&&!e.closest("[hidden]"))):[]}function _n(e,t){t&&(yn(e).forEach(e=>{e.tabIndex=e===t?0:-1}),t.focus())}const vn=["Enter"," ","ArrowLeft","ArrowRight"];function bn({store:e,player:t,panel:i,anchorFocusName:s,label:n,onEscapeBack:r,view:a,children:o}){const l=gi(null),c=gi(null),u=gi(null),[d,h]=di(!1),{onKeyDown:p}=function(e,t){return{onKeyDown:i=>{const{key:s}=i;if("ArrowUp"!==s&&"ArrowDown"!==s&&"Home"!==s&&"End"!==s)return;if(t?.addClass?.("videopress-keyboard-navigation"),i.target instanceof HTMLInputElement&&"range"===i.target.type&&("Home"===s||"End"===s))return void i.stopPropagation();const n=e.current,r=yn(n);if(!r.length)return;i.stopPropagation(),i.preventDefault();const a=r.indexOf(i.target.closest?i.target.closest(fn):null);let o;o="Home"===s?0:"End"===s?r.length-1:-1===a?"ArrowDown"===s?0:r.length-1:(a+("ArrowDown"===s?1:-1)+r.length)%r.length,_n(n,r[o])}}}(u,t),m=gi(r);m.current=r;const g=()=>e.setOpenPanel(null),f=gi(g);return f.current=g,mi(()=>{const e=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(e)},[]),mi(()=>{const e=()=>{const e=c.current;if(!e)return;const i=t.el().querySelector(`[data-vp2-focus="${s}"]`),n=parseFloat(getComputedStyle(e).getPropertyValue("--vp2-side-inset")),r=Number.isFinite(n)?n:12;if(!i)return void(e.style.right=`${r}px`);const a=t.el().getBoundingClientRect(),o=i.getBoundingClientRect(),l=a.right-o.right;e.style.right=`${Math.max(l,r)}px`};return e(),t.on(["playerresize","fullscreenchange"],e),()=>t.off(["playerresize","fullscreenchange"],e)},[t,s]),pi(()=>{if(!d||!u.current)return;const e=u.current,t=e.querySelector("[data-vp2-autofocus]")||e.querySelector('[role="menuitem"], [role="menuitemradio"]');t&&_n(e,t)},[d]),pi(()=>{const e=e=>{const t=e.target;t instanceof Element&&(c.current&&c.current.contains(t)||t.closest('[data-vp2-focus="settings"], [data-vp2-focus="chapter"]')||t.closest(".vjs-tech")||t.closest(".vp2-endscreen")||f.current())},t=()=>f.current();return document.addEventListener("pointerdown",e,!0),window.addEventListener("blur",t),()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("blur",t)}},[]),pi(()=>{const e=e=>{if("Escape"!==e.key)"Tab"===e.key&&f.current();else{if(m.current&&m.current())return;f.current()}};
2return t.on("keydown",e),()=>t.off("keydown",e)},[t]),pi(()=>{const e=l.current;return()=>{const i=document.activeElement;e&&i&&e.contains(i)&&t.el().querySelector(`[data-vp2-focus="${s}"]`)?.focus()}},[t,s]),ss("div",{className:"vp2-panel-layer",ref:l},ss("div",{className:"vp2-panel__backdrop","aria-hidden":"true"}),ss("div",{className:"vp2-panel"+(d?" vp2-panel--open":""),"data-vp2-panel":i,"data-vp2-view":a,role:"dialog","aria-label":n,ref:c},ss("div",{className:"vp2-panel__grip","aria-hidden":"true"}),ss("div",{className:"vp2-panel__title","aria-hidden":"true"},n),ss("button",{type:"button",className:"vp2-panel__close","aria-label":t.localize("Close"),onClick:()=>f.current()},ss(Ys,{size:20})),ss("div",{className:"vp2-panel__body",ref:u,onKeyDown:e=>{p(e),vn.includes(e.key)&&e.stopPropagation()}},o)))}function Tn({role:e,icon:t,label:i,value:s,note:n,badge:r,checked:a,disabled:o,chevron:l,reserveCheck:c,className:u,onSelect:d,autoFocusWhenChecked:h,children:p}){return ss("button",{type:"button",role:e,className:"vp2-panel__row"+(u?` ${u}`:""),"aria-checked":"menuitemradio"===e?!!a:void 0,"aria-haspopup":l?"true":void 0,disabled:o,tabIndex:-1,"data-vp2-autofocus":h&&a?"":void 0,onClick:d},c&&ss("span",{className:"vp2-panel__row-check","aria-hidden":"true"},a&&ss(Vs,{size:20})),t&&ss("span",{className:"vp2-panel__row-icon","aria-hidden":"true"},t),p,ss("span",{className:"vp2-panel__row-label"},i),n&&ss("span",{className:"vp2-panel__row-note"},n),r&&ss("span",{className:"vp2-panel__badge"},r),s&&ss("span",{className:"vp2-panel__row-value"},s),l&&ss(Hs,{size:16}))}function Sn({player:e,title:t,onBack:i,action:s}){return s?ss("div",{className:"vp2-panel__header vp2-panel__header--split"},ss("button",{type:"button",className:"vp2-panel__header-back","aria-label":e.localize("Back"),tabIndex:-1,onClick:i},ss(zs,{size:20}),ss("span",{className:"vp2-panel__header-title"},t)),s):ss("button",{type:"button",className:"vp2-panel__header","aria-label":e.localize("Back"),tabIndex:-1,onClick:i},ss(zs,{size:20}),ss("span",{className:"vp2-panel__header-title"},t))}function Cn({store:e,player:t,onBack:i}){const{playbackRates:s,playbackRate:n}=os(e),r=e=>t.localize(e);return ss(ns,null,ss(Sn,{player:t,title:r("Playback speed"),onBack:i}),ss("div",{role:"menu","aria-label":r("Playback speed")},s.map(t=>ss(Tn,{key:t,role:"menuitemradio",reserveCheck:!0,checked:t===n,autoFocusWhenChecked:!0,label:Mn(t,r),onSelect:()=>{e.setPlaybackRate(t),e.setOpenPanel(null)}}))))}function wn({store:e,player:t,onBack:i}){const{qualityLevels:s,quality:n,autoQualityLabel:r}=os(e),a=t=>{e.setQuality(t),e.setOpenPanel(null)},o=s.find(e=>"adaptive"===e.internalName),l=s.filter(e=>"adaptive"!==e.internalName);return ss(ns,null,ss(Sn,{player:t,title:t.localize("Quality"),onBack:i}),ss("div",{role:"menu","aria-label":t.localize("Quality")},o&&ss(Tn,{role:"menuitemradio",reserveCheck:!0,label:o.name,note:r||void 0,checked:"adaptive"===n,autoFocusWhenChecked:!0,onSelect:()=>a("adaptive")}),l.map(e=>{return ss(Tn,{key:e.internalName,role:"menuitemradio",reserveCheck:!0,label:e.name,badge:(t=e.verticalLines,t>=2160?"4K":t>=720?"HD":void 0),checked:e.internalName===n,disabled:!e.ready,className:e.ready?void 0:"videopress-quality-transcoding",autoFocusWhenChecked:!0,onSelect:()=>a(e.internalName)});var t})))}function kn({store:e,player:t,onBack:i,onOpenStyling:s}){const{captionTracks:n}=os(e),r=n.some(e=>e.showing),a=t=>{e.setCaptionTrack(t),e.setOpenPanel(null)};return ss(ns,null,ss(Sn,{player:t,title:t.localize("Subtitles/CC"),onBack:i,action:Ve(t)&&ss("button",{type:"button",className:"vp2-panel__header-action","aria-label":t.localize("Caption styling"),"aria-haspopup":"true",tabIndex:-1,onClick:s},ss(Ks,{size:20}))}),ss("div",{role:"menu","aria-label":t.localize("Subtitles/CC")},ss(Tn,{role:"menuitemradio",reserveCheck:!0,label:t.localize("Off"),checked:!r,autoFocusWhenChecked:!0,onSelect:()=>a(null)}),n.map(e=>ss(Tn,{key:e.language,role:"menuitemradio",reserveCheck:!0,label:e.label,checked:e.showing,autoFocusWhenChecked:!0,onSelect:()=>a(e.language)}))))}const En=[{value:.5,label:"S"},{value:1,label:"M"},{value:1.5,label:"L"},{value:2,label:"XL"}],xn=e=>{const{key:t}=e;if("ArrowLeft"!==t&&"ArrowRight"!==t)return;const i=[...e.currentTarget.querySelectorAll('[role="radio"]')],s=e.target instanceof Element?e.target.closest('[role="radio"]'):null,n=i.indexOf(s);if(-1===n)return;e.stopPropagation(),e.preventDefault();const r=i[(n+("ArrowRight"===t?1:-1)+i.length)%i.length];s.tabIndex=-1,r.tabIndex=0,r.focus(),r.click()};function In({label:e,options:t,current:i,onPick:s}){return ss("div",{className:"vp2-caption-style__section"},ss("span",{className:"vp2-caption-style__label"},e),ss("div",{className:"vp2-seg",role:"radiogroup","aria-label":e,tabIndex:-1,onKeyDown:xn},t.map(e=>ss("button",{key:String(e.value),type:"button",role:"radio",className:"vp2-seg__option","aria-checked":e.value===i,tabIndex:-1,onClick:()=>s(e.value)},e.label))))}function An({color:e,label:t,checked:i,none:s,onPick:n}){return ss("button",{type:"button",role:"radio",className:`vp2-swatch${s?" vp2-swatch--none":""}${i?" vp2-swatch--selected":""}`,"aria-checked":i,"aria-label":t,tabIndex:-1,style:s?void 0:{backgroundColor:e},onClick:n})}function Pn({player:e,onBack:t}){const i=e.getChild("textTrackSettings"),[s,n]=di(()=>i?i.getValues():{}),r=s.backgroundOpacity??"1",a=gi("0"===r?"1":r);if(!i)return null;const o="0"===s.backgroundOpacity,l=Math.round(100*parseFloat(s.backgroundOpacity??"1")),c=e=>
2{i.updateValues(e);const t=i.getValues();t.backgroundOpacity&&"0"!==t.backgroundOpacity&&(a.current=t.backgroundOpacity),n(t)},u=e=>{const t={backgroundColor:e};o&&(t.backgroundOpacity=a.current),c(t)},d=[{value:"#FFF",label:e.localize("White")},{value:"#FF0",label:e.localize("Yellow")},{value:"#0F0",label:e.localize("Green")},{value:"#0FF",label:e.localize("Cyan")},{value:"#00F",label:e.localize("Blue")},{value:"#F0F",label:e.localize("Magenta")},{value:"#F00",label:e.localize("Red")},{value:"#000",label:e.localize("Black")}],h=[{value:"none",label:e.localize("None")},{value:"dropshadow",label:e.localize("Shadow")},{value:"uniform",label:e.localize("Outline")}];return ss(ns,null,ss(Sn,{player:e,title:e.localize("Caption styling"),onBack:t}),ss("div",{className:"vp2-caption-style",role:"group","aria-label":e.localize("Caption styling")},ss(In,{label:e.localize("Text size"),options:En,current:Number(s.fontPercent??1),onPick:e=>c({fontPercent:e})}),ss("div",{className:"vp2-caption-style__section"},ss("span",{className:"vp2-caption-style__label"},e.localize("Text color")),ss("div",{className:"vp2-caption-style__swatches",role:"radiogroup","aria-label":e.localize("Text color"),tabIndex:-1,onKeyDown:xn},d.map(e=>ss(An,{key:e.value,color:e.value,label:e.label,checked:e.value===(s.color??"#FFF"),onPick:()=>c({color:e.value})})))),ss("div",{className:"vp2-caption-style__section"},ss("span",{className:"vp2-caption-style__label"},e.localize("Background")),ss("div",{className:"vp2-caption-style__swatches",role:"radiogroup","aria-label":e.localize("Background"),tabIndex:-1,onKeyDown:xn},ss(An,{color:"#000",label:e.localize("Black"),checked:!o&&"#000"===(s.backgroundColor??"#000"),onPick:()=>u("#000")}),ss(An,{color:"#FFF",label:e.localize("White"),checked:!o&&"#FFF"===s.backgroundColor,onPick:()=>u("#FFF")}),ss(An,{none:!0,label:e.localize("None"),checked:o,onPick:()=>c({backgroundOpacity:"0"})}))),ss("div",{className:"vp2-caption-style__section"},ss("span",{className:"vp2-caption-style__label"},e.localize("Opacity")),ss("input",{type:"range",className:"vp2-panel__slider",min:"0",max:"100",step:"1",value:l,style:{"--vp2-slider-fill":`${l}%`},disabled:o,"aria-label":e.localize("Opacity"),"aria-valuetext":`${l}%`,onChange:e=>c({backgroundOpacity:String(Number(e.currentTarget.value)/100)})})),ss(In,{label:e.localize("Edge style"),options:h,current:s.edgeStyle??"none",onPick:e=>c({edgeStyle:e})}),ss("button",{type:"button",className:"vp2-panel__reset",tabIndex:-1,onClick:()=>{i.setDefaults(),i.saveSettings(),i.updateDisplay(),a.current="1",n(i.getValues())}},e.localize("Reset"))))}const Dn=["M38.0203 6.0536C39.279 6.0536 40.385 6.8849 40.7297 8.09007L44.1374 20.0064C44.1408 20.0185 44.1464 20.0295 44.1536 20.0391L48.1907 6.0536H50.4492H56.6922C61.068 6.0536 64.0012 8.88765 64.0012 13.1781C64.0012 17.5177 60.991 20.2238 56.4999 20.2238H53.5378H49.7209L48.9794 22.5087C48.3144 24.5579 46.3979 25.9464 44.2347 25.9464C42.0715 25.9464 40.1551 24.5579 39.49 22.5087L35.3397 9.71996C34.7519 7.90897 36.1085 6.0536 38.0203 6.0536ZM51.1005 15.9727H55.4228C57.2981 15.9727 58.4233 14.9001 58.4233 13.1781C58.4233 11.4462 57.2981 10.4227 55.4228 10.4227H52.9017L51.1005 15.9727Z","M79.5277 20.4681C79.8196 19.608 80.0287 18.9965 80.155 18.6335C80.2891 18.2627 80.5653 17.5091 80.9835 16.3728L83.9188 8.50195H86.9843L80.7941 24.3384H78.1902L72 8.50195H75.0892L78.0245 16.3728C78.4427 17.5091 78.7149 18.2627 78.8412 18.6335C78.9753 18.9965 79.1884 19.608 79.4803 20.4681H79.5277Z","M88.3459 12.8694H91.151V24.3384H88.3459V12.8694ZM88.2749 7.2H91.222V10.2418H88.2749V7.2Z","M98.762 22.3973C99.0382 22.3973 99.2986 22.3618 99.5432 22.2908C99.7957 22.2198 100.032 22.1251 100.253 22.0068C100.474 21.8884 100.668 21.7582 100.833 21.6162C101.007 21.4741 101.153 21.3361 101.271 21.2019V15.7574C100.94 15.4891 100.569 15.2682 100.159 15.0946C99.7483 14.9131 99.3143 14.8223 98.8567 14.8223C98.5647 14.8223 98.257 14.8815 97.9335 14.9999C97.6179 15.1182 97.3259 15.3194 97.0576 15.6035C96.7972 15.8876 96.5763 16.2821 96.3948 16.7871C96.2212 17.2921 96.1344 17.9352 96.1344 18.7164C96.1344 19.8684 96.3554 20.7679 96.7972 21.415C97.247 22.062 97.9019 22.3894 98.762 22.3973ZM93.2346 18.8347C93.2346 17.8326 93.3727 16.941 93.6489 16.1598C93.9251 15.3707 94.2999 14.7119 94.7733 14.1832C95.2546 13.6466 95.803 13.2482 96.4185 12.9878C97.034 12.7195 97.6731 12.5853 98.3359 12.5853C98.6436 12.5853 98.9356 12.613 99.2118 12.6682C99.4879 12.7234 99.7483 12.7984 99.9929 12.8931C100.238 12.9878 100.466 13.0943 100.679 13.2127C100.892 13.331 101.09 13.4533 101.271 13.5796H101.295C101.287 13.4218 101.279 13.2008 101.271 12.9168C101.271 12.6248 101.271 12.3092 101.271 11.9699V7.2H104.076V20.9297C104.076 21.6872 104.084 22.3382 104.1 22.8826C104.116 23.4271 104.132 23.9123 104.147 24.3384H101.614L101.496 23.1193H101.449C101.283 23.3166 101.082 23.5099 100.845 23.6993C100.616 23.8887 100.36 24.0544 100.076 24.1964C99.7996 24.3305 99.4919 24.4371 99.1526 24.516C98.8212 24.5949 98.4582 24.6343 98.0637 24.6343C97.4403 24.6343 96.8406 24.5239 96.2646 24.3029C95.6965 24.082 95.1836 23.7427 94.726 23.285C94.2762 22.8195 93.9132 22.2159 93.637 21.4741C93.3688 20.7245 93.2346 19.8447 93.2346 18.8347Z","M112.764 22.3737C113.309 22.3737 113.877 22.3184 114.469 22.208C115.061 22.0975 115.66 21.9397 116.268 21.7345V23.9715C115.905 24.1293 115.349 24.2793 114.599 24.4213C113.849 24.5633 113.072 24.6343 112.267 24.6343C111.455 24.6343 110.681 24.5318
2109.947 24.3266C109.222 24.1136 108.586 23.7743 108.042 23.3087C107.497 22.8432 107.063 22.2395 106.74 21.4978C106.424 20.7561 106.266 19.8566 106.266 18.7992C106.266 17.7577 106.416 16.8463 106.716 16.0651C107.016 15.2839 107.418 14.6369 107.923 14.124C108.428 13.6111 109.005 13.2284 109.652 12.9759C110.306 12.7155 110.981 12.5853 111.675 12.5853C112.401 12.5853 113.068 12.6958 113.676 12.9168C114.291 13.1377 114.82 13.4849 115.262 13.9583C115.712 14.4318 116.059 15.0433 116.303 15.7929C116.556 16.5346 116.682 17.4144 116.682 18.4323C116.674 18.8268 116.662 19.1622 116.647 19.4384H109.131C109.17 19.967 109.289 20.4207 109.486 20.7995C109.683 21.1703 109.94 21.4741 110.255 21.7109C110.579 21.9397 110.953 22.1093 111.38 22.2198C111.806 22.3224 112.267 22.3737 112.764 22.3737ZM111.64 14.775C111.285 14.775 110.969 14.8421 110.693 14.9762C110.417 15.1025 110.176 15.28 109.971 15.5088C109.774 15.7298 109.616 15.9902 109.498 16.29C109.379 16.5898 109.3 16.9094 109.261 17.2487H113.77C113.77 16.9094 113.723 16.5898 113.628 16.29C113.542 15.9902 113.407 15.7298 113.226 15.5088C113.052 15.28 112.831 15.1025 112.563 14.9762C112.303 14.8421 111.995 14.775 111.64 14.775Z","M126.838 18.6098C126.838 18.0023 126.767 17.4657 126.625 17.0002C126.483 16.5346 126.285 16.144 126.033 15.8284C125.78 15.5128 125.477 15.2761 125.122 15.1182C124.767 14.9604 124.38 14.8815 123.962 14.8815C123.551 14.8815 123.169 14.9604 122.814 15.1182C122.466 15.2761 122.167 15.5128 121.914 15.8284C121.662 16.144 121.464 16.5346 121.322 17.0002C121.18 17.4657 121.109 18.0023 121.109 18.6098C121.109 19.2174 121.18 19.754 121.322 20.2195C121.464 20.6851 121.662 21.0757 121.914 21.3913C122.174 21.699 122.478 21.9357 122.825 22.1014C123.18 22.2593 123.567 22.3382 123.985 22.3382C124.404 22.3382 124.786 22.2593 125.133 22.1014C125.481 21.9357 125.78 21.699 126.033 21.3913C126.285 21.0757 126.483 20.6851 126.625 20.2195C126.767 19.754 126.838 19.2174 126.838 18.6098ZM129.738 18.6098C129.738 19.5094 129.603 20.33 129.335 21.0717C129.067 21.8134 128.68 22.4486 128.175 22.9773C127.678 23.506 127.075 23.9163 126.364 24.2082C125.654 24.4923 124.861 24.6343 123.985 24.6343C123.086 24.6343 122.277 24.4923 121.559 24.2082C120.849 23.9163 120.245 23.506 119.748 22.9773C119.251 22.4486 118.8
268 21.8134 118.6 21.0717C118.34 20.33 118.209 19.5094 118.209 18.6098C118.209 17.7103 118.344 16.8897 118.612 16.148C118.88 15.4062 119.263 14.7711 119.76 14.2424C120.265 13.7137 120.872 13.3073 121.583 13.0233C122.293 12.7313 123.086 12.5853 123.962 12.5853C124.861 12.5853 125.666 12.7313 126.376 13.0233C127.094 13.3073 127.702 13.7137 128.199 14.2424C128.696 14.7711 129.075 15.4062 129.335 16.148C129.603 16.8897 129.738 17.7103 129.738 18.6098Z","M136.473 18.2074C136.212 18.2074 135.956 18.2035 135.703 18.1956C135.451 18.1877 135.214 18.1719 134.993 18.1482V24.3384H132.093V8.50195H136.662C137.427 8.50195 138.094 8.53746 138.662 8.60847C139.238 8.6716 139.751 8.77023 140.201 8.90437C141.282 9.23578 142.115 9.76445 142.698 10.4904C143.282 11.2163 143.574 12.1395 143.574 13.26C143.574 14.0254 143.416 14.7158 143.101 15.3313C142.785 15.9389 142.324 16.4557 141.716 16.8818C141.108 17.3079 140.367 17.6353 139.491 17.8642C138.615 18.093 137.609 18.2074 136.473 18.2074ZM134.993 15.71C135.159 15.7337 135.368 15.7534 135.621 15.7692C135.881 15.7771 136.149 15.7811 136.425 15.7811C137.207 15.7811 137.861 15.7179 138.39 15.5917C138.919 15.4654 139.345 15.2918 139.668 15.0709C139.992 14.8421 140.225 14.5698 140.367 14.2542C140.509 13.9307 140.58 13.5796 140.58 13.2008C140.58 12.7353 140.473 12.3328 140.26 11.9936C140.047 11.6543 139.676 11.3899 139.148 11.2005C138.871 11.1059 138.528 11.0388 138.118 10.9993C137.715 10.952 137.218 10.9283 136.627 10.9283H134.993V15.71Z","M152.629 15.0946H152.393C151.532 15.0946 150.775 15.2248 150.12 15.4852C149.473 15.7377 148.972 16.1282 148.617 16.6569V24.3384H145.812V12.8694H148.132L148.392 14.4673H148.439C148.771 13.8834 149.224 13.4257 149.8 13.0943C150.384 12.755 151.083 12.5853 151.895 12.5853C152.179 12.5853 152.424 12.6011 152.629 12.6327V15.0946Z","M159.708 22.3737C160.252 22.3737 160.82 22.3184 161.412 22.208C162.004 22.0975 162.603 21.9397 163.211 21.7345V23.9715C162.848 24.1293 162.292 24.2793 161.542 24.4213C160.793 24.5633 160.015 24.6343 159.211 24.6343C158.398 24.6343 157.624 24.5318 156.891 24.3266C156.165 24.1136 155.53 23.7743 154.985 23.3087C154.441 22.8432 154.007 22.2395 153.683 21.4978C153.367 20.7561 153.21 19.8566 153.21 18.7992C153.21 17.7577 153.36 16.8463 153.659 16.0651C153.959 15.2839 154.362 14.6369 154.867 14.124C155.372 13.6111 155.948 13.2284 156.595 12.9759C157.25 12.7155 157.924 12.5853 158.619 12.5853C159.345 12.5853 160.011 12.6958 160.619 12.9168C161.234 13.1377 161.763 13.4849 162.205 13.9583C162.655 14.4318 163.002 15.0433 163.247 15.7929C163.499 16.5346 163.625 17.4144 163.625 18.4323C163.617 18.8268 163.606 19.1622 163.59 19.4384H156.074C156.113 19.967 156.232 20.4207 156.429 20.7995C156.626 21.1703 156.883 21.4741 157.198 21.7109C157.522 21.9397 157.897 22.1093 158.323 22.2198C158.749 22.3224 159.211 22.3737 159.708 22.3737ZM158.583 14.775C158.228 14.775 157.912 14.8421 157.636 14.9762C157.36 15.1025 157.119 15.28 156.914 15.5088C156.717 15.7298 156.559 15.9902 156.441 16.29C156.323 16.5898 156.244 16.9094 156.204 17.2487H160.714C160.714 16.9094 160.666 16.5898 160.572 16.29C160.485 15.9902 160.351 15.7298 160.169 15.5088C159.996 15.28 159.775 15.1025 159.506 14.9762C159.246 14.8421 158.938 14.775 158.583 14.775Z","M170.822 21.0125C170.822 20.7679 170.751 20.5667 170.609 20.4089C170.475 20.2511 170.293 20.1209 170.065 20.0183C169.836 19.9078 169.571 19.8132 169.272 19.7343C168.98 19.6553 168.672 19.5764 168.348 19.4975C167.938 19.3871 167.543 19.2608 167.165 19.1188C166.786 18.9689 166.451 18.7755 166.159 18.5388C165.875 18.3021 165.646 18.0062 165.472 17.6511C165.306 17.2882 165.224 16.8463 165.224 16.3255C165.224 15.6864 165.338 15.134 165.567 14.6685C165.796 14.195 166.103 13.8045 166.49 13.4967C166.885 13.189 167.338 12.9602 167.851 12.8102C168.372 12.6603 168.92 12.5853 169.496 12.5853C170.199 12.5853 170.858 12.6445 171.473 12.7629C172.088 12.8734 172.645 13.0193 173.142 13.2008V15.4852C172.881 15.3984 172.605 15.3195 172.313 15.2484C172.029 15.1695 171.737 15.1025 171.437 15.0472C171.146 14.992 170.854 14.9486 170.562 14.917C170.27 14.8776 169.994 14.8578 169.733 14.8578C169.402 14.8578 169.122 14.8894 168.893 14.9525C168.664 15.0157 168.479 15.1025 168.336 15.2129C168.194 15.3155 168.092 15.4378 168.029 15.5798C167.966 15.714 167.934 15.856 167.934 16.0059C167.934 16.2663 168.001 16.4794 168.135 16.6451C168.277 16.8108 168.471 16.9449 168.715 17.0475C168.96 17.1501 169.216 17.2369 169.485 17.3079C169.753 17.371 170.013 17.4341 170.266 17.4973C170.66 17.592 171.055 17.7064 171.449 17.8405C171.844 17.9746 172.199 18.164 172.515 18.4086C172.83 18.6453 173.087 18.957 173.284 19.3437C173.489 19.7224 173.592 20.2077 173.592 20.7995C173.592 21.4465 173.469 22.0107 173.225 22.492C172.98 22.9734 172.637 23.3758 172.195 23.6993C171.761 24.0149 171.236 24.2477 170.621 24.3976C170.013 24.5554 169.343 24.6343 168.609 24.6343C167.883 24.6343 167.228 24.5752 166.644 24.4568C166.068 24.3463 165.591 24.2043 165.212 24.0307V21.77C165.827 21.9989 166.395 22.1567 166.916 22.2435C167.437 22.3224 167.922 22.3618 168.372 22.3618C168.719 22.3618 169.043 22.3382 169.343 22.2908C169.642 22.2356 169.899 22.1527 170.112 22.0423C170.333 21.9318 170.506 21.7937 170.633 21.628C170.759 21.4544 170.822 21.2493 170.822 21.0125Z","M180.611 21.0125C180.611 20.7679 180.54 20.5667 180.398 20.4089C180.264 20.2511 180.082 20.1209 179.853 20.0183C179.624 19.9078 179.36 19.8132 179.06 19.7343C178.768 19.6553 178.461 19.5764 178.137 19.4975C177.727 19.3871 177.332 19.2608 176.954 19.1188C1
276.575 18.9689 176.239 18.7755 175.947 18.5388C175.663 18.3021 175.435 18.0062 175.261 17.6511C175.095 17.2882 175.012 16.8463 175.012 16.3255C175.012 15.6864 175.127 15.134 175.356 14.6685C175.584 14.195 175.892 13.8045 176.279 13.4967C176.673 13.189 177.127 12.9602 177.64 12.8102C178.161 12.6603 178.709 12.5853 179.285 12.5853C179.987 12.5853 180.646 12.6445 181.262 12.7629C181.877 12.8734 182.434 13.0193 182.931 13.2008V15.4852C182.67 15.3984 182.394 15.3195 182.102 15.2484C181.818 15.1695 181.526 15.1025 181.226 15.0472C180.934 14.992 180.642 14.9486 180.35 14.917C180.058 14.8776 179.782 14.8578 179.522 14.8578C179.191 14.8578 178.91 14.8894 178.682 14.9525C178.453 15.0157 178.267 15.1025 178.125 15.2129C177.983 15.3155 177.881 15.4378 177.818 15.5798C177.754 15.714 177.723 15.856 177.723 16.0059C177.723 16.2663 177.79 16.4794 177.924 16.6451C178.066 16.8108 178.259 16.9449 178.504 17.0475C178.749 17.1501 179.005 17.2369 179.273 17.3079C179.542 17.371 179.802 17.4341 180.055 17.4973C180.449 17.592 180.844 17.7064 181.238 17.8405C181.633 17.9746 181.988 18.164 182.303 18.4086C182.619 18.6453 182.875 18.957 183.073 19.3437C183.278 19.7224 183.38 20.2077 183.38 20.7995C183.38 21.4465 183.258 22.0107 183.014 22.492C182.769 22.9734 182.426 23.3758 181.984 23.6993C181.55 24.0149 181.025 24.2477 180.41 24.3976C179.802 24.5554 179.131 24.6343 178.398 24.6343C177.672 24.6343 177.017 24.5752 176.433 24.4568C175.857 24.3463 175.379 24.2043 175.001 24.0307V21.77C175.616 21.9989 176.184 22.1567 176.705 22.2435C177.226 22.3224 177.711 22.3618 178.161 22.3618C178.508 22.3618 178.831 22.3382 179.131 22.2908C179.431 22.2356 179.688 22.1527 179.901 22.0423C180.122 21.9318 180.295 21.7937 180.421 21.628C180.548 21.4544 180.611 21.2493 180.611 21.0125Z"];function Ln({player:e,surface:t,tabIndex:i,onKeyDown:s}){return ss("a",{className:"vp2-powered-by",href:`https://videopress.com/?ref=powered-by-${t}`,target:"_blank",rel:"noopener noreferrer","aria-label":`${e.localize("Powered by")} VideoPress`,tabIndex:i,onKeyDown:s},ss("span",null,e.localize("Powered by")),ss("svg",{className:"vp2-powered-by__mark",viewBox:"35 6 149 20","aria-hidden":"true",focusable:"false"},Dn.map((e,t)=>ss("path",{key:t,fillRule:"evenodd",fill:"currentColor",d:e}))))}function Mn(e,t){return 1===e?t("Normal"):`${e}Ã`}function Nn(e,t){return"adaptive"===e.quality?e.autoQualityLabel?`${t("Auto")} (${e.autoQualityLabel})`:t("Auto"):e.qualityLevels.find(t=>t.internalName===e.quality)?.name??""}function On(e,t){return e.captionTracks.find(e=>e.showing)?.label??t("Off")}function Rn({store:e,player:t}){const i=os(e),s=e=>t.localize(e),[n,r]=di(["root"]),[a,o]=di(null),l=gi(null),c=gi(!1),u=n[n.length-1],d=e=>{o({from:u,direction:"push",entering:!0}),r(t=>[...t,e])},h=()=>!(n.length<2||(o({from:u,direction:"pop",entering:!0}),r(e=>e.slice(0,-1)),0));mi(()=>{if(!a)return;const e=l.current;if(a.entering){if(e){const t=e.querySelector("[data-vp2-exiting]");e.style.height=`${(t||e).offsetHeight}px`}const t=requestAnimationFrame(()=>o(e=>e&&e.entering?{...e,entering:!1}:e));return()=>cancelAnimationFrame(t)}if(e){const t=e.querySelector(".vp2-panel__view:not([data-vp2-exiting])");t&&(e.style.height=`${t.offsetHeight}px`)}const t=setTimeout(()=>{l.current&&(l.current.style.height=""),o(null)},200);return()=>clearTimeout(t)},[a]),mi(()=>{if(!c.current)return void(c.current=!0);const e=l.current,t=e?.querySelector(".vp2-panel__view:not([data-vp2-exiting])");if(!t)return;const i=t.querySelector("[data-vp2-autofocus]")||yn(t)[0];i&&_n(e,i)},[u]);const p=e=>{const t=e.target;if("ArrowRight"===e.key&&"root"===u){const i=t instanceof Element&&t.closest('[role="menuitem"]');return void(i&&(e.stopPropagation(),e.preventDefault(),i.click()))}if("ArrowLeft"===e.key&&"root"!==u){if(t instanceof Element&&t.closest('input[type="range"], [role="radio"]'))return;e.stopPropagation(),e.preventDefault(),h()}},m=(n,{exiting:r}={})=>{const o=["vp2-panel__view"];r?o.push("push"===a.direction?"vp2-panel__view--exit-left":"vp2-panel__view--exit-right"):a?.entering&&o.push("push"===a.direction?"vp2-panel__view--enter-right":"vp2-panel__view--enter-left");const l="root"===n;return ss("div",{key:n,className:o.join(" "),role:l?"menu":void 0,"aria-label":l?s("Settings"):void 0,"aria-hidden":r?"true":void 0,"data-vp2-exiting":r?"":void 0,onKeyDown:r?void 0:p},(n=>{switch(n){case"speed":return ss(Cn,{store:e,player:t,onBack:h});case"quality":return ss(wn,{store:e,player:t,onBack:h});case"subtitles":return ss(kn,{store:e,player:t,onBack:h,onOpenStyling:()=>d("captionStyle")}
2);case"captionStyle":return ss(Pn,{player:t,onBack:h});default:return ss(ns,null,ss(Tn,{role:"menuitem",chevron:!0,icon:ss(Ws,null),label:s("Playback speed"),value:Mn(i.playbackRate,s),onSelect:()=>d("speed")}),ss(Tn,{role:"menuitem",chevron:!0,icon:ss(Gs,null),label:s("Quality"),value:Nn(i,s),onSelect:()=>d("quality")}),i.captionsAvailable&&ss(Tn,{role:"menuitem",chevron:!0,icon:ss(Xs,null),label:s("Subtitles/CC"),value:On(i,s),onSelect:()=>d("subtitles")}))}})(n))};return ss(bn,{store:e,player:t,panel:"settings",anchorFocusName:"settings",label:s("Settings"),onEscapeBack:h,view:u},ss("div",{className:"vp2-panel__stage",ref:l},a&&m(a.from,{exiting:!0}),m(u)),i.brandingEnabled&&ss(Ln,{player:t,surface:"settings",tabIndex:-1,onKeyDown:p}))}function Un({store:e,player:t}){const{chapters:i,currentChapter:s,duration:r,openPanel:a}=os(e);return pi(()=>{i.length||"chapters"!==a||e.setOpenPanel(null)},[i.length,a,e]),i.length?ss(bn,{store:e,player:t,panel:"chapters",anchorFocusName:"chapter",label:t.localize("Chapters")},ss("div",{role:"menu",tabIndex:-1,"aria-label":t.localize("Chapters"),className:"vp2-chapters-panel"},i.map(i=>{const a=i.id===s?.id;return ss(Tn,{key:i.id,role:"menuitemradio",className:"vp-chapter-menu-item",checked:a,autoFocusWhenChecked:!0,label:ss(ns,null,ss("span",{className:"vp2-panel__row-time"},n.default.time.formatTime(i.startTime,r)),ss("span",{className:"vp2-panel__row-title"},i.text)),onSelect:()=>{t.currentTime(i.startTime),e.setOpenPanel(null)}})}))):null}function Bn({store:e,player:t}){const{openPanel:i}=os(e);return i?Hi(ss("settings"===i?Rn:Un,{store:e,player:t}),t.el()):null}function Fn({store:e,player:t}){return ss("div",{className:"vp2-dock"},ss(tn,{store:e,player:t}),ss(rn,{store:e,player:t}),ss(on,{store:e,player:t}),ss(ln,{store:e,player:t}),ss("div",{className:"vp2-dock__spacer","aria-hidden":"true"}),ss(cn,{store:e,player:t}),ss(un,{store:e,player:t}),ss(dn,{player:t}),ss(hn,{player:t}),ss(pn,{store:e,player:t}),ss(mn,{store:e,player:t}),ss(Bn,{store:e,player:t}))}function jn({store:e,player:t}){const i=gi(null),s=t.controlBar?.getChild("progressControl")?.el()??null;return ss(ls.Provider,{value:()=>i.current},s&&Hi(ss(_s,{store:e,player:t,progressEl:s}),s),ss("div",{className:"vp2-float",ref:i}),ss("div",{className:"vp2-deadzone","aria-hidden":"true"}),ss(Fn,{store:e,player:t}))}const qn=encodeURIComponent,$n=e=>e?"video.wordpress.com":"videopress.com";function Hn({at:e,loop:t,autoplay:i}={}){const s=[];return"number"==typeof e&&isFinite(e)&&s.push(`at=${e}`),t&&s.push("loop=1"),i&&s.push("autoPlay=1"),s.length>0?`?${s.join("&")}`:""}function zn(e){const t=String(e??"").trim();if(/^\d+$/.test(t))return parseInt(t,10);const i=t.match(/^(\d+):([0-5]?\d)$/);if(i)return 60*parseInt(i[1],10)+parseInt(i[2],10);const s=t.match(/^(\d+):([0-5]?\d):([0-5]?\d)$/);return s?3600*parseInt(s[1],10)+60*parseInt(s[2],10)+parseInt(s[3],10):null}function Vn(e){const t="number"==typeof e&&isFinite(e)?Math.max(0,Math.floor(e)):0,i=e=>String(e).padStart(2,"0"),s=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return s>0?`${s}:${i(n)}:${i(r)}`:`${n}:${i(r)}`}const Wn=[{id:"x",label:"X",url:({url:e,title:t})=>`https://x.com/intent/post?url=${qn(e)}${t?`&text=${qn(t)}`:""}`},{id:"facebook",label:"Facebook",url:({url:e})=>`https://www.facebook.com/sharer/sharer.php?u=${qn(e)}`},{id:"tumblr",label:"Tumblr",url:({url:e,title:t})=>`https://www.tumblr.com/widgets/share/tool?canonicalUrl=${qn(e)}${t?`&title=${qn(t)}`:""}`},{id:"whatsapp",label:"WhatsApp",url:({url:e,title:t})=>`https://wa.me/?text=${qn(t?`${t} ${e}`:e)}`},{id:"threads",label:"Threads",url:({url:e,title:t})=>`https://www.threads.net/intent/post?text=${qn(t?`${t} ${e}`:e)}`},{id:"bluesky",label:"Bluesky",url:({url:e,title:t})=>`https://bsky.app/intent/compose?text=${qn(t?`${t} ${e}`:e)}`},{id:"reddit",label:"Reddit",url:({url:e,title:t})=>`https://www.reddit.com/submit?url=${qn(e)}${t?`&title=${qn(t)}`:""}`}];let Gn=!1;const Xn={x:e=>ss(Ss,e,ss("path",{fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M3.5 3h5.15l4.12 5.72L17.65 3h2.83l-6.42 7.52L21 21h-5.15l-4.6-6.38L5.8 21H3l6.96-8.17L3.5 3Zm3.62 2 9.77 14h1.99L9.11 5H7.12Z"})),facebook:e=>ss(Ss,e,ss("path",{fill:"currentColor",stroke:"none",d:"M13.7 21v-8h2.75l.42-3.2H13.7V7.75c0-.92.26-1.55 1.62-1.55H17V3.34A22.8 22.8 0 0 0 14.55 3C12.12 3 10.5 4.48 10.5 7.2v2.6H7.75V13h2.75v8h3.2Z"})),whatsapp:e=>ss(Ss,e,ss("path",{fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M12 2.75a9.1 9.1 0 0 0-7.82 13.76L3 21.25l4.87-1.28A9.1 9.1 0 1 0 12 2.75Zm0 2a7.1 7.1 0 0 1 0 14.2 7.03 7.03 0 0 1-3.55-.96l-.68-.4-2.03.54.53-1.98-.44-.7A7.1 7.1 0 0 1 12 4.75Zm-3.16 3c-.18
20-.47.07-.72.34-.25.27-.95.93-.95 2.27 0 1.35.98 2.65 1.12 2.83.14.18 1.9 2.9 4.65 4.07 2.3.98 2.77.79 3.27.74.5-.04 1.62-.66 1.85-1.3.23-.64.23-1.18.16-1.3-.07-.11-.25-.18-.53-.32l-1.9-.88c-.25-.09-.43-.14-.61.14-.18.27-.7.88-.86 1.06-.16.18-.32.2-.59.07-.28-.14-1.16-.43-2.21-1.36a8.2 8.2 0 0 1-1.53-1.9c-.16-.28-.02-.43.12-.57.12-.12.27-.32.41-.48.14-.16.18-.27.27-.45.1-.18.05-.34-.02-.48l-.86-2.08c-.23-.55-.46-.47-.63-.48h-.46Z"})),threads:e=>ss(Ss,e,ss("path",{fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M12.12 2.75c-5.52 0-9.02 3.44-9.02 9.18 0 5.65 3.42 9.32 8.72 9.32 4.72 0 7.88-2.55 7.88-6.2 0-2.26-1.12-3.9-3.13-4.76-.2-3.32-2.06-5.22-5.14-5.22-2.3 0-4.12 1.13-5.02 3.1l2.13.84c.53-1.18 1.48-1.8 2.85-1.8 1.66 0 2.55.82 2.75 2.34a13.7 13.7 0 0 0-2.14-.16c-3.6 0-5.71 1.53-5.71 4.16 0 2.33 1.85 3.98 4.52 3.98 2.99 0 5.17-1.86 5.7-4.82.63.48.94 1.22.94 2.26 0 2.42-2.18 4.08-5.48 4.08-4.02 0-6.54-2.78-6.54-7.12 0-4.4 2.55-7.04 6.76-7.04 3.47 0 5.76 1.7 6.64 4.94l2.2-.58c-1.14-4.2-4.27-6.5-8.9-6.5Zm-1.17 12.64c-1.42 0-2.33-.72-2.33-1.84 0-1.28 1.17-1.96 3.38-1.96.76 0 1.47.07 2.1.2-.28 2.18-1.46 3.6-3.15 3.6Z"})),bluesky:e=>ss(Ss,e,ss("path",{fill:"currentColor",stroke:"none",d:"M12 10.35C10.82 8.05 7.6 3.75 4.58 2.35 1.69 1.02 2.08 5.02 2.72 7.18c.52 1.78 2.45 2.37 4.22 2.1-3.08.52-5.82 1.8-2.23 5.8 3.95 4.4 5.42-.94 7.29-3.65 1.87 2.71 3.34 8.05 7.29 3.65 3.59-4-1.15-5.28-4.23-5.8 1.77.27 3.7-.32 4.22-2.1.64-2.16 1.03-6.16-1.86-4.83C14.4 3.75 13.18 8.05 12 10.35Z"})),reddit:e=>ss(Ss,e,ss("path",{fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M20.8 12.1c0-1.1-.9-2-2-2-.54 0-1.04.22-1.4.57-1.27-.8-2.97-1.3-4.85-1.38l.92-4.3 3 .64a1.8 1.8 0 1 0 .3-1.42l-3.7-.79a.72.72 0 0 0-.85.55l-1.12 5.27c-1.78.13-3.38.62-4.58 1.4a2 2 0 1 0-2.14 3.28c-.04.25-.06.5-.06.76 0 3 3.44 5.43 7.68 5.43s7.68-2.43 7.68-5.43c0-.24-.02-.48-.06-.72.7-.32 1.18-1.03 1.18-1.85Zm-12.63 1.78a1.3 1.3 0 1 1 2.6 0 1.3 1.3 0 0 1-2.6 0Zm5.06 0a1.3 1.3 0 1 1 2.6 0 1.3 1.3 0 0 1-2.6 0Zm-4.15 2.72a.7.7 0 0 1 .98-.08c.5.43 1.15.63 1.94.63s1.44-.2 1.94-.63a.7.7 0 1 1 .9 1.06c-.77.65-1.72.97-2.84.97-1.12 0-2.07-.32-2.84-.97a.7.7 0 0 1-.08-.98Z"})),tumblr:e=>ss(Ss,e,ss("path",{fill:"currentColor",stroke:"none",d:"M14.5 21c-3.6 0-5.5-1.88-5.5-5.05V10H6.5V6.8c2.78-.96 3.94-3.34 4.08-5.3h3.12v4.8h4.05V10H13.7v5.18c0 1.57.8 2.1 2.08 2.1.67 0 1.33-.18 1.72-.38v3.55c-.65.3-1.76.55-3 .55Z"}))};function Kn({player:e,title:t,shareLink:i,onEmbed:s,onTarget:n}){const r=gi(!0),[a,o]=di(Gn),l=!Gn&&!a&&"undefined"!=typeof navigator&&"function"==typeof navigator.share;pi(()=>()=>{r.current=!1},[]);const c=(e,t)=>{"AbortError"!==e?.name&&(Gn=!0,r.current&&(function(e){const t=document.activeElement;if(!e||t!==e&&!e.contains(t))return;const i=e.closest(".vp2-sheet"),s=[i?.querySelector(".vp2-copy__pill:not([disabled])"),i?.querySelector(".vp2-sheet__close:not([disabled])")].filter(Boolean).filter(e=>!e.closest("[hidden]")&&!e.closest('[aria-hidden="true"]')),n=s.filter(e=>!e.isConnected||null!==e.offsetParent);(n[0]??s[0])?.focus()}(t),o(!0)))};return ss(ns,null,ss("div",{className:"vp2-targets"},ss("button",{type:"button",className:"vp2-target vp2-target--embed","data-target":"embed",onClick:()=>{n("embed"),s()}},ss("span",{className:"vp2-target__disc"},ss(Zs,{size:24})),ss("span",{className:"vp2-target__label"},e.localize("Embed"))),Wn.map(e=>{const s=Xn[e.id];return ss("a",{key:e.id,className:`vp2-target vp2-target--${e.id}`,"data-target":e.id,href:e.url({url:i,title:t}),target:"_blank",rel:"noopener noreferrer",onClick:()=>n(e.id)},ss("span",{className:"vp2-target__disc"},ss(s,{size:24})),ss("span",{className:"vp2-target__label"},e.label))})),l&&ss("button",{type:"button",className:"vp2-share-to","data-target":"share-to",onClick:e=>(e=>{n("share-to");try{Promise.resolve(navigator.share({title:t||void 0,url:i})).catch(t=>c(t,e))}catch(t){c(t,e)}})(e.currentTarget)},ss(Qs,{size:20}),ss("span",null,e.localize("Share toâ¦"))))}function Yn({player:e,value:t,copyTarget:i}){const[s,n]=di(!1),r=gi(null),a=gi(!0);return pi(()=>()=>{a.current=!1,clearTimeout(r.current)},[]),ss("button",{type:"button",className:"vp2-copy__pill",onClick:async()=>{e.trigger("videopress-share-target",{target:i});let s=!1;
2try{s=await async function(e){if(navigator?.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return function(e){const t=document.createElement("div");t.style.position="absolute",t.style.left="-1000px",t.style.width="0px",t.style.height="0px",t.innerText=e,document.body.appendChild(t);const i=document.createRange(),s=window.getSelection();i.selectNode(t),s?.addRange(i);let n=!1;try{n=!!document.execCommand("copy")}catch{n=!1}return s?.removeAllRanges(),document.body.removeChild(t),n}(e)}(t)}catch{}s&&a.current&&(clearTimeout(r.current),n(!0),r.current=setTimeout(()=>{r.current=null,n(!1)},2e3))},"aria-live":"polite"},ss("span",null,s?e.localize("Copied"):e.localize("Copy")),s&&ss(Vs,{size:16}))}function Qn({player:e,value:t,copyTarget:i,ariaLabel:s}){return ss("div",{className:"vp2-copy"},ss("input",{type:"text",className:"vp2-copy__text",value:t,"aria-label":s,readOnly:!0,onFocus:e=>e.currentTarget.select()}),ss(Yn,{player:e,value:t,copyTarget:i}))}function Zn({player:e,currentTime:t,options:i,onChange:s,idPrefix:n}){const r=`${n}-at`,a=i.atText??Vn(t),o=null===zn(a);return ss("div",{className:"vp2-options__opt vp2-options__opt--at"},ss("input",{id:r,type:"checkbox",checked:!!i.at,onChange:e=>s({at:e.currentTarget.checked})}),ss("label",{htmlFor:r},e.localize("Start at")),ss("input",{type:"text",className:"vp2-options__time",inputMode:"numeric",value:a,"aria-label":e.localize("Start time"),"aria-invalid":o||void 0,onChange:e=>{const t=e.currentTarget.value,i=zn(t);s(null!==i?{atSeconds:i,atText:t}:{atText:t})}}))}function Jn({player:e,currentTime:t,options:i,onChange:s}){const n=vi(),r=`vp2-options-loop-${n}`,a=`vp2-options-autoplay-${n}`,o=e.localize("Link options");return ss("div",{className:"vp2-options vp2-options--row",role:"group","aria-label":o},ss(Zn,{player:e,currentTime:t,options:i,onChange:s,idPrefix:`vp2-options-${n}`}),ss("div",{className:"vp2-options__opt vp2-options__opt--loop"},ss("input",{id:r,type:"checkbox",checked:!!i.loop,onChange:e=>s({loop:e.currentTarget.checked})}),ss("label",{htmlFor:r},e.localize("Loop"))),ss("div",{className:"vp2-options__opt vp2-options__opt--autoplay"},ss("input",{id:a,type:"checkbox",checked:!!i.autoplay,onChange:e=>s({autoplay:e.currentTarget.checked})}),ss("label",{htmlFor:a},e.localize("Autoplay"))))}function er({player:e,embedCode:t,currentTime:i,options:s,onChange:n,onBack:r}){const a=vi(),o=`vp2-embed-controls-${a}`,l=e.localize("Embed options");return ss("div",{className:"vp2-sheet__step vp2-sheet__step--embed vp2-embed"},ss("div",{className:"vp2-sheet__step-header"},ss("button",{type:"button",className:"vp2-sheet__back","aria-label":e.localize("Back"),onClick:r},ss(zs,{size:20})),ss("span",{className:"vp2-sheet__step-title"},e.localize("Embed video"))),ss("pre",{className:"vp2-embed__code"},ss("code",null,t)),ss("div",{className:"vp2-options vp2-options--stack",role:"group","aria-label":l},ss(Zn,{player:e,currentTime:i,options:s,onChange:n,idPrefix:`vp2-embed-${a}`}),ss("div",{className:"vp2-options__opt vp2-options__opt--controls"},ss("input",{id:o,type:"checkbox",checked:!!s.controls,onChange:e=>n({controls:e.currentTarget.checked})}),ss("label",{htmlFor:o},ss("span",{className:"vp2-options__label vp2-options__label--full"},e.localize("Show player controls")),ss("span",{className:"vp2-options__label vp2-options__label--short"},e.localize("Controls"))))),ss("div",{className:"vp2-embed__actions"},ss(Yn,{player:e,value:t,copyTarget:"copy-embed"})))}const tr=new Set(["ArrowLeft","ArrowRight"]);function ir({store:e,player:t}){const i=os(e),s=i.shareDialog.data,n=i.videoInfo?.title??"",r=fi(()=>u(n),[n]),a=function(e){return e?`${e}${e.includes("?")?"&":"?"}w=96`:null}(i.videoInfo?.poster??""),o=e=>t.localize(e),l=gi(null),c=gi(null),d=gi(null),h=gi(null),p=gi(null);null===p.current&&(p.current=function(){const e=new Set;let t=!1;const i=()=>{t&&(window.removeEventListener("keyup",s,!0),window.removeEventListener("blur",n),t=!1)},s=t=>{e.has(t.key)&&(t.stopPropagation(),e.delete(t.key),0===e.size&&i())},n=()=>{e.clear(),i()};return{record(i){e.add(i),t||(window.addEventListener("keyup",s,!0),window.addEventListener("blur",n),t=!0)},removeIfIdle(){0===e.size&&i()}}}());const[m,g]=di(!1),[f,y]=di("share"),[_,v]=di(()=>({at:!1,atSeconds:s.currentTime,atText:Vn(s.currentTime),loop:!1,autoplay:!1,controls:!0})),{onKeyDown:b}=function(e){return{onKeyDown:yi(t=>{if("Tab"!==t.key||!e.current)return;const i=gn([...e.current.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not
2([tabindex="-1"])')].filter(e=>!e.closest("[hidden]")&&!e.closest('[aria-hidden="true"]')));if(0===i.length)return;const s=i[0],n=i[i.length-1],r=document.activeElement,a=i.indexOf(r);if(t.shiftKey&&(r===s||-1===a))return t.preventDefault(),void n.focus();t.shiftKey||r!==n&&-1!==a||(t.preventDefault(),s.focus())},[e])}}(c),T=function({guid:e,isPrivate:t,at:i,loop:s,autoplay:n}){const r=Hn({at:i,loop:s,autoplay:n});return`https://${$n(t)}/v/${e}${r}`}({guid:s.guid,isPrivate:s.isPrivate,at:_.at?_.atSeconds:void 0,loop:_.loop,autoplay:_.autoplay}),S=function(e,t){return t?e:e.replace(/src="(https:\/\/[^"]*\/embed\/[^"]*)"/,(e,t)=>`src="${t}${t.includes("?")?"&":"?"}controls=0"`)}(function({guid:e,isPrivate:t,at:i,loop:s,autoplay:n}){const r=Hn({at:i,loop:s,autoplay:n});return`<iframe width="560" height="315" src="https://${$n(t)}/embed/${e}${r}" loading="lazy" frameborder="0" allowfullscreen allow="clipboard-write; presentation; web-share"></iframe>\n<script src="${t?"https://video.wordpress.com/wp-content/plugins/video/assets/js/next/videopress-iframe.js":"https://videopress.com/videopress-iframe.js"}" async><\/script>`}({guid:s.guid,isPrivate:s.isPrivate,at:_.at?_.atSeconds:void 0}),_.controls),C=()=>e.closeShareDialog(),w=e=>t.trigger("videopress-share-target",{target:e});mi(()=>{const e=document.activeElement;d.current=e&&t.el().contains(e)?e:null,c.current?.focus();const i=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(i)},[]),pi(()=>{const e=l.current;return()=>{const i=document.activeElement;if(!e||!i||!e.contains(i))return;const s=d.current,n=s&&s.isConnected&&t.el().contains(s)?s:t.el().querySelector(".vjs-share-ui-button");n?.focus()}},[t]),pi(()=>()=>{null!==h.current&&cancelAnimationFrame(h.current),p.current?.removeIfIdle()},[]);const k=e=>{null!==h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const t=c.current;if(!t)return;const i=e.map(e=>t.querySelector(e)).filter(Boolean),s=i.filter(e=>!e.isConnected||null!==e.offsetParent);(s[0]??i[0])?.focus()})},E=()=>{y("embed"),k([".vp2-sheet__back"])};return ss("div",{className:"vp2-share-layer",ref:l},ss("div",{className:"videopress-share-dialog"+(m?" vp2-sheet-backdrop--open":""),onClick:e=>{e.target===e.currentTarget&&C()}},ss("div",{className:`vp2-sheet${!s.canDisplayEmbed&&s.canDisplayDownload?" vp2-sheet--download-only":""}${m?" vp2-sheet--open":""}`,"data-vp2-sheet":"share","data-vp2-step":f,role:"dialog","aria-modal":"true","aria-label":o("embed"===f?"Embed video":"Share video"),tabIndex:-1,ref:c,onKeyDown:e=>{if(tr.has(e.key)&&p.current.record(e.key),e.stopPropagation(),"Escape"===e.key)return e.preventDefault(),void C();b(e)},onKeyPress:e=>e.stopPropagation()},ss("div",{className:"vp2-sheet__grip","aria-hidden":"true"}),ss("button",{type:"button",className:"vp2-sheet__close","aria-label":o("Close"),onClick:C},ss(Ys,{size:20})),s.canDisplayEmbed&&"embed"===f?ss(er,{player:t,embedCode:S,currentTime:s.currentTime,options:_,onChange:e=>v(t=>({...t,...e})),onBack:()=>{y("share"),k([".vp2-target--embed",".vp2-embed-open"])}}):ss("div",{className:"vp2-sheet__step vp2-sheet__step--share"},ss("div",{className:"vp2-sheet__header"},ss("div",{className:"vp2-sheet__title"},ss(Qs,{size:20}),ss("span",null,o("Share video")))),r&&ss("div",{className:"vp2-sheet__chip"},a&&ss("img",{className:"vp2-sheet__thumb",src:a,alt:""}),ss("span",{className:"vp2-sheet__video-title"},r)),s.isPrivate&&ss("div",{className:"vp2-sheet__private"},ss(en,{size:20}),ss("span",null,o("This video is private. Only people with access to the site can view it."))),s.canDisplayEmbed&&ss(ns,null,!s.isPrivate&&ss(Kn,{player:t,title:r,shareLink:T,onEmbed:E,onTarget:w}),ss(Qn,{player:t,value:T,copyTarget:"copy-link",ariaLabel:o("Video link")}),ss(Jn,{player:t,currentTime:s.currentTime,options:_,onChange:e=>v(t=>({...t,...e}))}),ss("button",{type:"button",className:"vp2-embed-open"+(s.isPrivate?" vp2-embed-open--standalone":""),onClick:()=>{w("embed"),E()}},ss(Zs,{size:20}),ss("span",null,o("Embed on your site")))),s.canDisplayDownload&&ss("a",{className:"vp2-sheet__download",href:s.downloadUrl,download:!0,target:"_blank",rel:"noopener",onClick:()=>w("download")},ss(Js,{size:20}),ss("span",null,o("Download this video"))),i.brandingEnabled&&ss(Ln,{player:t,surface:"share"})))))}function sr({store:e,player:t}){const{shareDialog:i}=os(e);return i.open&&i.data?Hi(ss(ir,{store:e,player:t}),t.el()):null}function nr({store:e,player:t}){const i=os(e),s=i.videoInfo?.title??"",n=fi(()=>u(s),[s]),r=!!i.shareDialog?.open;return n?ss("div",{className:"vp2-title-inner"+(r?" vp2-title--suppressed":"")},ss("div",{className:"vp2-title"},n)):null}function rr({store:e,player:t}){const i=os(e),[s,n]=di(!1),r=gi(null),a=gi(null),o=gi({panel:!1});mi(()=>{const e=r.current;t.addClass("videopress-ended-screen"),t.el().contains(document.activeElement)&&a.current?.focus(),t.trigger("vp2-chrome-rendered");const i=requestAnimationFrame(()=>n(!0));return()=>{cancelAnimationFrame(i);const s=document.activeElement;e&&s&&e.contains(s)&&t.el().querySelector('[data-vp2-focus="play"]')?.focus(),t.removeClass("videopress-ended-screen"),t.trigger("vp2-chrome-rendered")}},[t]);const l=e=>{t.currentTime(0),t.play(),t.trigger("videopress-endscreen-action",{action:e})},c=e=>{" "===e.key&&e.stopPropagation()},u=i.canDisplayEmbed||i.canDisplayDownload,d=i.canDisplayDownload&&i.videoInfo?.original,h=gi(!1),p=r.current;h.current=!!p&&p.contains(p.ownerDocument.activeElement);const m=gi(!1);return mi(()=>
2{if(!m.current)return void(m.current=!0);const e=r.current;h.current&&e&&!e.contains(e.ownerDocument.activeElement)&&a.current?.focus(),t.trigger("vp2-chrome-rendered")},[t,u,d]),ss("div",{ref:r,className:"vp2-endscreen"+(s?" vp2-endscreen--open":""),role:"group","aria-label":t.localize("Video ended"),onPointerDown:()=>{o.current={panel:!!e.getSnapshot().openPanel}},onClick:t=>{t.target===t.currentTarget&&(o.current.panel?e.setOpenPanel(null):l("backdrop-replay"))}},ss("button",{type:"button",className:"vp2-endscreen__replay","data-vp2-focus":"endscreen-replay",ref:a,onKeyDown:c,onClick:()=>l("replay")},ss("span",{className:"vp2-endscreen__disc vp2-endscreen__disc--replay"},ss(As,{size:40})),ss("span",{className:"vp2-endscreen__label"},t.localize("Replay"))),u&&ss("button",{type:"button",className:"vp2-endscreen__share","data-vp2-focus":"endscreen-share",onKeyDown:c,onClick:()=>{e.openShareDialog(),t.trigger("videopress-endscreen-action",{action:"share"})}},ss("span",{className:"vp2-endscreen__disc vp2-endscreen__disc--share"},ss(Qs,{size:24})),ss("span",{className:"vp2-endscreen__label"},t.localize("Share"))),d&&ss("a",{className:"vp2-endscreen__download","data-vp2-focus":"endscreen-download",href:i.videoInfo.original,download:!0,target:"_blank",rel:"noopener noreferrer",onKeyDown:c,onClick:()=>t.trigger("videopress-endscreen-action",{action:"download"})},ss(Js,{size:16})," ",t.localize("Download")))}function ar({store:e,player:t}){const i=os(e);return i.endScreenEnabled&&i.ended&&!t.loop()?ss(rr,{store:e,player:t}):null}function or({player:e}){const[t,i]=di(null),s=gi(null),[n,r]=an(s),[a]=di(()=>e.hasClass("vjs-touch-enabled"));pi(()=>{if(a)return;let t=e.hasStarted(),s=t,n=-1/0,o=-1/0,l=0,c=null;const u=()=>{s=t},d=()=>{s=!1,i(null)},h=()=>s&&Date.now()-n>=500,p=()=>{o=Date.now()},m=e=>{"VIDEO"===e.target.tagName&&p()},g=e=>{" "!==e.key&&"k"!==e.key.toLowerCase()||p()},f=({type:e})=>{h()&&Date.now()-o<=250&&(o=-1/0,clearTimeout(c),c=setTimeout(()=>{c=null,h()&&(l+=1,i({id:l,glyph:e,out:!1}),r())},30))},y=()=>{t=!0,u()},_=()=>{n=Date.now(),u()},v=e.el();return v.addEventListener("click",m,!0),v.addEventListener("keydown",g,!0),e.on(["play","pause"],f),e.one("play",y),e.on(["seeking","ended","loadstart"],d),e.on("seeked",_),()=>{clearTimeout(c),v.removeEventListener("click",m,!0),v.removeEventListener("keydown",g,!0),e.off(["play","pause"],f),e.off("play",y),e.off(["seeking","ended","loadstart"],d),e.off("seeked",_)}},[e,a]);const o=t?.id??null;if(pi(()=>{if(null===o)return;const e=setTimeout(()=>i(e=>e&&{...e,out:!0}),420),t=setTimeout(()=>i(null),770);return()=>{clearTimeout(e),clearTimeout(t)}},[o]),!t)return null;const l="pause"===t.glyph?xs:Es;let c="in";return n?c="enter":t.out&&(c="out"),ss("div",{key:t.id,className:`vp2-play-feedback vp2-play-feedback--${c}`,"data-vp2-glyph":t.glyph,"aria-hidden":"true"},ss("div",{className:"vp2-play-feedback__disc",ref:s},ss(l,null)))}function lr({store:e,player:t}){const{waiting:i}=os(e);return i?ss("div",{className:"vp2-waiting",role:"status","aria-live":"polite","aria-label":t.localize("Loadingâ¦")},ss("span",{className:"vp2-waiting__spinner","aria-hidden":"true"})):null}function cr({store:e,player:t}){const i=os(e),s=t.controlBar?.el()??null;pi(()=>{t.trigger("vp2-chrome-rendered")},[i.chapters,i.captionsAvailable]);const n=t.getChild("TitleOverlay")?.el()??null,r=t.getChild("EndScreen")?.el()??null,a=t.getChild("PlayPauseAnimation")?.el()??null;return ss("div",{className:"vp2-chrome__layer","data-vp2-has-started":String(!!i.hasStarted)},ss(lr,{store:e,player:t}),s&&Hi(ss(jn,{store:e,player:t}),s),n&&Hi(ss(nr,{store:e,player:t}),n),r&&Hi(ss(ar,{store:e,player:t}),r),a&&Hi(ss(or,{player:t}),a),ss(sr,{store:e,player:t}))}const ur=n.default.getComponent("Component");class dr extends ur{createEl(){return n.default.dom.createEl("div",{className:"vp2-contract-shim"})}}function hr(e,{endScreen:t=!0,title:i=!0,branding:s=!0}={}){const n=function(e,{endScreenEnabled:t=!0,brandingEnabled:i=!0}={}){const s=new Set,n=[];let r=null,a={chrome:"v2",paused:e.paused(),hasStarted:e.hasStarted(),ended:e.ended(),endScreenEnabled:!!t,brandingEnabled:!!i,waiting:!1,currentTime:e.currentTime(),duration:e.duration()||0,bufferedPercent:e.bufferedPercent(),volume:e.volume(),muted:e.muted(),isFullscreen:e.isFullscreen(),isPip:!1,userActive:e.userActive(),videoInfo:null,quality:null,chapters:[],currentChapter:null,canDisplayEmbed:!1,canDisplayDownload:!1,shareDialog:{o
2pen:!1,data:null},pipAvailable:!!document.pictureInPictureEnabled,openPanel:null,timeDisplayMode:V()??"elapsed",captionsAvailable:!1,captionsActive:!1,playbackRate:e.playbackRate()||1,playbackRates:e.playbackRates(),qualityLevels:[],autoQualityLabel:"",captionTracks:[]};const o=e=>{Object.keys(e).some(t=>a[t]!==e[t])&&(a={...a,...e},s.forEach(e=>e()))},l=t=>{o({openPanel:t??null}),e.toggleClass("videopress-settings-open","settings"===t),e.toggleClass("videopress-chapters-menu-open","chapters"===t)},c=(t,i)=>{e.on(t,i),n.push([t,i])};let u=!1;const d=e=>{u||o(e)};c("play",()=>d({paused:e.paused(),ended:!1})),c("pause",()=>d({paused:e.paused()})),c("firstplay",()=>o({hasStarted:!0})),c("ended",()=>d({ended:!0,waiting:!1})),c("seeked",()=>o({ended:e.ended()})),c("timeupdate",()=>o({currentTime:e.currentTime()})),c(["durationchange","loadedmetadata"],()=>o({duration:e.duration()||0})),c("progress",()=>o({bufferedPercent:e.bufferedPercent()})),c("volumechange",()=>o({volume:e.volume(),muted:e.muted()})),c("fullscreenchange",()=>o({isFullscreen:e.isFullscreen()})),c("enterpictureinpicture",()=>o({isPip:!0})),c("leavepictureinpicture",()=>o({isPip:!1})),c(["useractive","userinactive"],()=>o({userActive:e.userActive()})),c("waiting",()=>o({waiting:!0})),c(["playing","canplay","canplaythrough","ended"],()=>o({waiting:!1})),c("ratechange",()=>o({playbackRate:e.playbackRate()}));let h=null,p=null;const m=()=>{clearTimeout(h),h=setTimeout(()=>{o({autoQualityLabel:he(a.qualityLevels,e.qualityLevels())})},200)};"function"==typeof e.qualityLevels&&(p=e.qualityLevels(),p.on("change",m));const g=()=>{const t=qe(e);o({captionsAvailable:t.length>0,captionsActive:$e(e),captionTracks:t.map(e=>({language:e.language,label:e.label,showing:"showing"===e.mode}))})},f=e.textTracks(),y=["addtrack","removetrack","change"];let _;y.forEach(e=>f.addEventListener(e,g)),c("refresh-subs-caps-button",g);let v=null;const b=()=>{o({videoInfo:r.state.videoInfo??null,canDisplayEmbed:!!r.state.canDisplayEmbed,canDisplayDownload:!!r.state.canDisplayDownload,chapters:r.getChapters(),currentChapter:r.getCurrentChapter()}),(()=>{const t=r.state.videoInfo??null;if(t===_)return;if(_=t,v&&(v(),v=null),!t?.file_url_base||!t?.format_meta)return void((a.qualityLevels.length||a.autoQualityLabel)&&o({qualityLevels:[],autoQualityLabel:""}));const i=ce(t,{localize:t=>e.localize(t),persistedQuality:q()});i.some(e=>!e.ready)&&(v=me(e,t,i));const s={qualityLevels:i};if("function"==typeof e.qualityLevels&&(s.autoQualityLabel=he(i,e.qualityLevels())),null===a.quality){const t=ue(i,e.src());t&&(s.quality=t.internalName)}o(s)})()},T=(e,t)=>o({quality:t?.quality??null}),S=e=>{e&&!r&&(r=e,r.on("statechanged",b),r.on("source-set",T),b())},C=(e,t)=>S(t.instance);e.one("pluginsetup:director",C),e.usingPlugin&&e.usingPlugin("director")&&S(e.director());const w=()=>{n.forEach(([t,i])=>e.off(t,i)),n.length=0,e.off("pluginsetup:director",C),y.forEach(e=>f.removeEventListener(e,g)),clearTimeout(h),p&&(p.off("change",m),p=null),v&&(v(),v=null),r&&(r.off("statechanged",b),r.off("source-set",T),r=null),s.clear()};return e.on("dispose",w),{getSnapshot:()=>a,subscribe:e=>(s.add(e),()=>s.delete(e)),holdPlaybackState:()=>{u=!0},releasePlaybackState:()=>{u=!1,o({paused:e.paused(),ended:e.ended()})},setShareDialog:({open:e,data:t}={})=>{e&&l(null),o({shareDialog:{open:!!e,data:t??null}})},openShareDialog:()=>r?.trigger("share-dialog-open"),closeShareDialog:()=>{r?r.trigger("share-dialog-close"):o({shareDialog:{open:!1,data:null}})},setPlaybackRate:t=>e.playbackRate(t),setQuality:e=>{r&&!r.isChangingSrc()&&r.trigger("toggle-source",{quality:e})},setCaptionTrack:t=>function(e,t){qe(e).forEach(e=>{e.mode=null!==t&&e.language===t?"showing":"disabled"})}(e,t),setOpenPanel:t=>{t&&e.hasClass("videopress-controls-disabled")||l(t)},setTimeDisplayMode:e=>{o({timeDisplayMode:e}),function(e){z.includes(e)&&Q("timeDisplayMode",e)}(e)},dispose:w}}(e,{endScreenEnabled:t,brandingEnabled:s});e.vp2Store=n;const r=function(e){const t=()=>{const t=e.isFullscreen(),i=e.currentHeight();e.toggleClass("vp2-compact",!t&&i<=240),e.toggleClass("vp2-short",!t&&i<=180),e.toggleClass("vp2-menu-takeover",!t&&i<320),e.toggleClass("vp2-takeover-tight",!t&&i<260)};return t(),e.on(as,t),()=>e.off(as,t)}(e),a=new dr(e,{name:"PlayPauseAnimation"});a.addClass("vp2-play-feedback-layer"),e.addChild(a);const o=new dr(e,{name:"TitleOverlay"});o.addClass("vp2-title-layer"),e.addChild(o),i||o.hide();const l=new dr(e,{name:"EndScreen"});l.addClass("vp2-endscreen-layer");const c=e.getChild("ControlBar"),u=c?e.children().indexOf(c):-1;e.addChild(l,{},u>-1?u:e.children().length);const d=new dr(e,{name:"ChromeRoot"});return d.addClass("vp2-chrome"),e.addChild(d),ts(ss(cr,{store:n,player:e}),d.el()),e.on("dispose",()=>{r(),is(d.el())}),n}function pr(e){let t=mr(e,"defaultColor","rgb(26, 26, 26)");return Array.isArray(t)||"string"!=typeof t?t:(t=t.trim().toLowerCase(),0===t.indexOf("rgb")?function(e){return e.replace(/[^0-9,]/g,"").split(",").map(e=>parseInt(e,10))}(t):0===t.indexOf("#")?function(e){let t=e.replace(/[^0-9a-f]/gi,"");if(t.length<6){const e=6-t.length;t+="0".repeat(e)}else t.length>
26&&(t=t.slice(0,6));const i=parseInt(t,16);return[i>>16&255,i>>8&255,255&i]}(t):t)}function mr(e,t,i){return void 0===e[t]?i:e[t]}function gr(e){if(e instanceof HTMLImageElement){let t=e.naturalWidth,i=e.naturalHeight;return e.naturalWidth||-1===e.src.search(/\.svg(\?|$)/i)||(t=i=100),{width:t,height:i}}return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}function fr(e){return e instanceof HTMLCanvasElement?"canvas":e.src}class yr{constructor(){this.canvas=null,this.ctx=null,this.vibrantIncumbentBin=null}getColorAsync(e,t){return new Promise((i,s)=>{e?i(this.getColor(e,t)):s("call .getColorAsync() without resource.")})}getBorderColorsAsync(e,t){return new Promise((i,s)=>{if(!e)return s("call .getBorderColorsAsync() without resource.");const n=!1,r=pr(t),a=gr(e),{width:o,height:l}=a,c=l/2,u=o/2,d=this.getColor(e,{height:c,silent:n}),h=this.getColor(e,{left:o-u,width:u,silent:n}),p=this.getColor(e,{width:u,silent:n}),m=this.getColor(e,{top:l-c,height:c,silent:n}),g=e=>e||r;i([g(d),g(h),g(m),g(p)])})}getColor(e,t){const i=pr(t=t||{});if(!e)return this.outputError("call .getColor(null) without resource.",t.silent),this.prepareResult(i);const s=function(e,t){const i=mr(t,"left",0),s=mr(t,"top",0),n=mr(t,"width",e.width),r=mr(t,"height",e.height);let a,o=n,l=r;return"precision"===t.mode||(n>r?(a=n/r,o=100,l=Math.round(o/a)):(a=r/n,l=100,o=Math.round(l/a)),(o>n||l>r||o<10||l<10)&&(o=n,l=r)),{srcLeft:i,srcTop:s,srcWidth:n,srcHeight:r,destWidth:o,destHeight:l}}(gr(e),t);if(!(s.srcWidth&&s.srcHeight&&s.destWidth&&s.destHeight))return this.outputError(`incorrect sizes for resource "${fr(e)}".`,t.silent),this.prepareResult(i);if(this.canvas||(this.canvas="undefined"==typeof window?new OffscreenCanvas(1,1):document.createElement("canvas")),!this.ctx&&(this.ctx=this.canvas.getContext&&this.canvas.getContext("2d",{willReadFrequently:!0}),!this.ctx))return this.outputError("Canvas Context 2D is not supported in this browser.",t.silent),this.prepareResult(i);this.canvas.width=s.destWidth,this.canvas.height=s.destHeight;let n=i;try{this.ctx.clearRect(0,0,s.destWidth,s.destHeight),this.ctx.drawImage(e,s.srcLeft,s.srcTop,s.srcWidth,s.srcHeight,0,0,s.destWidth,s.destHeight);const i=this.ctx.getImageData(0,0,s.destWidth,s.destHeight).data,r=this.getColorFromArray4(i,t);r&&(n=r)}catch(i){this.outputError(`security error (CORS) for resource ${fr(e)}.\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image`,t.silent,i)}return this.prepareResult(n)}getColorFromArray4(e,t){t=t||{};const i=e.length,s=pr(t);if(i<4)return s;const n=i-i%4,r=4*(t.step||1);return"vibrant"===t.algorithm?this.vibrantAlgorithm(e,n,{defaultColor:s,step:r}):this.sqrtAlgorithm(e,n,{defaultColor:s,step:r})}sqrtAlgorithm(e,t,i){let s=0,n=0,r=0,a=0;const o=i.step;for(let i=0;i<t;i+=o,a++){const t=e[i],a=e[i+1],o=e[i+2];s+=t*t,n+=a*a,r+=o*o}return a>0&&0===s+n+r?null:a?[Math.round(Math.sqrt(s/a)),Math.round(Math.sqrt(n/a)),Math.round(Math.sqrt(r/a))]:i.defaultColor}vibrantAlgorithm(e,t,i){const s=i.step,n=256,r=new Uint32Array(n),a=new Float64Array(n),o=new Float64Array(n),l=new Float64Array(n),c=new Float64Array(n);let u=0;const d=Math.floor(.8*t);let h=0,p=0,m=0,g=0;for(let i=0;i<t;i+=s,u++){const t=e[i],s=e[i+1],n=e[i+2];i>=d&&(h+=t,p+=s,m+=n,g++);const u=Math.max(t,s,n),f=u-Math.min(t,s,n),y=0===u?0:f/u;let _=0;if(f>0){let e;e=u===t?(s-n)/f+6:u===s?(n-t)/f+2:(t-s)/f+4,_=Math.floor(16*e/6)%16}const v=16*_+4*Math.min(3,Math.floor(4*y))+Math.min(3,Math.floor(u/64));r[v]++,a[v]+=y,o[v]+=t,l[v]+=s,c[v]+=n}const f=.02*u;let y=-1,_=0;for(let e=0;e<n;e++){if(r[e]<f)continue;const t=a[e]/r[e];if(t<.15)continue;const i=r[e]*t*t;i>_&&(_=i,y=e)}const v=g?[Math.round(h/g),Math.round(p/g),Math.round(m/g)]:null;if(-1===y){this.vibrantIncumbentBin=null;const s=this.sqrtAlgorithm(e,t,i);return s&&v?this.guardBackdropContrast(s,v):s}let b=y;const T=this.vibrantIncumbentBin;if(null!==T&&T!==y&&r[T]>=f){const e=a[T]/r[T],t=r[T]*e*e;e>=.15&&_<1.2*t&&(b=T)}this.vibrantIncumbentBin=b;const S=[Math.round(o[b]/r[b]),Math.round(l[b]/r[b]),Math.round(c[b]/r[b])];return v?this.guardBackdropContrast(S,v):S}guardBackdropContrast(e,t){const i=this.calculateBrightness(t),s=this.calculateBrightness(e),n=i-60,r=i+60,a=n>=45,o=r<=195;if(a&&s>=45&&s<=n||o&&s>=r&&s<=195||!s)return e;let l;return l=(s>=i?o:!a)?Math.max(r,Math.min(s,195)):Math.min(n,Math.max(s,45)),this.adjustBrightness(e,l/s)}
2clipColor(e,t=0,i=255){return Math.max(t,Math.min(i,e))}clipRgb(e,t=0,i=255){return e.map(e=>this.clipColor(e,t,i))}adjustBrightness(e,t=1){return this.clipRgb(e.map(e=>Math.floor(e*t)))}calculateBrightness([e,t,i]){return(299*e+587*t+114*i)/1e3}prepareResult(e){if(!Array.isArray(e))return null;const t=this.calculateBrightness(e);let i=this.clipRgb(e.slice(0,3),30,255);return t>=200&&(i=this.adjustBrightness(i,.5)),t<=40&&(i=this.adjustBrightness(i,1.5)),"rgb("+i.join(",")+")"}destroy(){this.canvas=null,this.ctx=null,this.vibrantIncumbentBin=null}outputError(e,t,i){t||(console.error("FastAverageColor: "+e),i&&console.error(i))}}const _r=n.default.getPlugin("plugin");function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},vr.apply(null,arguments)}const br=n.default.getComponent("Component"),Tr=n.default.getComponent("ModalDialog"),Sr=({guid:e,currentTime:t,player:i,isPrivate:s,canDisplayEmbed:n,canDisplayDownload:r,downloadUrl:a,localize:o})=>{const l=parseFloat(getComputedStyle(i.el()).height);let c="videopress-share-dialog__inner";l<=170?c+=" videopress-size-xs":l<=280?c+=" videopress-size-s":l<=380&&(c+=" videopress-size-m");const u={guid:e,currentTime:t,isPrivate:s};return ss("div",{className:"videopress-share-dialog",onClick:e=>{e.target.classList.contains("videopress-share-dialog")&&i.director().trigger("share-dialog-close")},role:"presentation"},ss("div",{className:c},ss("div",{className:"videopress-share-dialog__header",role:"heading","aria-level":"2"},o("Share video")),n&&ss(Cr,vr({},u,{localize:o})),r&&ss(wr,{downloadUrl:a,localize:o})))},Cr=({guid:e,currentTime:t,isPrivate:i,localize:s})=>{const[r,a]=di(!1),[o,l]=di(!1),[c,u]=di(!1),[d,h]=di(!1),[p,m]=di(!1);if(!e)return ss("div",null,"No video guid, can't show share screen");const g=e=>navigator&&navigator.clipboard?(navigator.clipboard.writeText(e.innerText),!0):f(e),f=e=>{const t=document.createElement("div");t.style.position="absolute",t.style.left="-1000px",t.style.width="0px",t.style.height="0px",t.innerText=e.innerText,document.body.appendChild(t);const i=document.createRange();i.selectNode(t),window.getSelection().addRange(i);const s=document.execCommand("copy");return s&&window.getSelection().removeAllRanges(),document.body.removeChild(t),s},y={};r&&(y.at=t),c&&(y.loop=1),o&&(y.autoPlay=1);let _="";if(Object.keys(y).length>0){const e=[];Object.keys(y).forEach(t=>{e.push(`${t}=${y[t]}`)}),_=`?${e.join("&")}`}const v=i?"video.wordpress.com":"videopress.com",b=`https://${v}/v/${e}${_}`,T=`<iframe width="560" height="315" src="https://${v}/embed/${e}${_}" loading="lazy" frameborder="0" allowfullscreen allow="clipboard-write; presentation"></iframe>`,S=`<script src="${i?"https://video.wordpress.com/wp-content/plugins/video/assets/js/next/videopress-iframe.js":"https://videopress.com/videopress-iframe.js"}" async><\/script>`;return ss(Et,null,ss("div",null,ss("div",{className:"videopress-share-dialog__title"},s("Video link")),ss("div",{className:`videopress-share-dialog__link ${d?s("Copied"):""}`},ss("div",{id:"link",className:"text"},b),ss("button",{className:"copy-button",onClick:e=>{g(e.target.parentNode.childNodes[0])&&(h(!0),setTimeout(()=>{h(!1)},1e3))}},s(d?"Copied":"Copy")))),ss("div",{className:"videopress-share-dialog__options"},ss("div",{className:"videopress-share-dialog__option option_playtime"},ss("input",{id:"at",className:"videopress-share-dialog__at",type:"checkbox",onClick:()=>{a(!r)}}),ss("label",{htmlFor:"at",className:"videopress-share-dialog__playtime"},s("Start at {1}",[n.default.time.formatTime(t,600)]))),ss("div",{className:"videopress-share-dialog__option option_loop"},ss("input",{id:"loop",className:"videopress-share-dialog__loop",type:"checkbox",onClick:()=>{u(!c)}}),ss("label",{htmlFor:"loop"},s("Loop"))),ss("div",{className:"videopress-share-dialog__option option_autoplay"},ss("input",{id:"autoplay",className:"videopress-share-dialog__autoplay",type:"checkbox",onClick:()=>{l(!o)}}),ss("label",{htmlFor:"autoplay"},s("Autoplay")))),ss("div",null,ss("div",{className:"videopress-share-dialog__embed-title"},ss("div",{className:"videopress-share-dialog__title"},s("Embed video (HTML)")),ss("button",{className:"raised-copy-button",onClick:e=>{g(e.target.parentNode.parentNode.childNodes[1].childNodes[0])&&(m(!0),setTimeout(()=>{m(!1)},1e3))}},s(p?"Copied":"Copy"))),ss("div",{className:`videopress-share-dialog__embed ${p?s("Copied"):""}`},ss("div",{id:"embed",className:"text"},T,ss("br",null),S))))},wr=({downloadUrl:e,localize:t})=>ss("a",{className:"videopress-share-dialog-download-button",href:e,download:e,target:"_blank"},t("Download this video")),kr=Ze("ShareDialog",class extends br{constructor(e,t){super(e,t),"className"in t&&e.addClass(t.className),this.elem=document.createElement("div"),this.modal=new Tr(e,{temporary:!1,fillAlways:!0,pauseOnOpe
2n:!1,content:this.elem}),this.addChild(this.modal)}open(e){this.modal.open(),ts(ss(Sr,vr({},e,{player:this.player(),localize:(e,t,i)=>this.localize(e,t,i)})),this.elem)}close(){this.modal.close()}});const Er=n.default.getComponent("Component"),xr=({onAgeSubmit:e,errorMessage:t,isLoading:i,localize:s})=>{const[n,r]=di(null),[a,c]=di(null),[u,d]=di(null),h=(new Intl.DateTimeFormat).formatToParts();let p=!0;h.some(e=>"day"===e.type||"month"===e.type&&(p=!1,!0));const m=e=>{const t=e.target.value;switch(e.target.name){case"m":r(t);break;case"d":c(t);break;case"y":d(t)}},g=""!==t,f=i&&!g,y=!g&&!f;return ss("div",{className:"videopress-age-gate"},ss("div",{className:"videopress-error-screen__vp-logo"},ss("img",{src:l,width:"29",height:"21",alt:"VideoPress"})),ss("div",{className:"wrap"},f||ss(ns,null,ss("img",{src:o,width:"48px",height:"48px",alt:""}),ss("h3",null,s("This video may display mature content."))),g&&ss("p",{className:"error"},t),y&&ss(ns,null,ss("p",null,s("Please enter your birth date")),ss("form",{onSubmit:t=>{t.preventDefault(),e(n,a,u)}},ss("div",{className:"input-list"},ss("input",{className:p?"dd":"mm",autoComplete:"off",name:p?"d":"m",type:"text",maxLength:2,placeholder:s(p?"DD":"MM"),pattern:"[0-9]+",value:p?a:n,onChange:m}),ss("input",{className:p?"mm":"dd",autoComplete:"off",name:p?"m":"d",type:"text",maxLength:2,placeholder:s(p?"MM":"DD"),pattern:"[0-9]+",value:p?n:a,onChange:m}),ss("input",{className:"yyyy",autoComplete:"off",name:"y",type:"text",maxLength:4,placeholder:s("YYYY"),pattern:"[0-9][0-9][0-9][0-9]",value:u,onChange:m})),ss("button",{id:"submitButton"},s("Continue"))))))},Ir=class extends Er{constructor(e,t){super(e,t),function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(this,"handleAgeSubmit",(e,t,i)=>{this.showLoadingIndicator(),this.player().director().trigger("update-viewer-birthdate",{m:e,d:t,y:i})}),n.default.registerComponent("Spinner",a);const i=document.createElement("div");this.modal=e.createModal(i,{uncloseable:!0}),this.modal.addClass("videopress-age-gate__modal-dialog"),this.modal.open(),this.renderAgeGate(),this.spinner=this.modal.addChild("Spinner")}hide(){this.hideLoadingIndicator(),this.modal.close()}show(){this.modal.open()}showLoadingIndicator(){this.spinner.show(),this.setState({isLoading:!0}),this.renderAgeGate()}hideLoadingIndicator(){this.spinner.hide(),this.setState({isLoading:!1}),this.renderAgeGate()}showError(e){this.setState({errorMessage:e}),this.renderAgeGate()}renderAgeGate(){ts(ss(xr,{onAgeSubmit:this.handleAgeSubmit,isLoading:this.state.isLoading,errorMessage:this.state.errorMessage??"",localize:(e,t,i)=>this.localize(e,t,i)}),this.modal.contentEl())}};function Ar(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Pr=n.default.getPlugin("plugin"),Dr=n.default.getPlugin("plugin"),Lr=n.default.getComponent("ModalDialog");class Mr extends rs{constructor(e){super(e),this.state={currentProgress:0},this.initSocketIO(e.videoInfo)}initSocketIO(e){const{supportedTypes:t}=this.props;le((i,s)=>{if(i)return;const n=s("https://io.videopress.com",{upgrade:!1,query:{guid:e.guid}}),r={};t.forEach(e=>r[e]=0);const a=e=>{if(!(e.type in r))return;r[e.type]=e.progress;let i=0;for(const e in r){let t=r[e];t<0&&(t=0),i+=t}const s=i/t.length,o=Math.floor(s);this.setState({currentProgress:o}),100===o&&(n.off("conversion status",a),n.disconnect())};n.on("conversion status",a)})}
2render(){const{progressColor:e,progressBackgroundColor:t,localize:i}=this.props,{currentProgress:s}=this.state;let n=null;null!==t&&t.length>0&&(n="background: "+t);let r="width: "+s+"%";return null!==e&&e.length>0&&(r+=";background: "+e),ss("div",null,ss("div",{className:"videopress-converting-toprow"},ss("div",{className:"videopress-converting-toprow-container"},ss("div",{className:"videopress-converting-logo-container"},ss("img",{src:l,width:"29",height:"21",alt:"VideoPress"}))),ss("div",{className:"videopress-converting-percentage-container"},ss("div",{className:"videopress-converting-text-container"},ss("span",null,i("We are converting this video for optimal playback..."))),ss("div",{className:"videopress-converting-percentage-text"},s,"%"))),ss("div",{className:"videopress-converting-bottomrow"},ss("div",{className:"videopress-converting-progress-container",style:n},ss("div",{className:"videopress-converting-current-progress",style:r}))))}}const Nr=n.default.getPlugin("plugin");function Or(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Rr=n.default.getPlugin("plugin");n.default.registerPlugin("apiFetch",class extends Pr{constructor(e,t){super(e,t),Ar(this,"startPollingInfoEndpoint",(e,t)=>{this.fetchTimeout||(this.fetchTimeout=setInterval(()=>this.player.api.wpcom.videoInfo(e,t),5e3))}),Ar(this,"stopPollingInfoEndpoint",()=>{this.fetchTimeout&&(clearInterval(this.fetchTimeout),this.fetchTimeout=null)}),Ar(this,"dispose",()=>{super.dispose(),this.stopPollingInfoEndpoint()});const i=t.token||"";i&&e.setState({metadataToken:i});const s=e.api.wpcom;s.onTokenReceived((t,i)=>{e.setState({metadataToken:i}),s.videoInfo(t,{},!1)}),s.onTokenRequest((e,t,i)=>{const s={event:"videopress_token_request",guid:e,requestId:t,isRetry:!!i};parent!==window?parent.postMessage(s,"*"):window.postMessage(s,"*")})}}),n.default.registerPlugin("converting",class extends Dr{constructor(e,t){super(e,t),this.convertingModal=null;const{progressColor:i="",progressBackgroundColor:s=""}=t;this.progressColor=i,this.progressBackgroundColor=s}closeConvertingModalIfNecessary(){this.convertingModal&&this.convertingModal.close(),this.player.apiFetch().stopPollingInfoEndpoint()}showConversionErrorModal(){this.closeConvertingModalIfNecessary(),this.player.director().getErrorScreen().showError({message:`${this.player.localize("Conversion failed.")} <a target="_blank" href="https://wordpress.com/support/videopress/">${this.player.localize("Learn more")}</a>`,icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoCgkJZD0iTTEyIDEyLjg5OEw2LjUzODA1IDE4LjUyMjVMNS40NjE5NiAxNy40Nzc1TDEwLjk1NDYgMTEuODIxNEw1LjgwODcyIDYuNTIyNDhMNi44ODQ4MiA1LjQ3NzQ4TDEyIDEwLjc0NDlMMTcuMTE1MiA1LjQ3NzQ4TDE4LjE5MTMgNi41MjI0OEwxMy4wNDU1IDExLjgyMTRMMTguNTM4MSAxNy40Nzc1TDE3LjQ2MiAxOC41MjI1TDEyIDEyLjg5OFoiCgkJZmlsbD0id2hpdGUiCgkvPgo8L3N2Zz4K"})}showConversionModal(e){const t=e.files_status;let i=[];if(i=t.dvd?["dvd_mp4"]:["std_mp4"],window.postMessage({event:"videopress_progress",status:t,supported:i,id:e.guid}),this.convertingModal&&this.convertingModal.opened())return!1;const s=document.createElement("div");return s.className="videopress-converting",this.convertingModal=new Lr(this.player,{temporary:!0,content:s,fillAlways:!0,uncloseable:!0}),this.convertingModal.addClass("videopress-converting-modal"),this.player.removeChild(this.convertingModal),this.player.addChild(this.convertingModal),this.convertingModal.open(),ts(ss(Mr,{videoInfo:e,progressColor:this.progressColor,progressBackgroundColor:this.progressBackgroundColor,supportedTypes:i,localize:(e,t,i)=>this.player.localize(e,t,i)}),s),!0}}),n.default.registerPlugin("ttfp",class extends Nr{constructor(e,t){super(e,t),function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(this,"initTTFP",()=>{this.player.one("play",()=>{const e=(new Date).getTime();this.player.one("timeupdate",()=>{const t=(new Date).getTime()-e;setTimeout(()=>this.player.stats().sendTTFP(t),0)})})}),this.initTTFP()}});const Ur=e=>!!e&&"application/x-mpegURL"===e.type&&e.src.startsWith(`${ie}/`);function Br(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Fr=n.default.getPlugin("plugin"),jr="videopress-keyboard-navigation",qr=n.default.getPlugin("plugin"),$r=n.default.getPlugin("plugin");const Hr=n.default.getPlugin("plugin");function zr(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Vr=n.default.getPlugin("plugin");function Wr({fraction:e,duration:t,totalFramesCount:i,gridMax:s,gridCols:n,gridRows:r,displayWidth:a,displayHeight:o}){if(!(t>0&&i>0))return{thumbFrame:0,thumbFrameIndex:0,thumbFrameRow:0,thumbFrameCol:0,thumbFrameLeft:0,thumbFrameTop:0};const l=t/i,c=e*t;let u=Math.floor(c/l);u>=i&&(u=i-1);const d=u%s,h=Math.floor(d/n),p=d%r;return{thumbFrame:u,thumbFrameIndex:d,thumbFrameRow:h,thumbFrameCol:p,thumbFrameLeft:p*a,thumbFrameTop:h*o}}function Gr(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Xr=n.default.getPlugin("plugin"),Kr=n.default.getComponent("Component"),Yr={controls:!0};class Qr extends Kr{constructor(e,t){super(e,t),this.addClass("videopress-thumb-img"),this.setSize(t.width,t.height)}setSize(e,t){this.el().style.width=`${e}px`,this.el().style.height=`${t}px`}show(){this.addClass("show")}hide(){this.removeClass("show")}setImage(e,t,i,s,n,r,a){this.setState({imageUrl:e});const o=`url(${e})`;this.el().style.backgroundSize=`${t*s}px ${i*n}
2px`,this.el().style.backgroundImage=o,this.el().style.backgroundPosition=`-${r}px -${a}px`}getImage(){return this.state.imageUrl}}class Zr extends Kr{constructor(e,t){super(e,t),this.player=e,n.default.registerComponent("Spinner",a),n.default.registerComponent("ThumbImg",Qr),this.addClass("videopress-thumbnail"),this.resizeThumbnails(),this.loadedImgs={},this.thumbImg=this.addChild("ThumbImg",{width:this.state.width,height:this.state.height}),this.spinner=this.addChild("Spinner",{size:Math.round(this.state.height/3)}),this.chapterTitleTextElement=document.createElement("div"),this.chapterTitleTextElement.className="videopress-thumbnail-chapter",this.addChild("Component",{el:this.chapterTitleTextElement}),e.on("playerresize",()=>this.resizeThumbnails())}resizeThumbnails(){let e=this.player.options().height;if(this.player.el){const t=getComputedStyle(this.player.el());e=parseFloat(t.height)}const t=this.options(),i=e<=240?3:4,s=Math.min(t.thumbHeight,e/i),n=Math.round(t.videoWidth*s/t.videoHeight);this.setState({width:n,height:s}),this.el().style.width=`${n}px`,this.el().style.height=`${s}px`,this.thumbImg&&this.thumbImg.setSize(n,s)}show(){this.addClass("show")}hide(){this.removeClass("show")}setChapterTitle(e){this.chapterTitleTextElement.innerHTML=e}setPosition(e,t){const i=this.calculateThumbPreviewLeftPosition(e,this.state.width,t);this.el().style.transform=`translateX(${i}px)`}setImage(e,t,i,s){const n=s.find(t=>t.src===e&&t.complete);if(this.loadedImgs[e]||n?(this.spinner.hide(),this.thumbImg.show()):(this.spinner.show(),this.thumbImg.hide()),void 0===this.loadedImgs[e]&&!n){this.loadedImgs[e]=!1;const t=new Image;t.onload=()=>{this.loadedImgs[e]=!0;const t=this.thumbImg.getImage();e===t&&(this.spinner.hide(),this.thumbImg.show())},t.src=e}const r=this.options();this.thumbImg.setImage(e,this.state.width,this.state.height,r.maxSheetCols,r.maxSheetRows,t,i)}calculateThumbPreviewLeftPosition(e,t,i){const s=t+2*this.options().padding;let n=e-s/2;return n<0?n=0:n+s>i&&(n=i-s),n}getWidth(){return this.state.width}getHeight(){return this.state.height}}function Jr(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const ea=n.default.getPlugin("plugin");let ta=null;const ia=new WeakMap;n.default.use("*",e=>({callPlay(){const t=ia.get(e);if(t?.sessionActive){try{t.remotePlayerController.playOrPause()}catch(e){n.default.log.error("Cast: forwarding play to the receiver failed",e)}return n.default.middleware.TERMINATOR}}}));class sa{constructor(e,t){this.player=e,this.plugin=t,this.syncingFromRemote=!1,this.lastMirroredTime=null,this.sessionActive=!1,ia.set(e,this)}init(e,t){this.castFramework=e,this.chromeCast=t,this.context=e.CastContext.getInstance(),this.context.setOptions({receiverApplicationId:t.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:t.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED}),this.onCastStateChanged=e=>this.announceAvailability(e.castState),this.context.addEventListener(e.CastContextEventType.CAST_STATE_CHANGED,this.onCastStateChanged),this.announceAvailability(),this.remotePlayer=new e.RemotePlayer,this.remotePlayerController=new e.RemotePlayerController(this.remotePlayer),this.onConnectedChanged=()=>{this.remotePlayer.isConnected?this.startCastSession():this.endCastSession()},this.remotePlayerController.addEventListener(e.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.onConnectedChanged)}announceAvailability(e=this.context.getCastState()){this.player.trigger("cast-availability-changed",{platform:"chromecast",available:e!==this.castFramework.CastState.NO_DEVICES_AVAILABLE})}isCasting(){return!!this.remotePlayer?.isConnected}deviceName(){return this.context?.getCurrentSession()?.getCastDevice()?.friendlyName||""}toggleCast(){this.isCasting()?this.context.endCurrentSession(!0):this.context.requestSession().catch(e=>{"cancel"!==e&&(n.default.log.error("Cast: requesting a session failed",e),this.player.trigger("cast-failed",{reason:"session-request",error:e}))})}startCastSession(){const e=this.context.getCurrentSession();if(!e)return n.default.log.warn("Cast: no current session; ending the session"),this.player.trigger("cast-failed",{reason:"no-session"}),void this.context.endCurrentSession(!0);const t=this.plugin.getCastMediaInfo(),i=e.getMediaSession?.();if(i?.media?.contentId&&this.chromeCast.media.PlayerState.IDLE!==i.playerState)return t?.url?void(this.isSameMedia(i.media.contentId,t.url)?this.adoptRunningMedia(i):n.default.log.warn("Cast: rejoined a session playing other media; leaving it alone",i.media.contentId)):(n.default.log.warn("Cast: rejoined a running session before a castable source exists; deferring adoption"),void this.player.one("loadstart",()=>{this.isCasting()&&!this.sessionActive&&this.startCastSession()}));if(!t?.url)return n.default.log.warn("Cast: no castable source; ending the session"),this.player.trigger("cast-failed",{reason:"no-source"}),void this.context.endCurrentSession(!0);const{chromeCast:s}=this,r=new s.media.MediaInfo(t.url,t.contentType);r.streamType=s.media.StreamType.BUFFERED,r.metadata=new s.media.GenericMediaMetadata,r.metadata.title=t.title,t.poster&&(r.metadata.images=[new s.Image(t.poster)]),r.tracks=t.tracks.map(e=>{const t=new s.media.Track(e.id,s.media.TrackType.TEXT);return t.trackContentId=e.src,t.trackContentType="text/vtt",t.subtype=s.media.TextTrackType.SUBTITLES,t.n
2ame=e.label,t.language=e.language,t});const a=new s.media.LoadRequest(r);a.currentTime=this.player.currentTime(),a.autoplay=!0;const o=t.tracks.filter(e=>e.active).map(e=>e.id);o.length&&(a.activeTrackIds=o),e.loadMedia(a).then(()=>{this.loadedMedia={url:t.url,contentType:t.contentType},this.player.pause(),this.sessionActive=!0,this.bindLocalToRemote(),this.plugin.onCastConnected(this.deviceName(),"chromecast")}).catch(e=>{this.sessionActive=!1,n.default.log.error("Cast: loading media on the receiver failed",e),this.player.trigger("cast-failed",{reason:"load-media",error:e}),this.context.endCurrentSession(!0)})}isSameMedia(e,t){const i=e=>String(e).split(/[?#]/)[0];return i(e)===i(t)}adoptRunningMedia(e){try{this.loadedMedia={url:e.media.contentId,contentType:e.media.contentType},this.player.pause(),this.sessionActive=!0,this.bindLocalToRemote(),this.plugin.onCastConnected(this.deviceName(),"chromecast")}catch(e){this.sessionActive=!1,n.default.log.error("Cast: adopting the running media failed",e),this.player.trigger("cast-failed",{reason:"adopt-media",error:e}),this.context.endCurrentSession(!0)}}endCastSession(){try{this.unbindLocalToRemote()}finally{const e=this.sessionActive;this.sessionActive=!1,e&&this.plugin.onCastDisconnected(this.remotePlayer?.savedPlayerState?.currentTime??null)}}bindLocalToRemote(){const{player:e,remotePlayer:t,remotePlayerController:i}=this,s=this.castFramework.RemotePlayerEventType;this.lastMirroredTime=null,this.onLocalPlay=()=>{this.syncingFromRemote||(e.pause(),i.playOrPause())},this.onLocalSeeking=()=>{this.syncingFromRemote||null!==this.lastMirroredTime&&Math.abs(e.currentTime()-this.lastMirroredTime)<1||(t.currentTime=e.currentTime(),i.seek())},this.onLocalVolumeChange=()=>{this.syncingFromRemote||(t.volumeLevel=e.muted()?0:e.volume(),i.setVolumeLevel())},e.on("play",this.onLocalPlay),e.on("seeking",this.onLocalSeeking),e.on("volumechange",this.onLocalVolumeChange),this.onRemotePausedChanged=()=>{this.syncingFromRemote=!0;try{e.trigger(t.isPaused?"pause":"play")}finally{this.syncingFromRemote=!1}},this.onRemoteTimeChanged=()=>{this.lastMirroredTime=t.currentTime,e.currentTime(t.currentTime)},this.onRemotePlayerStateChanged=()=>{const i=t.playerState;if(n.default.log.debug("Cast: receiver player state",i),this.chromeCast.media.PlayerState.IDLE!==i)return;const s=this.context.getCurrentSession()?.getMediaSession();s?this.chromeCast.media.IdleReason.ERROR===s.idleReason&&(n.default.log.error("Cast: receiver playback failed",this.loadedMedia),e.trigger("cast-failed",{reason:"receiver-error",media:this.loadedMedia}),this.context.endCurrentSession(!0)):t.isConnected&&n.default.log.warn("Cast: receiver went idle with no readable idle reason",this.loadedMedia)},i.addEventListener(s.IS_PAUSED_CHANGED,this.onRemotePausedChanged),i.addEventListener(s.CURRENT_TIME_CHANGED,this.onRemoteTimeChanged),i.addEventListener(s.PLAYER_STATE_CHANGED,this.onRemotePlayerStateChanged),this.onTextTracksChange=()=>{const e=this.context.getCurrentSession()?.getMediaSession?.();if(!e?.editTracksInfo)return;const t=this.plugin.getCastTextTracks().filter(e=>e.active).map(e=>e.id);e.editTracksInfo(new this.chromeCast.media.EditTracksInfoRequest(t),()=>{},e=>n.default.log.warn("Cast: updating receiver text tracks failed",e))},e.textTracks().on("change",this.onTextTracksChange)}unbindLocalToRemote(){if(!this.onLocalPlay)return;const{player:e,remotePlayerController:t}=this,i=this.castFramework.RemotePlayerEventType;e.off("play",this.onLocalPlay),e.off("seeking",this.onLocalSeeking),e.off("volumechange",this.onLocalVolumeChange),e.textTracks().off("change",this.onTextTracksChange),t.removeEventListener(i.IS_PAUSED_CHANGED,this.onRemotePausedChanged),t.removeEventListener(i.CURRENT_TIME_CHANGED,this.onRemoteTimeChanged),t.removeEventListener(i.PLAYER_STATE_CHANGED,this.onRemotePlayerStateChanged),this.onLocalPlay=null}dispose(){this.unbindLocalToRemote(),ia.delete(this.player),this.onCastStateChanged&&this.context.removeEventListener(this.castFramework.CastContextEventType.CAST_STATE_CHANGED,this.onCastStateChanged),this.onConnectedChanged&&this.remotePlayerController.removeEventListener(this.castFramework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.onConnectedChanged)}}const na=n.default.getComponent("Component"),ra=class extends na{createEl(){const e=super.createEl("div",{className:"vjs-casting-overlay"});return this.messageEl_=n.default.dom.createEl("p",{className:"vjs-casting-overlay-message"}),e.appendChild(this.messageEl_),e}open(e){this.messageEl_.textContent=e?this.localize("Playing on {1}",[e]):this.localize("Playing on TV")}},aa=n.default.getComponent("Component"),oa=class extends aa{constructor(e,t){super(e,t),this.hide()}createEl(){return super.createEl("div",{className:"vjs-cast-error-message",textContent:this.localize("Could not play on TV. Try again.")})}open(){this.clearTimeout(this.hideTimeout_),this.show(),this.hideTimeout_=this.setTimeout(()=>this.hide(),5e3)}},la=n.default.getPlugin("plugin"),ca={PORTRAIT:"portrait",LANDSCAPE:"landscape",SQUARE:"square"},ua="info",da="media",ha=(e,t)=>{const i=Math.max(e,t);return Math.abs(e-t)/i<=.01?ca.SQUARE:t>e?ca.PORTRAIT:ca.LANDSCAPE},pa=(e,t,i)=>{const s=Number(e),n=Number(t);return!Number.isFinite(s)||!Number.isFinite(n)||s<=0||n<=0?null:{width:s,height:n,aspectRatio:Math.round(s/n*1e4)/1e4,orientation:ha(s,n),source:i}};const ma=n.default.getPlugin("plugin"),ga="videopress-orientation-",fa=Object.values(ca).map(e=>ga+e),ya=/^#[0-9a-f]{3,6}$/i,_a=(e,t)=>
2`\n.video-js.vjs-videopress:where(:not(.vp2)) ${e} {\n\t\tbackground: ${t};\n\t}\n`,va=(e,t)=>`\n.video-js.vjs-videopress.vp2 ${e} {\n\t\tbackground: ${t};\n\t}\n`,ba=e=>({name:"pause",onEvent:()=>e.pause()}),Ta=e=>({name:"play",onEvent:()=>e.play()}),Sa=e=>({name:"audio",onEvent:()=>({isMuted:e.muted(),volume:100*e.volume()})}),Ca=(e,t)=>(e&&e.on("fullscreenchange",async()=>{t.status.fullscreenChanged.trigger(await t.status.fullscreen())}),[{name:"fullscreen",onEvent:()=>e.isFullscreen()},{name:"fullscreenChanged"}]),wa=e=>{let t=0,i=null;return[{name:"_postInit",onEvent:()=>{e.status.playerStatusChanged.on((s,n)=>{"playing"===n?i=setInterval(()=>{t+=.5,e.status.playbackTimeUpdated.trigger(t)},500):(clearInterval(i),i=null)})}},{name:"playbackTime",onEvent:()=>t},{name:"playbackTimeUpdated"}]},ka=(e,t)=>(e&&e.on("ratechange",()=>{t.status.playbackRateUpdate.trigger(e.playbackRate())}),{name:"playbackRateUpdate"}),Ea=(e,t)=>{let i=La.LOADING;const s=e=>{if(e!==i){const s=i;i=e,t.status.playerStatusChanged.trigger(s,e)}};return e&&(e.on("ready",()=>s(La.READY)),e.on("playing",()=>s(La.PLAYING)),e.on("pause",()=>s(La.PAUSED)),e.on("ended",()=>s(La.ENDED)),e.on("stalled",()=>s(La.STALLED)),e.on("timeupdate",()=>{La.ENDED===i&&s(e.paused()?La.PAUSED:La.PLAYING)})),[{name:"player",onEvent:()=>i},{name:"playerStatusChanged"}]},xa=(e,t)=>(e&&e.on("timeupdate",()=>{t.status.timeUpdate.trigger(e.currentTime())}),{name:"timeUpdate"}),Ia=(e,t)=>(e&&e.on("chaptersChapterChange",()=>{t.status.chaptersChapterChange.trigger(e.director().getCurrentChapter())}),{name:"chaptersChapterChange"}),Aa=(e,t)=>(e&&e.on("chaptersTrackChange",()=>{t.status.chaptersTrackChange.trigger(e.director().getChapters())}),{name:"chaptersTrackChange"}),Pa=e=>[{name:"borderColorsChanged"},{name:"borderColors",onEvent:()=>e.director().getBorderColors()}],Da=(e,t)=>(e&&e.on("error",()=>{const i=e.error();t.status.error.trigger(i.code,i.message)}),[{name:"error"}]),La={LOADING:"loading",READY:"ready",PLAYING:"playing",PAUSED:"pause",ENDED:"ended",STALLED:"stalled"},Ma=(e,t)=>({name:"seek",onEvent:async i=>{if(i<0)throw"Invalid timeMs provided";const s=1e3*e.duration();if(i>s)throw"Invalid timeMs provided";return La.PLAYING===await t.status.player()&&i>=s&&(i=s-1),e.currentTime(i/1e3),1e3*e.currentTime()}}),Na=e=>({name:"mute",onEvent:t=>e.muted(t)}),Oa=e=>({name:"volume",onEvent:t=>{if(!Number.isFinite(t)||t<0||t>100)throw"Invalid volume provided";e.volume(t/100)}}),Ra=e=>({name:"fullscreen",onEvent:t=>{if(t)return e.requestFullscreen();e.exitFullscreen()}}),Ua=e=>({name:"setChapters",onEvent:t=>{if(!t||!Array.isArray(t)||!t.length)return"Failed to parse chapters";const i=[];if(t.forEach(e=>{"start"in e&&"end"in e&&"title"in e&&(isNaN(e.start)||isNaN(e.end)||"string"!=typeof e.title||i.push(new VTTCue(e.start,e.end,e.title)))}),!i.length)return"Failed to parse chapters";try{const t=e.addTextTrack("chapters","Chapters","en");return t?(i.forEach(e=>{t.addCue(e)}),e.trigger("chapters-track-changed",{track:t}),"ok"):"Failed to create chapters track"}catch(e){return e}}}),Ba=(e,t)=>{const i={};return[{name:"get",onEvent:e=>void 0!==i[e]?{customized:!0,value:i[e]}:{customized:!1,value:!1}},{name:"set",onEvent:s=>{const n=e?.getChild("BigPlayButton"),r=e.getChild("ControlBar"),a=e.getChild("PosterImage"),o=e.getChild("PlayPauseAnimation"),l=e.getChild("ShareButton"),c=e.getChild("TitleOverlay");void 0!==s.autoplay&&s.autoplay!==e.autoplay()&&(e.autoplay(s.autoplay),i.autoplay=!!s.autoplay),void 0!==s.loop&&s.loop!==e.loop()&&(e.loop(s.loop),i.loop=!!s.loop),void 0!==s.muted&&s.muted!==e.muted()&&(e.muted(s.muted),i.muted=!!s.muted),void 0!==s.controlBar&&(r[s.controlBar?"show":"hide"](),s.controlBar||e.vp2Store?.setOpenPanel(null),i.controlBar=!!s.controlBar),void 0!==s.playsinline&&s.playsinline!==e.playsinline()&&(e.playsinline(s.playsinline),i.playsinline=!!s.playsinline),void 0!==s.preload&&s.preload!==e.preload()&&(e.preload(s.preload),i.preload=s.preload),void 0!==s.poster&&s.poster!==e.poster()&&(e.poster(s.poster),i.poster=s.poster),void 0!==s.showPoster&&(a[s.showPoster?"show":"hide"](),a?.[s.showPoster?"addClass":"removeClass"]("videopress-poster-image-is-visible"),i.showPoster=!!s.showPoster),void 0!==s.title&&(c?.[s.title?"show":"hide"](),c?.[s.title?"addClass":"removeClass"]("videopress-title-overlay-is-visible"),i.title=!!s.title),void 0!==s.shareButton&&(l?.[s.shareButton?"show":"hide"](),i.shareButton=!!s.shareButton),void 0!==s.hasStarted&&(e.hasStarted(s.hasStarted),i.hasStarted=!!s.hasStarted),void 0!==s.bigPlayButton&&(n[s.bigPlayButton?"show":"hide"](),n[s.bigPlayButton?"addClass":"removeClass"]("videopress-big-play-button-is-visible"),i.bigPlayButton=!!s.bigPlayButton),void 0!==s.playPauseAnimation&&(o?.[s.playPauseAnimation?"show":"hide"](),i.playPauseAnimation=!!s.playPauseAnimation),t.customize.optionsChanged.trigger(s)}}]},Fa=(e,t)=>{let i=null;const s=e=>{if(!e)return;if(i&&da===i.source&&ua===e.source)return;const s=!((e,t,i=.01)=>!!e&&!!t&&e.orientation===t.orientation&&Math.abs(e.aspectRatio-t.as
2pectRatio)<=i)(i,e);i=e,s&&t.info.dimensionsChanged.trigger({...i})};return e&&e.on(["loadedmetadata","resize"],()=>s(pa(e.videoWidth(),e.videoHeight(),da))),[{name:"_postInit",onEvent:()=>t.wpcom.videoInfoFetched.on(e=>s(pa(e.width,e.height,ua)))},{name:"dimensions",onEvent:()=>i?{...i}:null},{name:"dimensionsChanged"}]},ja=(e,t)=>(e&&e.on(["loadedmetadata","durationchanged"],()=>{t.info.infoUpdated.trigger()}),{name:"duration",onEvent:t=>e?e.duration()*(t?1e3:1):null}),qa=e=>({name:"guid",onEvent:()=>e.videoInfo.guid??""}),$a=e=>({name:"poster",onEvent:()=>e.videoInfo.poster??""}),Ha=e=>({name:"privacy",onEvent:()=>e.videoInfo.is_private?"private":"public"}),za=e=>({name:"title",onEvent:()=>e.videoInfo.title??""}),Va=e=>({name:"getThumbnailSample",onEvent:t=>{if(0===e.thumbnails().state.length)return{};const i=[],s=Math.min(t,Math.floor(e.thumbnails().state.duration))+1;for(let t=1;t<s;t++){const n=100/s*t/100,r=e.thumbnails().calculateThumbImagePosition(n);r.seekPosition=n*e.thumbnails().state.duration,i.push(r)}return{thumbnails:i,size:{width:e.thumbnails().thumb.state.width,height:e.thumbnails().thumb.state.height}}}}),Wa=(e,t)=>{let i=[],s=null,n=0;const r=(e,t)=>t&&e>=t[0]&&e<=t[1],a=()=>{const a=Math.round(e.currentTime());if(r(a,s))return;const o=(e=>{for(let t=0;t<i.length;t++){if(r(e,i[t]))return t;if(e<i[t][0])return t;if(t===i.length-1)return t;if(e>i[t][1]&&e<i[t+1][0])return t}return-1})(a),l=o>=0?i[o]:null;if(r(a,l))return;const c=[a,a+1];if(null===l)i.push(c),s=c;else if(a<l[0])l[0]===a+1?(l[0]=a,s=l):(i.unshift(c),s=c);else if(l[1]===a-1)l[1]=a,s=l;else if(o+1<i.length&&i[o+1][0]===a+1){const e=i[o+1];e[0]=a,s=e}else a>l[1]&&(o===i.length-1?(i.push(c),s=c):(i.splice(o+1,0,c),s=c));(()=>{for(let e=0;e<i.length;e++){const t=i[e],s=i[e+1];!s||t[1]!==s[0]&&t[1]!==s[0]-1||(t[1]=s[1],i.splice(e+1,1),e--)}})(),n=i.reduce((e,t)=>e+(t[1]-t[0]),0),t.status.segmentsWatched.trigger(i)};let o=!1;const l=t=>{o!==t&&(e.off("timeupdate",a),t&&e.on("timeupdate",a),o=t)};return[{name:"enableWatchedSegments",onEvent:()=>l(!0)},{name:"disableWatchedSegments",onEvent:()=>l(!1)},{name:"toggleWatchedSegments",onEvent:()=>l(!o)},{name:"watched",onEvent:()=>{const t=e.duration()||1;return{percentage:Math.min(100,Math.ceil(n/t*100)),duration:n}}},{name:"resetWatched",onEvent:()=>{i=[],n=0,s=null,t.status.segmentsWatched.trigger(i)}}]},Ga=e=>({name:"getJwt",onEvent:()=>e.jwt||""}),Xa=(e,t)=>[{name:"ackJwtRequest",onEvent:({guid:i,requestId:s})=>{e.guid===i&&(s&&e.requestId!==s||t.wpcom.tokenRequestAck.trigger(i))}},{name:"setJwt",onEvent:({guid:i,jwt:s,requestId:n})=>{n&&e.requestId!==n||(e.guid===i?s?(e.jwt=s,t.wpcom.tokenReceived.trigger(i,s)):e.tokenError="jwt missing from token response":e.tokenError="Guid mismatch")}},{name:"tokenRequestAck"},{name:"tokenReceived"},{name:"tokenExternalAuthError"},{name:"triggerTokenExternalAuthError",onEvent:()=>t.wpcom.tokenExternalAuthError.trigger()}],Ka=e=>[{name:"setPrivacyDetails",onEvent:t=>{e.privacyDetails=t}}],Ya=(e,t,i,s)=>{const n=e=>{if(null===e)return null;const i=e.indexOf("?")>-1?"&":"?";return e+i+"metadata_token="+encodeURIComponent(t.jwt)},r=(s,r,a,l=!1)=>{const{m:c,d:u,y:d}=r,h={};u&&c&&d&&(h.birth_month=c,h.birth_day=u,h.birth_year=d),t.jwt.length&&(h.metadata_token=t.jwt);let p="https://public-api.wordpress.com/rest/v1.1/videos/"+s;return Object.keys(h).forEach((e,t)=>{p+=(0===t?"?":"&")+e+"="+h[e]}),new Promise((c,u)=>{fetch(p,{method:"GET",headers:{"content-type":"application/json"}}).then(e=>e.json()).then(d=>{if(d&&d.upload_date)d=(i=>{if(!i||!t.jwt||!i.files)return i;const s={};return s.files=Object.keys(i.files).reduce((e,t)=>{const s=i.files[t],r=Object.keys(s).reduce((e,t)=>(e[t]=n(s[t]),e),{});return e[t]=r,e},{}),s.tracks=Object.keys(i.tracks).reduce((e,t)=>{const s=i.tracks[t];return e[t]=Object.keys(s).reduce((e,t)=>{const i=s[t];return i.src=n(i.src),e[t]=i,e},{}),e},{}),s.poster=n(i.poster),s.original=n(i.original),i.adaptive_streaming&&(s.adaptive_streaming=n(i.adaptive_streaming)),i.adaptive_streaming_r&&e.state.overrideNativeHls&&(s.adaptive_streaming=n(i.adaptive_streaming_r)),i.thumbnails_grid&&i.thumbnails_grid.files&&(s.thumbnails_grid=Object.assign({},i.thumbnails_grid,{files:i.thumbnails_grid.files.map(e=>Object.assign({}
2,e,{file:n(e.file)}))})),Object.assign({},i,s)})(d),i.wpcom.videoInfoFetched.trigger(d,a),c(d);else{const e=new Error(d?d.message:"Unknown");if(!l&&d&&"auth"===d.error)return void o(s,r,a,!0);e.code=d?d.error:null,e.errorMessage=d?d.message:null,i.wpcom.videoInfoFetchError.trigger(e,a),u(e)}},()=>{const e=new Error;e.errorMessage="Unknown",i.wpcom.videoInfoFetchError.trigger(e,a),u(e)})})},a=async e=>new Promise(t=>setTimeout(t,e)),o=(e,s,n,o=!1)=>new Promise(async(l,c)=>{t.guid=e,t.tokenError=!1,t.requestId=`${e}-${Math.floor(1e5*Math.random())}`;let u=!1,d=!1;const h=i.wpcom.tokenReceived.on(()=>u=!0),p=i.wpcom.tokenExternalAuthError.on(()=>{t.tokenError=!0,u=!0}),m=i.wpcom.tokenRequestAck.on(()=>d=!0);i.wpcom.tokenRequest.trigger(e,t.requestId,o);let g=0;for(;!u&&g<30&&(await a(500),!d);)g++,i.wpcom.tokenRequest.trigger(e,t.requestId,o);let f=0;for(;!u&&f<3e4&&(await a(200),f+=200,!t.tokenError););if(i.wpcom.tokenReceived.off(h),i.wpcom.tokenExternalAuthError.off(p),i.wpcom.tokenRequestAck.off(m),u&&t.jwt.length)return t.guid="",r(e,s,n,o).then(e=>l(e)).catch(e=>c(e));t.guid="";const y=new Error(t.tokenError?"Authentication error.":"Post message timed out.");if(t.tokenError&&(y.code="auth"),t.privacyDetails){const e=t.privacyDetails;if(e.provider&&(y.code=e.provider),e.unauthorized_message){const t=e.title?e.title:"This video is private";y.title=t,y.message=e.unauthorized_message}}i.wpcom.videoInfoFetchError.trigger(y,n),c(y)});return[{name:"videoInfo",onEvent:(e,i,n)=>{if(t.guid!==e)return s.isPrivate&&!t.jwt?o(e,i,n):r(e,i,n)}},{name:"tokenRequest"},{name:"videoInfoFetchError"},{name:"videoInfoFetched"}]},Qa=[(e,t,i,s)=>{const n=[Ta(e),ba(e),Ma(e,t),Oa(e),Na(e),Ra(e),Ua(e)];return s||n.push(((e,t)=>({name:"setBorderColors",onEvent:e=>{if(!Array.isArray(e)||4!==e.length||e.some(e=>"string"!=typeof e))throw new Error("Border colors must be an array of 4 strings");t.status.borderColorsChanged.trigger(e)},onPublicCall:()=>{throw"not public"}}))(0,t)),["controls",n]},(e,t,i,s)=>{const n=[...Ba(e,t)];return s||n.push({name:"optionsChanged"}),["customize",n]},(e,t)=>{const i={videoInfo:{}};return["info",[{name:"_postInit",onEvent:()=>{t.wpcom.videoInfoFetched.on(e=>{i.videoInfo=JSON.parse(JSON.stringify(e)),t.info.infoUpdated.trigger()})}},{name:"infoUpdated"},ja(e,t),...Fa(e,t),qa(i),za(i),$a(i),Ha(i),Va(e),...Wa(e,t)]]},(e,t)=>["status",[...Ca(e,t),...Ea(e,t),Sa(e),...wa(t),xa(e,t),Ia(e,t),Aa(e,t),...Pa(e),...Da(e,t),{name:"segmentsWatched"},ka(e,t)]],(e,t,i,s)=>{const n={jwt:i.token||"",guid:"",tokenError:!1,privacyDetails:i.privacyDetails||{}};return["wpcom",s?[]:[...Xa(n,t),...Ka(n),Ga(n),...Ya(e,n,t,i)]]}];function Za(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const Ja=class{constructor(e,t){Za(this,"initRegistry",(e,t)=>{const i=[];Qa.forEach(s=>{const[n,r]=s(e,this,t,!1);this[n]={},r.forEach(e=>{const t=e.name;"_postInit"===t?i.push(e.onEvent):e.onEvent?this[n][t]=this.generateEndpointFunction(e):this[n][t]=this.generateEndpointEvent()})}
2),i.forEach(e=>{e()})}),Za(this,"generateEndpointEvent",()=>new class{constructor(){Za(this,"on",e=>{const t=this.currentId++;return this.callbacks[t]=e,t}),Za(this,"off",e=>{e in this.callbacks&&delete this.callbacks[e]}),Za(this,"trigger",(...e)=>{Object.keys(this.callbacks).forEach(t=>this.callbacks[t](...e))}),this.currentId=0,this.callbacks={}}}),Za(this,"generateEndpointFunction",e=>(t,...i)=>new Promise((s,n)=>{try{t&&e.onPublicCall&&e.onPublicCall();const r=e.onEvent(...i);null!==r&&"object"==typeof r&&"function"==typeof r.then?r.then(s).catch(n):s(r)}catch(e){n(e)}})),this.initRegistry(e,t)}};function eo(e){const t=e.textTracks();let i=null;for(let e=0;e<t.length;e++)if("segment-metadata"===t[e].label){i=t[e];break}if(!i||!i.cues||!i.cues.length)return;const s=e.qualityLevels(),n=s.selectedIndex;if(n<0)return;const r=s[n].height;if(!r)return;let a;try{a=e.tech({IWillNotUseThisInPlugins:!0}).vhs}catch{return}const o=a.playlistController_?a.playlistController_.sourceUpdater_:null;if(!o)return;const l=i.cues,c=[];let u=null,d=null;for(let e=0;e<l.length;e++){const t=l[e].value?l[e].value.resolution:null,i=t?t.height:0;i>0&&i<r?(null===u&&(u=l[e].startTime),d=l[e].endTime):null!==u&&(c.push({start:u,end:d}),u=null,d=null)}if(null!==u&&c.push({start:u,end:d}),!c.length)return;let h=0;const p=()=>{if(h>=c.length)return;const e=c[h++];o.removeVideo(e.start,e.end,()=>{o.removeAudio(e.start,e.end,p)})};p()}function to(e,i={}){const s="v2"===i.chrome,r=[],{useAverageColor:a=!1}=i,o={};if(!a){const{seekbarColor:e="",seekbarPlayedColor:t="",seekbarLoadedColor:s=""}=i;ya.test(e)&&r.push(_a(".vjs-slider",e),va(".vjs-slider",e)),ya.test(t)&&(r.push(_a(".vjs-play-progress",t),va(".vjs-play-progress",t),va(".vp2-seek__dot",t),va(".vp2-seek__ghost",`color-mix(in srgb, ${t} 50%, #fff)`)),o.progressColor=t),ya.test(s)&&(r.push(_a(".vjs-load-progress",s),va(".vjs-load-progress",s)),r.push(_a(".vjs-load-progress div",s),va(".vjs-load-progress div",s)),o.progressBackgroundColor=s)}const l=t().getElementsByTagName("head")[0],c=t().createElement("style"),u=r.join("");c.type="text/css",c.appendChild(t().createTextNode(u)),l.appendChild(c);const d=(!n.default.browser.IS_ANY_SAFARI||!!i.overrideNativeHls||K(i.guid))&&!(!window.MediaSource&&!window.ManagedMediaSource);d&&n.default.browser.IS_ANY_SAFARI&&(e.disableRemotePlayback=!0);let h=!1;try{localStorage.length,h=!0}catch{}const p={responsive:!0,controls:!0,crossOrigin:"anonymous",preload:"metadata",muted:!1,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],inactivityTimeout:n.default.browser.TOUCH_ENABLED?5e3:1500,nativeControlsForTouch:!1,loadingSpinner:!1,resizeManager:!0,persistTextTrackSettings:!0,controlBar:{children:[n.default.browser.TOUCH_ENABLED?{}:{name:"playToggle"},n.default.browser.TOUCH_ENABLED?{name:"muteToggle"}:{name:"volumePanel"},{name:"currentTimeDisplay"},{name:"timeDivider"},{name:"durationDisplay"},{name:"liveDisplay"},{name:"chapterTitleButton"},{name:"customControlSpacer"},{name:"captionsToggleButton"},{name:"settingsMenuButton",entries:["playbackRateMenuButton","maxQualityButton","settingsMenuCapsButton"]},window.WebKitPlaybackTargetAvailabilityEvent?{name:"airplayButton"}:{},window.chrome?{name:"castButton"}:{},t().pictureInPictureEnabled?{name:"pictureInPictureToggle"}:{},{name:"fullscreenToggle"},{name:"progressControl"}]},html5:{vhs:{useDevicePixelRatio:!0,overrideNative:d,useBandwidthFromLocalStorage:h,bandwidth:16e6},nativeAudioTracks:!d,nativeVideoTracks:!d},textTrackDisplay:{allowMultipleShowingTracks:!0},userActions:{hotkeys:e=>{g.handleHotkeys(e)},click:()=>{if(s){if(g.vp2Store?.getSnapshot().openPanel)return void g.vp2Store.setOpenPanel(null)}else{const e=g.controlBar.settingsMenuButton,t=g.controlBar.chapterTitleButton;if(e&&e.isShowingMenuOrDetailView()||t&&t.isMenuOpen())return}g.paused()?g.play():g.pause()}}};if(s&&(p.controlBar={children:[{name:"progressControl"}]}),i.translations){const{language:e,languages:t}=i.translations;e&&t&&t[e]&&(p.language=e,p.languages=t)}i.hd&&(p.html5.vhs.limitRenditionByPlayerDimensions=!1,p.html5.vhs.bandwidth=Number.MAX_SAFE_INTEGER);const m=n.default.obj.merge(p,(e=>{const t=["autoplay","bypassAgeGate","defaultLangCode","fill","height","loop","mentalHealthFilterLevel","muted","playsinline","poster","preload","width"],i={autoPlay:"autoplay",preloadContent:"preload"},s=[];return Object.keys(e).forEach(n=>{t.indexOf(n)>-1?s[n]=e[n]:Object.keys(i).indexOf(n)>-1&&(s[i[n]]=e[n])}),s})(i));m.autoplay&&(m.autoplay="any");const g=(0,n.default)(e,m,function(){s&&hr(g,{endScreen:!1!==i.endScreen,title:!1!==i.title,branding:!1!==i.branding}),g.setState({overrideNativeHls:d}),g.on("loadeddata",()=>{if(isNaN(i.at))return;const e=parseInt(i.at);e<=g.duration()&&g.currentTime(e)}),g.ttfp(),g.averageSeekbarColor(i),g.networkStatus(i),g.apiFetch(i),g.convert
2ing(o),g.api.wpcom.onVideoInfoFetched(e=>function(e,t){return!(!t||!t.preload_disabled||(e.preload("none"),0))}(g,e)),g.director(i),g.videoDimensions(),g.chaptersMarkers(s?{...i,renderMarkers:!1}:i),g.cast(i),isNaN(i.at)&&g.playbackProgress(i),g.postMessageApi(i),g.stats(),g.keyboardNavigation(),g.thumbnails(s?{...i,mode:"headless"}:i),g.reloadSourceOnError({getSource:e=>{const t=g.error(),i=t?t.code:null;if(null===t||MediaError.MEDIA_ERR_NETWORK===i)return;if(MediaError.MEDIA_ERR_DECODE!==i)return void e(g.src());const s=t.message;let n=null;if(s.split(" ").some(e=>!!e.endsWith("m3u8")&&(n=e,!0)),null===n)return g.director().setVideoSource(g.director().state.videoInfo,"dvd"),void e(g.src());const r=n.replace(".playlist.m3u8","").replace(".audio.m3u8","");let a=null;if(Object.keys(g.director().state.videoInfo.format_meta).some(e=>!!r.endsWith(e)&&(a=e,!0)),null===a)return;const o=g.state.formatsToCacheBust??{};1<=o[a]?o[a]+=1:o[a]=1,g.setState({formatsToCacheBust:o}),g.director().setVideoSource(g.director().state.videoInfo)},errorInterval:5}),g.on("xhr-hooks-ready",()=>{g.tech({IWillNotUseThisInPlugins:!0}).vhs.xhr.onRequest(e=>{const t={};if(0!==e.uri.indexOf("https://videos.files.wordpress.com"))return e;if(g.state.metadataToken&&(t.metadata_token=g.state.metadataToken),"object"==typeof g.state.formatsToCacheBust){const i=e.uri;for(const e in g.state.formatsToCacheBust){const s=g.state.formatsToCacheBust[e],n=new RegExp("_"+e+"(\\.audio)?\\.mp4\\??");null!==i.match(n)&&(t.cachebust=s)}}let i="?";return Object.keys(t).forEach(s=>{-1<e.uri.indexOf(i)&&(i="&"),e.uri+=`${i}${s}=${t[s]}`}),e}),g.on("seeking",()=>{g.currentTime()<1&&eo(g)}),g.on("ended",()=>{eo(g)})}),i.useCoverPlaylistAlgorithm&&(p.html5.vhs.limitRenditionByPlayerDimensions=!1);const e=t().createElement("div");e.className="videopress-overlay",g.addChild("Component",{el:e},3),i.mentalHealthFilterLevel&&(g.addClass("videopress-mental-health-filter"),g.el().style.setProperty("--vp-blur-amount",i.mentalHealthFilterLevel+"px")),t().pictureInPictureEnabled&&g.addClass("videopress-has-pip"),n.default.browser.TOUCH_ENABLED?g.addChild("PlayToggle",{},4).addClass("videopress-touch-play-toggle"):s||g.addChild("PlayPauseAnimation"),$()&&g.volume($()),g.on("volumechange",()=>{!function(e){e<=1&&e>=0&&Q("volume",Math.round(100*e))}(g.volume())}),s||(this.spinner=g.addChild("Spinner",{className:"videopress-spinner__waiting"}),g.on("waiting",()=>{this.spinner.show()}),g.on(["playing","canplay","canplaythrough","ended"],()=>{this.spinner.hide()})),t().addEventListener("touchstart",e=>{const t=g.el(),i=e.targetTouches;for(let e=0;e<i.length;++e){const s=i.item(e);if(t.contains(s.target))return void(g.options().inactivityTimeout=p.inactivityTimeout)}g.options().inactivityTimeout=1,g.userActive(!1)}),g.on("mouseenter",()=>{g.options().inactivityTimeout=p.inactivityTimeout}),g.on("mouseleave",()=>{g.options().inactivityTimeout=1}),g.api.status.onFullscreenChanged(()=>{g.el().focus()});try{g.addChild("FirstFocusAnchor",{},0),g.addChild("LastFocusAnchor")}catch{}});return g.apiRegistry=new Ja(g,i),g.api=(e=>({controls:{play:()=>new Promise((t,i)=>e.controls.play(!1).then(t).catch(i)),pause:()=>new Promise((t,i)=>e.controls.pause(!1).then(t).catch(i)),seek:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.controls.seek(!1,t).then(i).catch(s);s("Invalid argument provided for timeMs")}),volume:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.controls.volume(!1,t).then(i).catch(s);s("Invalid argument provided for volume")}),mute:t=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.controls.mute(!1,t).then(i).catch(s))),fullscreen:t=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.controls.fullscreen(!1,t).then(i).catch(s))),setChapters:t=>new Promise((i,s)=>{if(Array.isArray(t))return e.controls.setChapters(!1,t).then(i).catch(s);s("Invalid argument provided for chapters")}),setBorderColors:t=>new Promise((i,s)=>{if(Array.isArray(t))return e.controls.setBorderColors(!1,t).then(i).catch(s);
2s("Invalid argument provided for colors")})},customize:{get:t=>new Promise((i,s)=>(t=String(t),e.customize.get(!1,t).then(i).catch(s))),set:t=>new Promise((i,s)=>{if("object"==typeof t)return e.customize.set(!1,t).then(i).catch(s);s("Invalid argument provided for options")}),onOptionsChanged:t=>e.customize.optionsChanged.on(t),offOptionsChanged:t=>e.customize.optionsChanged.off(t)},info:{onInfoUpdated:t=>e.info.infoUpdated.on(t),offInfoUpdated:t=>e.info.infoUpdated.off(t),duration:(t=JSON.parse(!1))=>new Promise((i,s)=>(t=(!("toLowerCase"in Object(t))||"false"!==t.toLowerCase()&&"0"!==t)&&Boolean(t),e.info.duration(!1,t).then(i).catch(s))),dimensions:()=>new Promise((t,i)=>e.info.dimensions(!1).then(t).catch(i)),onDimensionsChanged:t=>e.info.dimensionsChanged.on(t),offDimensionsChanged:t=>e.info.dimensionsChanged.off(t),guid:()=>new Promise((t,i)=>e.info.guid(!1).then(t).catch(i)),title:()=>new Promise((t,i)=>e.info.title(!1).then(t).catch(i)),poster:()=>new Promise((t,i)=>e.info.poster(!1).then(t).catch(i)),privacy:()=>new Promise((t,i)=>e.info.privacy(!1).then(t).catch(i)),getThumbnailSample:t=>new Promise((i,s)=>{if(t=Number(t),!isNaN(t))return e.info.getThumbnailSample(!1,t).then(i).catch(s);s("Invalid argument provided for count")}),enableWatchedSegments:()=>new Promise((t,i)=>e.info.enableWatchedSegments(!1).then(t).catch(i)),disableWatchedSegments:()=>new Promise((t,i)=>e.info.disableWatchedSegments(!1).then(t).catch(i)),toggleWatchedSegments:()=>new Promise((t,i)=>e.info.toggleWatchedSegments(!1).then(t).catch(i)),watched:()=>new Promise((t,i)=>e.info.watched(!1).then(t).catch(i)),resetWatched:()=>new Promise((t,i)=>e.info.resetWatched(!1).then(t).catch(i))},status:{fullscreen:()=>new Promise((t,i)=>e.status.fullscreen(!1).then(t).catch(i)),onFullscreenChanged:t=>e.status.fullscreenChanged.on(t),offFullscreenChanged:t=>e.status.fullscreenChanged.off(t),player:()=>new Promise((t,i)=>e.status.player(!1).then(t).catch(i)),onPlayerStatusChanged:t=>e.status.playerStatusChanged.on(t),offPlayerStatusChanged:t=>e.status.playerStatusChanged.off(t),audio:()=>new Promise((t,i)=>e.status.audio(!1).then(t).catch(i)),playbackTime:()=>new Promise((t,i)=>e.status.playbackTime(!1).then(t).catch(i)),onPlaybackTimeUpdated:t=>e.status.playbackTimeUpdated.on(t),offPlaybackTimeUpdated:t=>e.status.playbackTimeUpdated.off(t),onTimeUpdate:t=>e.status.timeUpdate.on(t),offTimeUpdate:t=>e.status.timeUpdate.off(t),onChaptersChapterChange:t=>e.status.chaptersChapterChange.on(t),offChaptersChapterChange:t=>e.status.chaptersChapterChange.off(t),onChaptersTrackChange:t=>e.status.chaptersTrackChange.on(t),offChaptersTrackChange:t=>e.status.chaptersTrackChange.off(t),onBorderColorsChanged:t=>e.status.borderColorsChanged.on(t),offBorderColorsChanged:t=>e.status.borderColorsChanged.off(t),borderColors:()=>new Promise((t,i)=>e.status.borderColors(!1).then(t).catch(i)),onError:t=>e.status.error.on(t),offError:t=>e.status.error.off(t),onSegmentsWatched:t=>e.status.segmentsWatched.on(t),offSegmentsWatched:t=>e.status.segmentsWatched.off(t),onPlaybackRateUpdate:t=>e.status.playbackRateUpdate.on(t),offPlaybackRateUpdate:t=>e.status.playbackRateUpdate.off(t)},wpcom:{ackJwtRequest:t=>new Promise((i,s)=>{if("object"==typeof t)return e.wpcom.ackJwtRequest(!1,t).then(i).catch(s);s("Invalid argument provided for data")}),setJwt:t=>new Promise((i,s)=>{if("object"==typeof t)return e.wpcom.setJwt(!1,t).then(i).catch(s);s("Invalid argument provided for data")}),onTokenRequestAck:t=>e.wpcom.tokenRequestAck.on(t),offTokenRequestAck:t=>e.wpcom.tokenRequestAck.off(t),onTokenReceived:t=>e.wpcom.tokenReceived.on(t),offTokenReceived:t=>e.wpcom.tokenReceived.off(t),onTokenExternalAuthError:t=>e.wpcom.tokenExternalAuthError.on(t),offTokenExternalAuthError:t=>e.wpcom.tokenExternalAuthError.off(t),triggerTokenExternalAuthError:()=>new Promise((t,i)=>e.wpcom.triggerTokenExternalAuthError(!1).then(t).catch(i)),setPrivacyDetails:t=>new Promise((i,s)=>{if("object"==typeof t)return e.wpcom.setPrivacyDetails(!1,t).then(i).catch(s);s("Invalid argument provided for details")}),getJwt:()=>new Promise((t,i)=>
2e.wpcom.getJwt(!1).then(t).catch(i)),videoInfo:(t,i=JSON.parse({}),s=JSON.parse(!1))=>new Promise((n,r)=>{if(t=String(t),"object"==typeof i)return s=(!("toLowerCase"in Object(s))||"false"!==s.toLowerCase()&&"0"!==s)&&Boolean(s),e.wpcom.videoInfo(!1,t,i,s).then(n).catch(r);r("Invalid argument provided for birthDate")}),onTokenRequest:t=>e.wpcom.tokenRequest.on(t),offTokenRequest:t=>e.wpcom.tokenRequest.off(t),onVideoInfoFetchError:t=>e.wpcom.videoInfoFetchError.on(t),offVideoInfoFetchError:t=>e.wpcom.videoInfoFetchError.off(t),onVideoInfoFetched:t=>e.wpcom.videoInfoFetched.on(t),offVideoInfoFetched:t=>e.wpcom.videoInfoFetched.off(t)}}))(g.apiRegistry),i?.cover&&g.addClass("videopress-cover"),!1===(i?.controls??!0)?(g.addClass("videopress-controls-disabled"),g.on("touchend",e=>{"VIDEO"===e.target.tagName&&(g.paused()?g.play():g.pause())})):g.mobileUi({fullscreen:{enterOnRotate:!1,exitOnRotate:!1,lockOnRotate:!1},touchControls:{seekSeconds:10,tapTimeout:300,disableOnEnd:!1}}),g.posterImage&&g.posterImage.crossOrigin(null),g}n.default.registerComponent("Spinner",a),n.default.registerComponent("ErrorScreen",class extends d{constructor(e,t){super(e,t),this.player=e,this.options=t}showPrivacyError(){const e=`\n<h3>${this.localize("This video is private")}</h3>\n<p>${this.localize("Make sure you are signed in and a member of the site.")} <a href="https://wordpress.com/support/videopress/#private-videos" target="_blank">${this.localize("Learn More")}</a></p>\n`;this.showError({message:e,icon:o})}showRestrictedVideoError(e){const t=e?this.localize("This video belongs to a site in trial mode. Only the site owner is able to view it at this time."):this.localize("This siteâs video trial has expired."),i=`\n<h3>${this.localize("This video isnât available.")}</h3>\n<p>${t}</p>\n`;this.showError({message:i,icon:o})}showError({message:e,icon:t=o,title:i=null,iconSize:s=[36,36]}){const n=document.createElement("div");n.innerHTML=this._renderErrorScreen({icon:t,message:e,title:i,iconSize:s}),this.player.createModal(n,{uncloseable:!0}).open()}_renderErrorScreen({icon:e=o,message:t="Unknown Error",title:i=null,iconSize:s=[36,36]}){const n=i?'<h3 class="videopress-error-title">'+c(u(i))+"</h3>":"";return`\n<div class="vjs-modal-dialog videopress-error-screen">\n\t<img\n\t\tsrc=${e}\n\t\twidth="${s[0]}"\n\t\theight="${s[1]}"\n\t/>\n\t${n}\n\t<span class="videopress-error-message">${t}</span>\n</div>\n<div class="videopress-error-screen__vp-logo">\n\t<img\n\t\tsrc=${l}\n\t\twidth="29"\n\t\theight="21"\n\t\talt="VideoPress"\n\t/>\n</div>`}}),n.default.registerComponent("FirstFocusAnchor",p),n.default.registerComponent("LastFocusAnchor",p),n.default.registerComponent("ProgressControl",Ze("ProgressControl",b)),n.default.registerComponent("SeekBar",Ze("SeekBar",T)),n.default.registerComponent("TextTrackSettings",Ze("TextTrackSettings",n.default.getComponent("TextTrackSettings"))),n.default.registerPlugin("averageSeekbarColor",class extends _r{constructor(e,t){if(super(e,t),!t.guid)return;if(!1===t.controls)return;const{useAverageColor:i=!1}=t;this.rootElement=document.querySelector(":root"),this.playProgressBar=e.getDescendant(["controlBar","progressControl","seekBar","playProgressBar"]),this.loadProgressBar=e.getDescendant(["controlBar","progressControl","seekBar","loadProgressBar"]);let s=-1;const n=(e,t)=>{this.rootElement.style.setProperty(e,t);const i="function"==typeof this.player.el?this.player.el():null;i&&i.style.setProperty(e,t)},r=()=>{this.getAverageColor().getColorAsync(this.player.tech({IWillNotUseThisInPlugins:!0}).el(),{algorithm:"vibrant"}).then(e=>{e&&void 0!==this.playProgressBar&&(n("--vp-color-vjs-play-progress",e),void 0!==this.loadProgressBar&&this.loadProgressBar.el().getElementsByTagName("div")[0]&&this.rootElement.style.setProperty("--vp-color-vjs-load-progress",o(e,.5)))})},a=()=>{this.getAverageColor().getBorderColorsAsync(this.player.tech({IWillNotUseThisInPlugins:!0}).el(),t).then(e=>{e&&void 0!==this.playProgressBar&&this.player.api.controls.setBorderColors(e)})},o=function(e,t=1){return e.replace("rgb(","rgba(").replace(")",`, ${t.toString()})`)};e.on("timeupdate",()=>{const t=Math.round(e.currentTime());0===t&&-1!==s||i&&0==t%2&&s!==t&&(s=t,r(),a())}),e.on("seeked",()=>{i&&r()})}getAverageColor(){return this.averageColor||(this.averageColor=new yr),this.averageColor}dispose(){this.averageColor&&this.averageColor.destroy()}}),n.default.registerPlugin("keyboardNavigation",class extends Fr{constructor(e,t){super(e,t),Br(this,"installEventListener",()=>{this.player.on("keyup",e=>
2this.onKeyUp(e)),this.player.on("keydown",e=>this.onKeyDown(e)),this.player.on("keypress",e=>this.onKeyDown(e)),this.player.on("blur",()=>this.removeKeyboardNavigationClass()),this.player.on("click",()=>this.removeKeyboardNavigationClass())}),Br(this,"removeKeyboardNavigationClass",()=>{this.player.hasClass(jr)&&this.player.removeClass(jr)}),Br(this,"addKeyboardNavigationClass",()=>{this.player.hasClass(jr)||this.player.addClass(jr)}),Br(this,"initFocusableComponents",()=>{this.focusableComponents=[];const e=e=>{if(e){const t=e.el();t&&(t.tabIndex=-1),this.focusableComponents.push(e)}};e(this.player.getChild("FirstFocusAnchor"));const t=this.player.controlBar;t&&(e(t.playToggle),e(t.volumePanel),t.chapterTitleButton&&e(t.chapterTitleButton),t.chaptersButton&&e(t.chaptersButton),e(t.settingsMenuButton),e(t.pictureInPictureToggle),e(t.fullscreenToggle)),Qe(this.player)&&this.player.el().querySelectorAll("[data-vp2-focus]").forEach(e=>{e.tabIndex=-1,this.focusableComponents.push({el:()=>e,name:()=>e.dataset.vp2Focus,focus:()=>e.focus()})});const i=this.player.getChild("ShareButton");if(i){const t=i.getChild("Button");t&&e(t)}e(this.player.getChild("LastFocusAnchor"))}),Br(this,"isPanelOpen",()=>Qe(this.player)&&!!this.player.vp2Store?.getSnapshot().openPanel),Br(this,"onKeyUp",e=>{if(e.key)switch(e.key){case x.Escape:this.removeKeyboardNavigationClass();break;case x.ArrowRight:if(this.isPanelOpen())break;200<Date.now()-this.lastArrowDownEvent&&this.handleArrowRightEvent(e);break;case x.ArrowLeft:if(this.isPanelOpen())break;200<Date.now()-this.lastArrowDownEvent&&this.handleArrowLeftEvent(e)}}),Br(this,"onKeyDown",e=>{if(e.key)switch(e.key){case x.Tab:if(this.isPanelOpen()){const e="chapters"===this.player.vp2Store.getSnapshot().openPanel?"chapter":"settings",t=this.focusableComponents.findIndex(t=>e===t.name());t>-1&&(this.focusedIndex=t)}const t=this.focusableComponents[this.focusedIndex];if(t&&(e.shiftKey&&"FirstFocusAnchor"===t.name()||!e.shiftKey&&"LastFocusAnchor"===t.name()))return;e.preventDefault(),e.shiftKey?this.focusOnPrevItem():this.focusOnNextItem();break;case x.ArrowRight:if(this.isPanelOpen()){this.lastArrowDownEvent=Date.now();break}this.lastArrowDownEvent=Date.now(),this.handleArrowRightEvent(e);break;case x.ArrowLeft:if(this.isPanelOpen()){this.lastArrowDownEvent=Date.now();break}this.lastArrowDownEvent=Date.now(),this.handleArrowLeftEvent(e);break;case x.GreaterThan:this.handleGreaterThanEvent(e);break;case x.LessThan:this.handleLessThanEvent(e)}}),Br(this,"isVolumePanelFocused",()=>{const e=document.activeElement;return!!e&&this.player.el().contains(e)&&!!e.closest(".vjs-volume-panel")}),Br(this,"handleArrowRightEvent",e=>{e.preventDefault(),this.isVolumePanelFocused()?this.handleVolumeUp():this.handleEventForward()}),Br(this,"handleArrowLeftEvent",e=>{e.preventDefault(),this.isVolumePanelFocused()?this.handleVolumeDown():this.handleEventBackward()}),Br(this,"handleGreaterThanEvent",e=>{e.preventDefault();const t=this.player.playbackRates(),i=this.player.playbackRate();t.indexOf(i)!==t.length-1&&this.player.playbackRate(t[t.indexOf(i)+1])}),Br(this,"handleLessThanEvent",e=>{e.preventDefault();const t=this.player.playbackRates(),i=this.player.playbackRate();0!==t.indexOf(i)&&this.player.playbackRate(t[t.indexOf(i)-1])}),Br(this,"handleEventForward",()=>{const e=!this.player.paused(),t=this.player.duration();let i=this.player.currentTime()+5;i>=t&&(i=e?t-.001:t),this.player.currentTime(i)}),Br(this,"handleEventBackward",()=>{const e=Math.max(0,this.player.currentTime()-5);this.player.currentTime(e)}),Br(this,"handleVolumeDown",()=>{const e=this.player.volume();if(e>0){const t=Math.max(0,Math.min(1,e-.1));this.player.volume(t),t<=0&&this.player.muted(!0)}}),Br(this,"handleVolumeUp",()=>{const e=this.player.muted()?0:this.player.volume();if(e<1){const t=Math.max(.1,Math.min(1,e+.1));this.player.volume(t)}this.player.muted()&&this.player.muted(!1)}),Br(this,"focusOnNextItem",()=>this.focusOnItemInDirection(1)),Br(this,"focusOnPrevItem",()=>this.focusOnItemInDirection(-1)),Br(this,"focusOnItemInDirection",e=>{if(this.addKeyboardNavigationClass(),this.focusableComponents.length<=0)return;if(e>=0?this.focusedIndex+=1:this.focusedIndex-=1,this.focusedIndex<0||this.focusedIndex>=this.focusableComponents.length)return void(this.focusedIndex=Math.max(-1,Math.min(this.focusedIndex,this.focusableComponents.length-1)));const t=this.focusableComponents[this.focusedIndex].el();if(!t||t.classList.contains("vjs-hidden")||t.isConnected&&null===t.offsetParent)return this.focusOnItemInDirection(e);this.focusableComponents[this.focusedIndex].focus()}),this.focusedIndex=-1,this.focusableComponents=[],this.lastArrowDownEvent=0,e.api.wpcom.onVideoInfoFetched(()=>{this.installEventListener(),this.initFocusableComponents()}),e.on("vp2-chrome-rendered",()=>{this.initFocusableComponents();const e=this.focusableComponents.findIndex(e=>e.el()===document.activeElement);this.focusedIndex=e>-1?e:Math.max(-1,Math.min(this.focusedIndex,this.focusableComponents.length-1))})}}),n.default.registerPlugin("playbackProgress",class extends $r{constructor(e,t){if(super(e,t),function(){const e=new Date;e.setDate(e.getDate()-7);let t=null;try{t=Object.keys(localStorage)}catch{}null!==t&&t.forEach(t=>{if(0===t.indexOf(j)){const i=t.substring(21),s=Y(j+i);try{const t=JSON.parse(s);(null===t||new Date(t.expiry)<=e)&&G(i)}catch{G(i)}}})}(),!t.guid)return;let i=0;const s=e=>{i=e,W(t.guid,i)};e.on("timeupdate",()=>{const t=Math.round(e.currentTime());0==t%5&&i!==t&&s(t)}),e.on("seeked",()=>{const t=Math.round(e.currentTime());i!==t&&s(t)}),e.on("loadeddata",()=>{if(!e.director().isChangingSrc()&&(i=function(e){const t=Y(j+e);if(null!==t)try{return JSON.parse(t).progress}catch{return null}return null}(t.guid),void 0!==i)){if(i=parseInt(i),0===i)return;i<e.duration()&&e.currentTime(i)}}),e.on("ended",()=>{G(t.guid)})}}),n.default.registerPlugin("postMessageApi",class extends Hr{constructor(e,t){super(e,t),function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(this,"receiveMessage",e=>{const t=this.player.api;if("iframe_ack"!==e.data.event){if("videopress_action_play"===e.data.event&&t.controls.play(),"videopress_action_pause"===e.data.event&&t.controls.pause().then(()=>{const e=this.player.currentTime();this.postMessage({event:"action_pause_response",currentTime:Math.floor(e),currentTimeMs:Math.round(1e3*e)})}),"videopress_action_set_currenttime"===e.data.event){const i=Number(e.data.currentTime);t.controls.seek(1e3*i).catch(e=>e)}if("videopress_action_set_volume"===e.data.event){const i=parseFloat(e.data.volume);t.controls.volume(100*i).catch(e=>e)}"videopress_token_request_ack"===e.data.event&&t.wpcom.ackJwtRequest({guid:e.data.guid,requestId:e.data.requestId}),"videopress_token_received"===e.data.event&&t.wpcom.setJwt({guid:e.data.guid,jwt:e.data.jwt,requestId:e.data.requestId}),"videopress_token_error"===e.data.event&&(e.data.privacyDetails&&t.wpcom.setPrivacyDetails(e.data.privacyDetails),t.wpcom.triggerTokenExternalAuthError()),"videopress_get_thumbnails"===e.data.event&&this.player.thumbnails().trigger("request-thumbnails",{count:e.data.count}),"videopress_get_dimensions"===e.data.event&&t.info.dimensions().then(e=>{e&&this.postDimensions(e)})}else this.postMessage({event:"iframe_ack_response",uid:e.data.uid??""})}),this.setState({guid:t.guid});const i=e.api;i.status.onPlayerStatusChanged((e,t)=>{this.postMessage({event:t})}),i.status.onTimeUpdate(e=>{this.postMessage({event:"timeupdate",currentTime:Math.floor(e),currentTimeMs:Math.round(1e3*e)})}),i.status.onFullscreenChanged(e=>{this.postMessage({event:"toggle_fullscreen",isFullscreen:e})}),i.info.onDimensionsChanged(e=>
2this.postDimensions(e)),this.on(e,["seeking","resize","volumechange"],e=>this.postMessage({event:e.type})),this.on(e,["durationchange"],e=>{const t=this.player.duration();0!==t&&this.postMessage({event:e.type,duration:Math.floor(t),durationMs:Math.round(1e3*t)})}),this.on(e.director(),["toggle-source"],(e,t)=>this.postMessage({event:e.type,qualityLevelInternalName:t.quality})),"undefined"!=typeof window&&window.addEventListener("message",this.receiveMessage)}postMessage(e){if("undefined"==typeof window)return;const t={...e,id:this.state.guid};window.postMessage(t,"*"),parent!==window&&parent.postMessage(t,"*"),t.event&&(t.event=`videopress_${t.event}`),window.postMessage(t,"*"),parent!==window&&parent.postMessage(t,"*")}postDimensions(e){const{width:t,height:i,aspectRatio:s,orientation:n,source:r}=e;this.postMessage({event:"dimensionschange",width:t,height:i,aspectRatio:s,orientation:n,source:r})}sendLoaded(){this.postMessage({event:"loading_state",state:"loaded",converting:!1,processing:!1,fetchingSubs:!1})}}),n.default.registerPlugin("stats",class extends Vr{constructor(e,t){super(e,t),zr(this,"statRequest",null),zr(this,"enabled",!0),zr(this,"sendTTFP",e=>{isNaN(e)||e<0||this.sendStat("ttfp",e.toString())}),zr(this,"sendStat",(e,t="1")=>{this.enabled&&this.player.director().hasVideoInfo()&&(this.statRequest=new Image,this.statRequest.src=this.pixelUrl()+`&video_${e}=`+t)}),zr(this,"sendWatched",e=>{this.enabled&&this.player.director().hasVideoInfo()&&(this.statRequest=new Image,this.statRequest.src=this.pixelUrl()+"&t="+e)}),zr(this,"getVideoFormat",()=>"std"===q()?"fmt_std":"fmt_dvd"),zr(this,"pixelUrl",()=>{const e=this.player.director().state.videoInfo,t=e.guid,i="string"==typeof t&&/^[A-Za-z0-9]{8}$/.test(t)?"&video_guid="+t:"";return"https://pixel.wp.com/v.gif?v=wpcomv&sid=0&site=default&blog="+e.blog_id+"&post="+e.post_id+"&video_fmt="+this.getVideoFormat()+"&page_url="+encodeURIComponent(window.location.href)+"&rand="+Math.random().toString(36).substr(7)+i}),e.on("loadeddata",()=>{this.sendStat("impression")}),e.on("play",()=>{e.director().isChangingSrc()||this.state.playSent||(this.sendStat("play"),this.setState({playSent:!0}))});let i=0;const s=(e,t)=>{const s=Math.round(e);this.sendWatched(s),i=t+(e-s)};e.api.status.onPlaybackTimeUpdated(e=>{const t=e-i;t>=10&&s(t,e)}),e.on("ended",()=>{e.api.status.playbackTime().then(e=>{const t=e-i;t>=.01&&s(t,e)})})}dispose(){}}),n.default.registerPlugin("thumbnails",class extends Xr{constructor(e,t){if(super(e,t),Gr(this,"requestThumbnails",(e,t)=>{const i=[],s=Math.min(isNaN(t.count)?1:t.count,this.state.duration)+1;for(let e=1;e<s;e++){const t=100/s*e/100,n=this.calculateThumbImagePosition(t);n.seekPosition=t*this.state.duration,i.push(n)}window.postMessage({event:"videopress_thumbnail_response",thumbs:i,size:this.getDisplaySize()})}),Gr(this,"videoInfoFetched",e=>{if(void 0===e.thumbnails_grid||e.thumbnails_grid.length<=0||!1===this.areControlsEnabled)return;const t=e.duration/1e3,i=e.thumbnails_grid.grid_interval/1e3,s=this.isReady();if(this.setState({guid:e.guid,duration:t,thumbInterval:i,videoInfo:e}),this.loadThumbnailsArrangement(),this.generateThumbnailTimeline(),this.headless)"none"!==this.player.options().preload&&this.preloadThumbnailUrls();else{null!==this.thumb&&this.player.controlBar.removeChild("Thumbnail"),this.thumb=this.player.controlBar.addChild("Thumbnail",{videoWidth:e.width,videoHeight:e.height,padding:this.padding,maxSheetRows:this.maxSheetRows,maxSheetCols:this.maxSheetCols,thumbHeight:this.thumbHe
2ight}),"none"!==this.player.options().preload&&this.preloadThumbnailUrls();const t=this.player.controlBar.progressControl;n.default.browser.TOUCH_ENABLED?(t.on("touchstart",this.mouseListener),t.on("touchmove",this.mouseListener),t.on("touchend",this.mouseListener),t.on("touchcancel",this.mouseListener)):(t.on("mouseover",this.mouseListener),t.on("mouseout",this.mouseListener),t.on("mousemove",this.mouseListener))}!s&&this.isReady()&&this.player.trigger("vp2-thumbnails-ready")}),Gr(this,"isReady",()=>this.timeline.length>0&&this.state.duration>0),Gr(this,"getDisplaySize",()=>{if(this.thumb&&!this.headless)return{width:this.thumb.getWidth(),height:this.thumb.getHeight()};const e=this.state.videoInfo;if(!e)return{width:0,height:0};let t=this.player.options().height;if(this.player.el){const e=getComputedStyle(this.player.el()),i=parseFloat(e.height);i>0&&(t=i)}return function({playerHeight:e,videoWidth:t,videoHeight:i,maxThumbHeight:s=144}){if(!(t>0&&i>0))return{width:0,height:0};const n=e<=240?3:4;let r=Math.min(s,e/n);return r>0||(r=s),{width:Math.round(t*r/i),height:r}}
2({playerHeight:t,videoWidth:e.width,videoHeight:e.height,maxThumbHeight:this.thumbHeight})}),Gr(this,"getFrameAt",e=>{if(!this.isReady())return null;const{width:t,height:i}=this.getDisplaySize(),s=Wr({fraction:Math.min(Math.max(e,0),1),duration:this.state.duration,totalFramesCount:this.totalFramesCount,gridMax:this.thumbGridMax,gridCols:this.maxSheetCols,gridRows:this.maxSheetRows,displayWidth:t,displayHeight:i});return{sheetUrl:this.thumbUrl(s.thumbFrame),frameLeft:s.thumbFrameLeft,frameTop:s.thumbFrameTop,width:t,height:i,cols:this.maxSheetCols,rows:this.maxSheetRows}}),Gr(this,"isSheetLoaded",e=>!!this.loadedSheets[e]||!!this.preloadThumbImgs.find(t=>t.src===e&&t.complete)&&(this.loadedSheets[e]=!0,!0)),Gr(this,"onSheetLoaded",(e,t)=>{if(e)if(this.isSheetLoaded(e))t(e);else if(this.sheetCallbacks[e]=this.sheetCallbacks[e]||[],this.sheetCallbacks[e].push(t),!this.sheetWatchers[e]){const t=new Image;t.onload=()=>{this.loadedSheets[e]=!0;const t=this.sheetCallbacks[e]||[];this.sheetCallbacks[e]=[],t.forEach(t=>t(e))},t.src=e,this.sheetWatchers[e]=t}}),Gr(this,"loadThumbnailsArrangement",()=>{const e=this.state.videoInfo.thumbnails_grid;this.padding=0,this.thumbGridMax=e.grid_width*e.grid_height,this.maxSheetRows=e.grid_height,this.maxSheetCols=e.grid_width}),Gr(this,"cancelPreloadThumbnailRequests",()=>{this.setState({preloaded:!1}),this.preloadThumbImgs.forEach(e=>e.src="")}),Gr(this,"preloadThumbnailUrls",()=>{if(this.state.preloaded)return;this.cancelPreloadThumbnailRequests();const e=this.getThumbnailUrls();this.preloadThumbImgs=e.reverse().map(e=>{const t=new Image;return t.src=e,t}),this.setState({preloaded:!0})}),Gr(this,"generateThumbnailTimeline",()=>{const{timeline:e,totalFramesCount:t}=function(e){let t=0;const i=[];return e.files.forEach(e=>{i.push(e),t+=e.thumbs_count}),i.sort((e,t)=>e.start_time_ms<t.start_time_ms?-1:1),{timeline:i,totalFramesCount:t}}(this.state.videoInfo.thumbnails_grid);this.totalFramesCount=t,this.timeline=e}),Gr(this,"getThumbnailUrls",()=>{const e=[];return this.timeline.forEach(t=>{e.push(this.thumbUrl(t.start_time_ms/1e3))}),e}),Gr(this,"mouseListener",e=>{const t=this.state.duration,i=this.player.controlBar.progressControl.el();let s=n.default.dom.getPointerPosition(i,e).x;const r=parseInt(i.clientWidth);e.touches&&e.touches.length>0&&(s=e.touches[0].clientX/r);const a=Math.floor(s*r),{thumbSheetUrl:o,thumbFrameLeft:l,thumbFrameTop:c}=this.calculateThumbImagePosition(s);this.updateChaptersIfNecessary(e.type,s*t),-1<["mouseover","touchstart"].indexOf(e.type)||-1<["mousemove","touchmove"].indexOf(e.type)?(this.thumb.show(),this.thumb.setPosition(a,r),this.thumb.setImage(o,l,c,this.preloadThumbImgs)):-1<["mouseout","touchend","touchcancel"].indexOf(e.type)&&this.thumb.hide()}),Gr(this,"updateChaptersIfNecessary",(e,t)=>{if(["mouseover","mousemove","touchmove","touchstart","touchend"].indexOf(e)<0)return;const i=this.player.chaptersMarkers();if(i.hasChapters()){let e=i.getChapterTitleAtTime(t);e.length>20&&(e=e.slice(0,17)+"â¦");const s=n.default.time.formatTime(t,600);this.thumb.setChapterTitle(`${s} â ${e}`)}}),Gr(this,"calculateThumbImagePosition",e=>{const{width:t,height:i}=this.getDisplaySize(),s=Wr({fraction:e,duration:this.state.duration,totalFramesCount:this.totalFramesCount,gridMax:this.thumbGridMax,gridCols:this.maxSheetCols,gridRows:this.maxSheetRows,displayWidth:t,displayHeight:i});return{...s,thumbSheetUrl:this.thumbUrl(s.thumbFrame)}}),Gr(this,"thumbUrl",e=>function({videoInfo:e,timeline:t,at:i,maxThumbHeight:s=144,dpr:n=1}){const r=e.thumbnails_grid,a=e.file_url_base.https,o=r.thumbs_height,l=Math.min(o,s*n)*r.grid_height,c=1e3*i;for(let e=0;e<t.length;++e){const i=t[e],s=e<t.length-1?t[e+1]:null;if(null===s||i.start_time_ms<=c&&null!==s&&s.start_time_ms>c){let e="?h=";return-1!==i.file.indexOf("?")&&(e="&h="),a+i.file+e+l.toString()}}return""}({videoInfo:this.state.videoInfo,timeline:this.timeline,at:e,maxThumbHeight:144,dpr:window.devicePixelRatio??1})),t=n.default.obj.merge(Yr,t),this.headless="headless"===t.mode,this.mode=this.headless?"headless":"default",this.areControlsEnabled=!!t.controls,this.preloadThumbImgs=[],this.padding=2,this.thumbGridMax=100,this.maxSheetRows=Math.sqrt(this.thumbGridMax),this.maxSheetCols=Math.sqrt(this.thumbGridMax),this.thumbHe
2ight=144,this.totalFramesCount=0,this.timeline=[],this.loadedSheets={},this.sheetWatchers={},this.sheetCallbacks={},this.headless){const e=this;this.thumb={get state(){return e.getDisplaySize()},getWidth:()=>e.getDisplaySize().width,getHeight:()=>e.getDisplaySize().height}}n.default.registerComponent("Thumbnail",Zr),e.api.wpcom.onVideoInfoFetched(e=>this.videoInfoFetched(e)),e.one("play",()=>{this.cancelPreloadThumbnailRequests(),t?.autoPlay||e.one("timeupdate",()=>{this.preloadThumbnailUrls()})}),this.on("request-thumbnails",this.requestThumbnails)}}),n.default.registerPlugin("director",class extends Rr{constructor(e,t){super(e,t),Or(this,"shareOptionsInitialized",!1),Or(this,"shareOptionsRun",0),Or(this,"conversionFailed",e=>{const t=e?.files_status??{};return(e?.finished??!1)&&Object.keys(t).every(e=>{const i=t[e];return!i||0===Object.keys(i).length||E===i.mp4})}),Or(this,"conversionModalShouldShow",e=>{const t=e?.files_status??{};return!Object.values(t).some(e=>e?.mp4===k)&&!!Object.values(t).some(e=>"CONVERTING"===e?.mp4)}),Or(this,"getSourcePlaylists",(e,t=null)=>{const i=e.file_url_base,s=e.files;let n=null,r=null,a=null;const o=e.format_meta[t];let l=!1;if(o&&Object.keys(o).length>0&&ee(o.codec)&&(l=!0),s?.[t]&&l?r=t:null!==this.getAdaptiveStreamingPlaylist(e)?n=this.getAdaptiveStreamingPlaylist(e).src:"std"!==t&&s?.dvd?r="dvd":s?.avc_240p?r="avc_240p":s?.std&&(r="std"),r){const e=s[r];n=e.hls_r&&this.player.state.overrideNativeHls?e.hls_r:e.hls,a=e.dash}return[n&&{src:this.hlsManifestSrc(e,n,r&&`${r}-master`),type:"application/x-mpegURL",withCredentials:this.requestShouldIncludeCredentials(e)},a&&{src:i.https+a,type:"application/dash+xml",withCredentials:this.requestShouldIncludeCredentials(e)}].filter(Boolean)}),Or(this,"getAdaptiveStreamingPlaylist",e=>e.adaptive_streaming?{src:this.hlsManifestSrc(e,e.adaptive_streaming,e.adaptive_streaming.match(/\.(adaptive_\d+)\.m3u8/)?.[1]),type:"application/x-mpegURL",withCredentials:this.requestShouldIncludeCredentials(e)}:null),Or(this,"hlsManifestSrc",(e,t,i)=>{let s=ne(e.file_url_base.https,t);return s=this.withPlaylistEndpoint(s,e.guid,i),s=this.withMetadataToken(s),s}),Or(this,"withPlaylistEndpoint",(e,t,i)=>!this.player.state.overrideNativeHls&&e&&!e.startsWith(`${ie}/`)&&i&&t?se(t,i):e),Or(this,"withMetadataToken",e=>{const{metadataToken:t,overrideNativeHls:i}=this.player.state||{};return i?e:re(e,t)}),Or(this,"requestShouldIncludeCredentials",(e,t=window.location.href)=>{if(!e.is_private)return!1;try{return"https://video.wordpress.com"===new URL(t).origin}catch{return!1}}),Or(this,"getFallbackSourceFile",(e,t)=>{const i=e.file_url_base,s=e.files,n=e.format_meta[t];let r=null,a=!1;n&&Object.keys(n).length>0&&ee(n.codec)&&(a=!0);let o=null;return this.selectedQualityExists(s,t)&&a?r=s[t].mp4:"std"!==t&&s?.dvd?(r=s.dvd.mp4,o="dvd"):s?.avc_240p?(r=s.avc_240p.mp4,o="avc_240p"):s?.std&&(r=s.std.mp4,o="std"),r&&{src:i.https+r,fallbackQuality:o}}),Or(this,"setVideoSource",(e,t="dvd")=>{const i=this.getAdaptiveStreamingPlaylist(e),s=this.getSourcePlaylists(e,t),n=this.getFallbackSourceFile(e,t);if(this.setState({nativeManifestSubtitles:!this.player.state.overrideNativeHls&&[i,...s].some(Ur)}),!i&&0===s.length&&!n)return!1;const r=[],a=!!i&&"adaptive"===t;return a?r.push(i):s.length>0&&r.push(s),0===r.length&&r.push({src:n.src,type:"video/mp4"}),this.player.networkStatus().setTestUrl(n.src),this.player.src(r),a||this.selectedQualityExists(e.files,t)||(t=n.fallbackQuality),this.trigger("source-set",{sources:r,quality:t}),this.hasManifestSubtitles(e)&&this.applyPersistedNativeSelection(),!0}),Or(this,"hasManifestSubtitles",e=>this.state.nativeManifestSubtitles&&(Object.keys(e.subtitles??{}).length>0||Object.keys(e.tracks?.subtitles??{}).length>0||Object.keys(e.tracks?.captions??{}).length>0)),Or(this,"onPlayerError",(e,t)=>{MediaError.MEDIA_ERR_NETWORK!==e&&(MediaError.MEDIA_ERR_DECODE!==e&&MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED!==e||!this.forceMseReload(e))&&MediaError.MEDIA_ERR_DECODE!==e&&(t=this.getErrorMessageFromVjsErrorCode(e,t),this.getErrorScreen().showError({message:t,title:this.player.localize("Thereâs been an error"),icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjYwOTIgNC4xNTAwMUMxMy4yODA5IDMuOTU0ODkgMTIuODcyMSAzLjk0OTc4IDEyLjUzOSA0LjEzNjYzQzEyLjIwNTkgNC4zMjM0OCAxMiA0LjY3MzQgMTIgNS4wNTI2M1YxNC41NDkzTDAuODg2ODg3IDcuODU3NDlMMC4xMTMxMTMgOS4xNDI1MUw0Ni42MTMxIDM3LjE0MjVMNDcuMzg2OSAzNS44NTc1TDM3LjI4NjUgMjkuNzc1NUw0NS40ODQyIDI0LjkwMjZDNDUuODA0MiAyNC43MTI0IDQ2IDI0LjM2OTggNDYgMjRDNDYgMjMuNjMwMyA0NS44MDQyIDIzLjI4NzYgNDUuNDg0MiAyMy4wOTc0TDEzLjYwOTIgNC4xNTAwMVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMiA0Mi45NDc0VjE5LjY0OTNMMzMuMDYyMiAzMi4yODY2TDEzLjYwOTIgNDMuODVDMTMuMjgwOSA0NC4wNDUx
2IDEyLjg3MjEgNDQuMDUwMiAxMi41MzkgNDMuODYzNEMxMi4yMDU5IDQzLjY3NjUgMTIgNDMuMzI2NiAxMiA0Mi45NDc0WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",iconSize:[50,50]}),this.player.error(null))}),Or(this,"forceMseReload",e=>{const{videoInfo:t}=this.state;return!(!t||window.self===window.top||this.player.state.overrideNativeHls||"application/x-mpegURL"!==this.player.currentType()||!window.MediaSource&&!window.ManagedMediaSource||K(t.guid)||(function(e){Q(X+e,(new Date).getTime())}(t.guid),!K(t.guid)||(W(t.guid,Math.round(this.player.currentTime())),this.player.error(null),n.default.log.warn(`manifest unplayable (error ${e}), reloading into MSE playback`),this.reloadEmbed(),0)))}),Or(this,"reloadEmbed",()=>window.location.reload()),Or(this,"getErrorMessageFromVjsErrorCode",(e,t)=>{switch(e){case MediaError.MEDIA_ERR_NETWORK:return this.player.localize("A network error occurred, check your connection and try again.");case MediaError.MEDIA_ERR_DECODE:case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:case MediaError.MEDIA_ERR_ABORTED:return this.player.localize("Something went wrong and we're unable to play the video. Please try again later.");default:return t}}),Or(this,"videoInfoFetchError",e=>{if(this.closeLoadingScreen(),"invalid_input"!==e.code||this.state.isAgeGateShowing)if(this.state.isAgeGateShowing){let t=this.player.localize("Error occurred");"forbidden"===e.code&&(t=this.player.localize("Content Unavailable")),this.ageGate.showError(t),this.ageGate.hideLoadingIndicator()}else if("auth"===e.code){if(this.state.isRestrictedVideoSite)return void this.getErrorScreen().showRestrictedVideoError(this.state.isActiveVideoTrialSite);this.getErrorScreen().showPrivacyError()}else{const t=e.errorMessage||e.message||this.player.localize("Unknown error");this.getErrorScreen().showError({message:t,title:e.title||"This video is private"})}else this.showAgeGate()}),Or(this,"getOptimizedPosterUrlForPlayerSize",e=>{if(!e.poster)return null;const t=e.poster,i=t.indexOf("?")>-1?"&":"?",s=window.devicePixelRatio||1;return e.width&&e.height&&e.height>e.width?t+i+"h="+Math.round(this.player.currentHeight()*s):t+i+"w="+Math.round(this.player.currentWidth()*s)}),Or(this,"videoInfoFetched",e=>{if(this.closeLoadingScreen(),this.state.isAgeGateShowing&&this.hideAgeGate(),this.setState({videoInfo:e}),this.player.poster()||this.player.poster(this.getOptimizedPosterUrlForPlayerSize(e)),this.conversionFailed(e))return this.player.converting().closeConvertingModalIfNecessary(),void this.player.converting().showConversionErrorModal();if(this.conversionModalShouldShow(e))return void(this.player.converting().showConversionModal(e)&&this.player.apiFetch().startPollingInfoEndpoint(this.state.guid,this.state.birthDate));this.player.converting().closeConvertingModalIfNecessary(),this.trigger("build-quality-levels",e);let t=this.state.hd?"hd":"dvd";const i=q();i?t=i:null!==e.adaptive_streaming&&(t="adaptive"),this.setVideoSource(e,t)&&(this.player.addClass("videopress-loaded"),this.player.postMessageApi().sendLoaded()),this.initShareAndDownloadOptions(e);const s=H()??"",n=s.startsWith("auto_"),r=s.replace("auto_",""),a=e=>{let t=s;return n?e.hasOwnProperty(r)&&(t=r):t&&!e.hasOwnProperty(t)&&e.hasOwnProperty("auto_"+t)&&(t="auto_"+t),t};if(e.subtitles&&Object.keys(e.subtitles).length>0){if(!this.state.nativeManifestSubtitles){const t=a(e.subtitles);Object.keys(e.subtitles).forEach(i=>{const s=e.subtitles[i];this.player.addRemoteTextTrack({src:s.vtt,kind:"subtitles",srcLang:i,language:i,label:s.localized_label,default:t===i},!0)})}}else e.tracks&&Object.keys(e.tracks).length>
20&&Object.keys(e.tracks).forEach(t=>{if(this.state.nativeManifestSubtitles&&je(t))return;const i="subtitles"===t?a(e.tracks[t]):null;for(const s in e.tracks[t]){const n=e.tracks[t][s],r=`https://videos.files.wordpress.com/${e.guid}/${n.src}`;this.player.addRemoteTextTrack({src:r,kind:t,srcLang:s,language:s,label:n.label,default:i===s},!0)}});const o=this.hasManifestSubtitles(e),l=this.player.remoteTextTracks(),c=o?this.player.textTracks():l;(l.length>0||o)&&(this.player.addClass("videopress-has-tracks"),c.on("change",()=>{if(this.isChangingSrc()||this.nativeSelectionListener)return;let e="";for(let t=0;t<c.length;t++){const i=c[t];je(i.kind)&&"showing"===i.mode&&(e=i.language)}e&&Q("captionsLanguage",e),this.player.trigger("refresh-subs-caps-button")})),this.setState({videoDataRequested:!0})}),Or(this,"applyPersistedNativeSelection",()=>{if(this.disarmNativeSelection(),!H())return;const e=this.player.textTracks(),t=()=>{const t=H();if(t){const i=t.replace("auto_","");let s=null;for(let t=0;t<e.length&&!s;t++)je(e[t].kind)&&e[t].language===i&&(s=e[t]);if(!s)return;"showing"!==s.mode&&(s.mode="showing")}this.disarmNativeSelection()};this.nativeSelectionListener=t,this.nativeSelectionSettle=()=>this.disarmNativeSelection(),e.on("addtrack",t),this.player.one("loadeddata",this.nativeSelectionSettle),t()}),Or(this,"disarmNativeSelection",()=>{this.nativeSelectionListener&&(this.player.textTracks().off("addtrack",this.nativeSelectionListener),this.nativeSelectionListener=null),this.nativeSelectionSettle&&(this.player.off("loadeddata",this.nativeSelectionSettle),this.nativeSelectionSettle=null)}),Or(this,"initShareAndDownloadOptions",e=>{this.shareOptionsInitialized=!0;const t=++this.shareOptionsRun;this.player.api.customize.get("shareButton").then(({customized:i,value:s})=>{if(t!==this.shareOptionsRun)return;const n=i&&!s||!!this.player.options().autoplay&&!!this.player.options().muted&&this.player.hasClass("videopress-controls-disabled"),r=!n&&!!e?.display_embed,a=!n&&!!e?.allow_download;if((r||a)&&!this.player.getChild("ShareButton")){const t=e?.title??"",i=this.player.children();let s=i.length;for(let e=0;e<i.length;++e){const t=i[e];if(t.name&&"controlbar"===t.name().toLowerCase()){s=e;break}}this.player.addChild("ShareButton",{title:t},s)}this.setState({canDisplayEmbed:r,canDisplayDownload:a})})}),Or(this,"refreshShareAndDownloadOptions",()=>{this.shareOptionsInitialized&&this.state.videoInfo&&this.initShareAndDownloadOptions(this.state.videoInfo)}),Or(this,"videoInfoFetchedInBackground",e=>{this.trigger("build-quality-levels",e),this.setState({videoInfo:e})}),Or(this,"isChangingSrc",()=>this.state?.["changing-src"]??!1),this.setState({guid:t.guid,hd:t.hd,videoDataRequested:!1,timeWhenOffline:0,loadingSpinner:null,canDisplayEmbed:!1,canDisplayDownload:!1,chapterTrack:null,chapters:null,currentChapter:null,borderColors:["#fff","#fff","#fff","#fff"],isRestrictedVideoSite:t.isRestrictedVideoSite,isActiveVideoTrialSite:t.isActiveVideoTrialSite}),this.setViewerBirthdate(t),this.registerComponentsAndEvents(e),e.api.wpcom.onVideoInfoFetched((e,t)=>{t?this.videoInfoFetchedInBackground(e):this.videoInfoFetched(e)}),e.api.wpcom.onVideoInfoFetchError(e=>this.videoInfoFetchError(e)),e.api.status.onBorderColorsChanged(e=>this.setState({borderColors:e})),e.api.status.onError((e,t)=>this.onPlayerError(e,t)),e.api.customize.onOptionsChanged(e=>{void 0!==e?.shareButton&&this.refreshShareAndDownloadOptions()}),this.requestVideoDataFromAPI(),console.info("vp9 support: "+(Z()?"yes":"no")),console.info("hevc support: "+(J()?"yes":"no"))}setViewerBirthdate({m:e,d:t,y:i}){this.player.options().bypassAgeGate&&(e=1,t=1,i=1984),e&&t&&i?this.setState({birthDate:{m:e,d:t,y:i}}):this.setState({birthDate:{}})}getViewerBirthDate(){return this.state.birthDate}setChaptersTrack(e){const t=e.cues,i=e&&e.activeCues_?e.activeCues_[0]:null;this.setState({chapterTrack:e,chapters:t,currentChapter:i})}setCurrentChapter(e){const{chapterTrack:t,chapters:i}=this.state;if(!t||!e||!i)return;let s=null;for(let t=0;t<i.length;t++)if(i[t].id===e.id){s=i[t];break}s&&this.setState({currentChapter:s})}getBorderColors(){return this.state.borderColors}getChapters(){const e=[];
2if(!this.state.chapterTrack||!this.state.chapters)return e;for(let t=0;t<this.state.chapters.length;t++){const{id:i,text:s,startTime:n,endTime:r}=this.state.chapters[t];e.push({id:i,text:s,startTime:n,endTime:r})}return e}getCurrentChapter(){if(!this.state.currentChapter)return null;const{id:e,text:t,startTime:i,endTime:s}=this.state.currentChapter;return{id:e,text:t,startTime:i,endTime:s}}requestVideoDataFromAPI(e=!1){e||this.state.isAgeGateShowing||this.showLoadingScreen(),this.player.api.wpcom.videoInfo(this.state.guid,this.state.birthDate,e).catch(e=>e)}registerComponentsAndEvents(e){n.default.registerComponent("Spinner",a),n.default.registerComponent("ShareDialog",kr);const t=e.addChild("ShareDialog");this.on("share-dialog-open",()=>{const{canDisplayEmbed:e,canDisplayDownload:i}=this.state;(e||i)&&t.open({guid:this.state.videoInfo.guid,isPrivate:this.state.videoInfo.is_private,currentTime:Math.floor(this.player.currentTime()),canDisplayEmbed:e,canDisplayDownload:i,downloadUrl:this.state.videoInfo.original??""})}),this.on("share-dialog-close",()=>t.close()),this.on("toggle-source",(t,{quality:i,persistQuality:s=!0})=>{this.setState({"changing-src":!0});const n=this.player.currentTime(),{videoInfo:r}=this.state,a=this.player.paused();this.setVideoSource(r,i),this.player.currentTime(n);const o=e.playbackRate();this.player.play().finally(()=>{this.setState({"changing-src":!1}),a&&this.player.pause(),o!==e.playbackRate()&&e.playbackRate(o)}),s&&function(e){Q("quality",e)}(i)}),this.setState({isAgeGateShowing:!1}),n.default.registerComponent("AgeGateDialog",Ir),this.on("update-viewer-birthdate",(e,{m:t,d:i,y:s})=>{this.setViewerBirthdate({m:t,d:i,y:s}),this.requestVideoDataFromAPI()}),this.player.on("fullscreenchange",()=>{this.player.isFullscreen()||this.player.tech({IWillNotUseThisInPlugins:!0}).removeAttribute("controls")}),this.player.networkStatus().on("network-down",()=>this.onNetworkDown()),this.player.networkStatus().on("network-up",()=>this.onNetworkUp()),this.player.on("playing",()=>this.preventPlayerPlayOnNetworkDown())}preventPlayerPlayOnNetworkDown(){const{loadingSpinner:e}=this.state;null!==e&&this.player.pause()}onNetworkDown(){let{loadingSpinner:e,videoDataRequested:t}=this.state;const i=this.player.currentTime();t&&this.player.pause(),null===e&&(e=this.createLoadingSpinnerModal(),e.open()),this.setState({timeWhenOffline:i,loadingSpinner:e})}onNetworkUp(){const{loadingSpinner:e,videoDataRequested:t,timeWhenOffline:i}=this.state;t?null!==e&&(this.player.pause(),this.player.load(),this.player.currentTime(i),this.player.play(),e.close(),this.setState({loadingSpinner:null})):this.requestVideoDataFromAPI()}createLoadingSpinnerModal(){const e=document.createElement("div");e.className="videopress-director-transparent-modal";const t=this.player.createModal(e,{uncloseable:!0});return t.addChild("Spinner",{className:"videopress-spinner__waiting"}).show(),t}showLoadingScreen(){const e=document.createElement("div");e.className="videopress-director-loading",e.innerText=this.player.localize("Loadingâ¦"),this.loadingModal=this.player.createModal(e,{uncloseable:!0}),this.loadingModal.open()}closeLoadingScreen(){this.loadingModal&&this.loadingModal.close()}selectedQualityExists(e,t){return e?.[t]??!1}showAgeGate(){this.setState({isAgeGateShowing:!0}),this.ageGate?this.ageGate.show():this.ageGate=this.player.addChild("AgeGateDialog")}getErrorScreen(){return this.errorScreen||(this.errorScreen=this.player.addChild("ErrorScreen")),this.errorScreen}hideAgeGate(){this.setState({isAgeGateShowing:!1}),this.ageGate.hide()}hasVideoInfo(){return void 0!==this.state.videoInfo}videoFileCount(){return Object.keys(this.state.videoInfo.files).length}}),n.default.registerPlugin("networkStatus",class extends qr{constructor(e,t){super(e,t),this.setState({isBrowserOnline:window.navigator.onLine,isNetworkReachable:window.navigator.onLine,testUrl:"",networkRetryIntervalMSec:4e3,networkRetryScheduled:!1,networkDownTriggered:!1}),window.addEventListener("offline",()=>this.onBrowserOffline()),window.addEventListener("online",()=>this.onBrowserOnline()),e.api.status.onError(t=>this.onPlayerError(e,t)),e.on("timeupdate",()=>this.onPlayerTimeUpdate()),this.on("network-down",()=>this.scheduleNetworkStatusRetry()),this.checkAndUpdateNetworkStatus()}isOnline(){return this.state.isBrowserOnline&&this.state.isPlayerOnline}setTestUrl(e){this.setState({testUrl:e})}onPlayerTimeUpdate(){if(this.state.isBrowserOnline||!this.state.isNetwork
2Reachable)return;const e=this.player.buffered();if(null!==e){const t=this.player.currentTime();for(let i=0;i<e.length;++i){const s=e.start(i),n=e.end(i);if(t>=s&&t<=n)return}}this.setNetworkUnreachable()}setNetworkRetryIntervalMSec(e){e>0&&this.setState({networkRetryIntervalMSec:e})}setNetworkUnreachable(){this.setState({isNetworkReachable:!1}),this.triggerNetworkDown()}checkAndUpdateNetworkStatus(){if(this.setState({networkRetryScheduled:!1}),this.state.isBrowserOnline&&this.state.isNetworkReachable)return void this.triggerNetworkUp();if(!this.state.isBrowserOnline||this.state.testUrl.length<=0)return void this.scheduleNetworkStatusRetry();const e=new XMLHttpRequest;e.onerror=()=>{this.scheduleNetworkStatusRetry()},e.onload=()=>{this.setState({isNetworkReachable:!0}),this.triggerNetworkUp()},e.open("HEAD",this.state.testUrl);try{e.send(null)}catch{this.scheduleNetworkStatusRetry()}}scheduleNetworkStatusRetry(){this.state.networkRetryScheduled||(this.setState({networkRetryScheduled:!0}),setTimeout(()=>this.checkAndUpdateNetworkStatus(),this.state.networkRetryIntervalMSec))}onBrowserOffline(){this.state.isBrowserOnline&&this.setState({isBrowserOnline:!1})}onBrowserOnline(){this.state.isBrowserOnline||this.setState({isBrowserOnline:!0})}triggerNetworkDown(){this.state.networkDownTriggered||(this.trigger("network-down"),this.setState({networkDownTriggered:!0}))}triggerNetworkUp(){this.setState({networkDownTriggered:!1}),this.trigger("network-up")}onPlayerError(e,t){MediaError.MEDIA_ERR_NETWORK===t&&(e.error(null),this.setNetworkUnreachable())}}),n.default.registerPlugin("chaptersMarkers",class extends ea{constructor(e,t){super(e,t),Jr(this,"clearMarkers",()=>{this._removeMarkerContainer(),this._removeCuechangeListener(),this.cues=null}),Jr(this,"_removeMarkerContainer",()=>{null!==this.markerContainer&&(this.markerContainer.remove(),this.markerContainer=null)}),Jr(this,"_removeCuechangeListener",()=>{this._cuechangeTrack&&(this._cuechangeTrack.removeEventListener("cuechange",this._onCuechange),this._cuechangeTrack=null)}),Jr(this,"_onCuechange",()=>{this.player.director().setCurrentChapter(this._cuechangeTrack.activeCues[0]),this.player.trigger("chaptersChapterChange")}),Jr(this,"_registerCuechangeListener",e=>{this._removeCuechangeListener(),this._cuechangeTrack=e,e.addEventListener("cuechange",this._onCuechange)}),Jr(this,"createChapterTitleContainer",()=>{const e=document.createElement("div");return e.className="videopress-chapter-title-container",e}),Jr(this,"hasChapters",()=>null!==this.cues&&this.cues.length>0),Jr(this,"forEachTrackCue",(e,t)=>{if(this.checkTrackHasCues(e))for(let i=0;i<e.cues.length;++i)t(e.cues[i],i)}),Jr(this,"_isChapterTrack",e=>e&&"chapters"===e.kind&&null!==e.cues&&e.cues.length>=0),Jr(this,"findTextTrack",()=>{const e=this.player.textTracks();if(e&&e.length)for(let t=e.length-1;t>=0;--t){const i=e[t];if(this._isChapterTrack(i))return i}}),Jr(this,"onPlayerMetadataLoaded",()=>{const e=this.player.textTracks();if(!e||!e.length)return;const t=this.findTextTrack();this.onPlayerChapterTrackChange(t)}),Jr(this,"_cleanup",()=>{this.clearMarkers(),this.player.removeClass("videopress-has-chapters")}),Jr(this,"_waitForSeekbarContainer",()=>{let e=0;const t=(i,s)=>{if(e+=1,e>10)return s("");const n=this.player.el().getElementsByClassName("vjs-progress-holder");if(n.length<=0)return setTimeout(()=>t(i,s),150);const r=n[0].parentElement;return r?i({seekbarContainer:r,seekbarElements:n}):setTimeout(()=>t(i,s),150)};return new Promise((e,i)=>{t(e,i)})}),Jr(this,"onPlayerChapterTrackChange",e=>{if(this.cues||this._cleanup(),!this.areControlsEnabled)return void this._cleanup();const t=this.player.duration();if(!(t<=0)&&this._isChapterTrack(e)){if(this.chapterTrack=e,this.cues=this.chapterTrack.cues,this.player.director().setChaptersTrack(this.chapterTrack),this.player.trigger("chaptersTrackChange"),!this.renderMarkers)return this.hasChapters()&&this.player.addClass("videopress-has-chapters"),void this._registerCuechangeListener(e);this._waitForSeekbarContainer().then(({seekbarContainer:i})=>{this._removeMarkerContainer();const s=document.createElement("div");s.className="videopress-markers-container",this.loadMarkersFromTrack(t,e,s),this.hasChapters()&&this.player.addClass("videopress-has-chapters"),this.markerContainer=s,i.appendChild(this.markerContainer)}).catch(()=>{})}}),Jr(this,"asPercentOfDuration",(e,t)=>parseFloat(e)/parseFloat(t)*100),Jr(this,"checkTrackHasCues",e=>e&&e.cues&&e.cues.length>0),Jr(this,"generateClipPathFromChapters",(e,t,i=void 0)=>{if(!this.checkTrackHasCues(e))return;const s="calc(100% - var(--vp-track-rest))",n="100%",r=[];let a=n;this.forEachTrackCue(e,(e,o)=>{const l=i===o-1?"0%":s,c=i===o?"0%":s,u=n,d=this.asPercentOfDuration(e.startTime,t);0===o&&d<=0?r.push(`${d}% ${c}`):r.push(`${d}% ${l}, ${d}% ${u}, calc(${d}% + 2px) ${u}, calc(${d}% + 2px) ${c}`),a=c});const o=`polygon(0 ${s}, ${r.join(",")}, 100% ${a}, 100% ${n}, 0 ${n})`;
2this.player.el().querySelector(".vjs-progress-holder").style["clip-path"]=o}),Jr(this,"loadMarkersFromTrack",(e,t,i)=>{this.checkTrackHasCues(t)&&(this.generateClipPathFromChapters(t,e),this._registerCuechangeListener(t),this.forEachTrackCue(t,(s,n)=>{const r=Math.min(100,this.asPercentOfDuration(s.endTime,e)),a=this.asPercentOfDuration(s.startTime,e),o=this.createMarkerElement(a,r,s.startTime);o.addEventListener("mouseover",()=>{this.generateClipPathFromChapters(t,e,n)}),o.addEventListener("mouseout",()=>{this.generateClipPathFromChapters(t,e)}),i.appendChild(o)}))}),Jr(this,"getChapterTitleAtTime",e=>{if(null===this.cues)return"";let t=0,i=this.cues.length-1;for(;t<=i;){const s=Math.floor((t+i)/2),n=this.cues[s],r=n.startTime,a=n.endTime;if(e>=r&&e<=a)return c(n.text.trim());e>r?t=s+1:i=s-1}return""}),Jr(this,"createMarkerElement",(e,t,i)=>{const s=document.createElement("div");s.innerHTML='<button class="videopress-marker-button"></button><span></span>';const n=s.querySelector(".videopress-marker-button"),r=t-e;return s.className="videopress-marker",s.style.left=`calc(${e.toString()}% - 2px)`,s.style["min-width"]=`${r.toString()}%`,n.onclick=e=>{e.stopPropagation(),this.player.currentTime(i),this.player.trigger("vp-chapters-set-from-bar")},s.onclick=()=>{this.player.trigger("vp-chapters-set-from-bar")},s}),t=n.default.obj.merge({controls:!0},t),this.areControlsEnabled=!!t.controls,this.renderMarkers=!1!==t.renderMarkers,this.markerContainer=null,this.cues=null,this._cuechangeTrack=null,this.chapterTitleContainer=this.createChapterTitleContainer(),this.player.el().appendChild(this.chapterTitleContainer),this.player.on("loadedmetadata",()=>this.onPlayerMetadataLoaded()),this.player.on("chapters-track-changed",()=>this.onPlayerMetadataLoaded())}}),n.default.registerPlugin("cast",class extends la{constructor(e,t){if(super(e,t),this.on(e,"cast-session-changed",(t,i)=>{i?.casting&&e.stats().sendStat("cast",i.platform)}),this.on(e,"cast-failed",()=>this.showCastError()),window.chrome){const t=()=>(ta||(ta=new Promise((e,t)=>{if(window.cast?.framework&&window.chrome?.cast)return void e({castFramework:window.cast.framework,chromeCast:window.chrome.cast});const i=(e,t)=>{clearTimeout(s),delete window.__onGCastApiAvailable,e(t)},s=setTimeout(()=>i(t,new Error("Cast SDK load timed out")),1e4);window.__onGCastApiAvailable=s=>{s&&window.cast?.framework&&window.chrome?.cast?i(e,{castFramework:window.cast.framework,chromeCast:window.chrome.cast}):i(t,new Error("Cast API unavailable"))},oe()("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",e=>{e&&i(t,e)})}).catch(e=>{throw ta=null,e})),ta).catch(e=>(n.default.log.debug("Cast: SDK unavailable",e),null)).then(t=>{t&&!this.player.isDisposed()&&(this.chromecast=new sa(e,this),this.chromecast.init(t.castFramework,t.chromeCast))}).catch(e=>n.default.log.error("Cast: controller initialization failed",e));window.requestIdleCallback?window.requestIdleCallback(t,{timeout:5e3}):t()}}toggleCast(){this.chromecast?this.chromecast.toggleCast():n.default.log.warn("Cast: toggle requested before the Chromecast controller exists")}getCastTextTracks(){const e=this.player.state?.metadataToken,t=this.player.textTracks(),i=[];for(let s=0;s<t.length;s++){const n=t[s];n.src&&je(n.kind)&&i.push({id:i.length+1,src:re(n.src,e),language:n.language,label:n.label,active:"showing"===n.mode})}return i}isPrivateVideo(){return!!this.player.director?.()?.state?.videoInfo?.is_private}getCastDashSource(e){const{files:t={},format_meta:i={}}=e,s=Object.keys(t).filter(e=>t[e].dash&&"avc"===i[e]?.codec).sort((e,t)=>(i[t]?.vertical_lines||0)-(i[e]?.vertical_lines||0))[0];if(!s)return null;if(this.isPrivateVideo())return e.guid?{src:se(e.guid,`${s}-dash`)}:(n.default.log.warn("Cast: private video without a guid cannot use the playlist endpoint"),null);const r=e.file_url_base?.https;return r?{src:r+t[s].dash}:null}getCastMediaInfo(){const e=this.player.director?.(),t=e?.state?.videoInfo||{},i=this.getCastDashSource(t),s=!i&&t.format_meta&&t.file_url_base?e.getFallbackSourceFile(t,"hd"):null;s&&Object.values(t.files||{}).some(e=>e.dash)&&n.default.log.warn("Cast: no AVC DASH rendition; the MP4 fallback may have no audio",s.src),s&&this.isPrivateVideo()&&n.default.log.warn("Cast: private video routed to the MP4 fallback",s.src);const r=i||s||this.player.currentSource();if(!r?.src)return null;let a=r.type||"application/x-mpegURL";
2if(i)a="application/dash+xml";else if(s)a="video/mp4";else if(a.toLowerCase().includes("mpegurl"))return n.default.log.warn("Cast: no castable rendition; refusing to send the HLS source",r.src),null;return{url:re(r.src,this.player.state?.metadataToken),contentType:a,title:u(t.title||""),poster:t.poster||"",tracks:this.getCastTextTracks()}}showCastError(){this.castError||(this.castError=this.player.addChild(new oa(this.player))),this.castError.open()}onCastConnected(e,t){this.player.addClass("vjs-casting"),this.overlay||(this.overlay=this.player.addChild(new ra(this.player))),this.overlay.open(e),this.player.trigger("cast-session-changed",{casting:!0,platform:t})}onCastDisconnected(e){this.player.removeClass("vjs-casting"),null===e||isNaN(e)||this.player.currentTime(e),this.player.play()?.catch(e=>n.default.log.warn("Cast: resuming local playback was blocked",e)),this.player.trigger("cast-session-changed",{casting:!1,platform:"chromecast"})}dispose(){this.chromecast?.dispose(),super.dispose()}}),n.default.registerPlugin("videoDimensions",class extends ma{constructor(e,t){super(e,t),function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(this,"apply",e=>{const{player:t}=this;fa.forEach(e=>t.removeClass(e)),t.addClass(ga+e.orientation),t.el().style.setProperty("--vp-video-aspect-ratio",`${e.width} / ${e.height}`),this.setState({dimensions:e})});const i=e.api.info;this.listenerId=i.onDimensionsChanged(this.apply),i.dimensions().then(e=>{e&&!this.state.dimensions&&this.apply(e)})}dispose(){this.player.api.info.offDimensionsChanged(this.listenerId),super.dispose()}}),n.default,Ye("ShareButton",class extends Je{constructor(e,t){super(e,t),this.addClass("videopress-share"),this.addClass("vp2-share");const i=new et(e,{clickHandler:()=>this.player().director().trigger("share-dialog-open"),name:"Button"});i.addClass("vjs-control"),i.addClass("vjs-share-ui-button"),i.controlText(this.localize("Share Button")),i.el().setAttribute("data-vp2-tip",this.localize("Share")),this.addChild(i)}}),Ye("ShareDialog",class extends Je{open(e){this.player().vp2Store?.setShareDialog({open:!0,data:e})}close(){this.player().vp2Store?.setShareDialog({open:!1,data:null})}}),Ye("ProgressControl",C),Ye("SeekBar",w),Ye("TextTrackSettings",class extends tt{setDefaults(){this.values_={...it}}getValues(){return{...this.values_}}setValues(e){this.values_=(e=>{const t={};return Object.keys(e).forEach(i=>{let s=e[i];"fontPercent"===i&&(s=Number(s),isNaN(s)||1===s)||"edgeStyle"===i&&"none"===s||null!=s&&""!==s&&(t[i]=s)}),t})({...this.values_,...e})}updateValues(e){this.setValues(e),this.saveSettings(),this.updateDisplay()}open(){}}),i(48);var io=i(280);function so(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const no="channel_init",ro="Call to an unknown method",ao="unknown_method",oo=class{constructor(e){so(this,"hookEventsFromApi",()=>
2{Object.keys(this.publicApi).forEach(e=>{const t=this.publicApi[e];"object"==typeof t&&Object.keys(t).forEach(t=>{const i=/^on([A-Z].*)/.exec(t);if(!i)return;const s=i[1].charAt(0).toLowerCase()+i[1].slice(1);this.publicApi[e][t]((...t)=>{this.postEvent(e+"."+s,t)})})})}),so(this,"onMessage",e=>{const t=e.data.event??!1;if(t&&e.ports.length&&no===t){const t=e.ports[0];this.postMessageListeners.push(t),t.onmessage=e=>this.callPublicApi(t,e),this.postMessage({event:no,message:{ack:!0}},[t])}}),so(this,"callPublicApi",(e,t)=>{const i=t.data.event??!1;if(!i)return;const s=[e],n=t.data.xchgId??0,r=i.split(".");if(2!==r.length)return void this.postError(ro,ao,n,s);const a=r[0],o=r[1];if(!this.publicApi[a]||!this.publicApi[a][o])return void this.postError(ro,ao,n,s);const l=this.publicApi[a][o],c=l.length,u=Array.isArray(t.data.args)?t.data.args:[];c>u.length?this.postError("Missing arguments","missing_arguments",n,s):l(...u).then(e=>this.postResult(i,e,n,s)).catch(e=>{this.postError({method:i,result:e},"method_failed",n,s)})}),so(this,"postResult",(e,t,i,s=null)=>{this.postMessage({event:"result",message:{method:e,result:t},xchgId:i},s)}),so(this,"postError",(e,t,i,s=null)=>{this.postMessage({event:"error",message:e,code:t,xchgId:i},s)}),so(this,"postEvent",(e,t,i=null)=>{this.postMessage({event:"event",type:e,args:t},i)}),so(this,"postMessage",(e,t=null)=>{(t??this.postMessageListeners).forEach(t=>{t.postMessage(e)})}),this.publicApi=e,this.hookEventsFromApi(),this.postMessageListeners=[],window.addEventListener("message",e=>this.onMessage(e))}},lo=function(e,t,i){if(e&&t)return((e,t,i)=>{const{id:s,element:n}=((e,t)=>{const i="videopress-player-"+t,s=document.getElementById(i);if(s&&e.contains(s))return{id:i,element:s};let n=i;for(let e=2;document.getElementById(n);e++)n=`${i}-${e}`;return{id:n,element:null}})(e,t),r=null!==n,a=r?n:document.createElement("video"),o="v2"===i.chrome?"v2":"v1";i.chrome=o,a.className="video-js vjs-videopress"+("v2"===o?" vp2":""),a.setAttribute("id",s),a.setAttribute("crossorigin","anonymous"),i.height&&a.setAttribute("height",i.height),i.width&&a.setAttribute("width",i.width),i.guid=t,r||e.appendChild(a);const l=to(a,i);((e,t)=>{const i=getComputedStyle(t),s=parseFloat(i.height);s>=424?e.addClass("videopress-layout-vertical-large"):s>314?e.addClass("videopress-layout-vertical-medium"):e.addClass("videopress-layout-vertical-small")})(l,a);const c=!!i.disableApi,u=c?null:(0,io.default)(l.apiRegistry,i);return c||new oo(u),{state:null,destroy:()=>l&&l.dispose(),api:u}})(t,e,i)}})(),s.default})());; 3// listen for rlt authentication events and pass them to children of this document. 4( function() { 5 var currentToken; 6 var parentOrigin; 7 var iframeOrigins; 8 var registeredIframes = []; 9 var initializationListeners = []; 10 var hasBeenInitialized = false; 11 var RLT_KEY = 'jetpack:wpcomRLT'; 12 13 // should we inject RLT into this iframe? 14 function rltShouldAuthorizeIframe( frameOrigin ) { 15 if ( ! Array.isArray( iframeOrigins ) ) { 16 return false; 17 } 18 return iframeOrigins.includes( frameOrigin ); 19 } 20 21 function rltInvalidateWindowToken( token, target, origin ) { 22 if ( target && typeof target.postMessage === 'function' ) { 23 try { 24 target.postMessage( JSON.stringify( { 25 type: 'rltMessage', 26 data: { 27 event: 'invalidate', 28 token: token, 29 sourceOrigin: window.location.origin, 30 }, 31 } ), origin ); 32 } catch ( err ) { 33 return; 34 } 35 } 36 } 37 38 /** 39 * PUBLIC METHODS 40 */ 41 window.rltInvalidateToken = function( token, sourceOrigin ) { 42 // invalidate in current context 43 if ( token === currentToken ) { 44 currentToken = null; 45 } 46 47 // remove from localstorage, but only if in a top level window, not iframe 48 try { 49 if ( window.location === window.parent.location && window.localStorage ) { 50 if ( window.localStorage.getItem(RLT_KEY) === token ) { 51 window.localStorage.removeItem(RLT_KEY); 52 } 53 } 54 } catch( e ) { 55 console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href); 56 } 57 58 // invalidate in registered iframes 59 for ( const [ frameOrigin, frameWindow ] of registeredIframes ) { 60 if ( frameOrigin !== sourceOrigin ) { 61 rltInvalidateWindowToken( token, frameWindow, frameOrigin ); 62 } 63 } 64 65 // invalidate in parent 66 if ( parentOrigin && parentOrigin !== sourceOrigin && window.parent ) { 67 rltInvalidateWindowToken( token, window.parent, parentOrigin ); 68 } 69 } 70 71 window.rltInjectToken = function( token, target, origin ) { 72 if ( target && typeof target.postMessage === 'function' ) { 73 try { 74 target.postMessage( JSON.stringify( { 75 type: 'loginMessage', 76 data: { 77 event: 'login', 78 success: true, 79 type: 'rlt', 80 token: token, 81 sourceOrigin: window.location.origin, 82 }, 83 } ), origin ); 84 } catch ( err ) { 85 return; 86 } 87 } 88 }; 89 90 window.rltIsAuthenticated = function() { 91 return !! currentToken; 92 }; 93 94 window.rltGetToken = function() { 95 return currentToken; 96 }; 97 98 window.rltAddInitializationListener = function( listener ) { 99 // if RLT is already initialized, call the listener immediately 100 if ( hasBeenInitialized ) { 101 listener( currentToken ); 102 } else { 103 initializationListeners.push( listener ); 104 } 105 }; 106 107 // store the token in localStorage 108 window.rltStoreToken = function( token ) { 109 currentToken = token; 110 try { 111 if ( window.location === window.parent.location && window.localStorage ) { 112 window.localStorage.setItem( RLT_KEY, token ); 113 } 114 } catch( e ) { 115 console.info("localstorage access denied - probably blocked third-party access", window.location.href); 116 } 117 } 118 119 window.rltInitialize = function( config ) { 120 if ( ! config || typeof window.postMessage !== 'function' ) { 121 return; 122 } 123 124 currentToken = config.token; 125 iframeOrigins = config.iframeOrigins; 126 parentOrigin = config.parentOrigin; // needed? 127 128 // load token from localStorage if possible, but only in top level window 129 try { 130 if ( ! currentToken && window.location === window.parent.location && window.localStorage ) { 131 currentToken = window.localStorage.getItem(RLT_KEY); 132 } 133 } catch( e ) { 134 console.info("localstorage access denied - probably blocked third-party access", window.location.href); 135 } 136 137 // listen for RLT events from approved origins 138 window.addEventListener( 'message', function( e ) { 139 var message = e && e.data; 140 if ( typeof message === 'string' ) { 141 try { 142 message = JSON.parse( message ); 143 } catch ( err ) { 144 return; 145 } 146 } 147 148 var type = message && message.type; 149 var data = message && message.data; 150 151 if ( type === 'loginMessage' ) { 152 if ( data && data.type === 'rlt' && data.token !== currentToken ) { 153 // put into localStorage if running in top-level window (not iframe) 154 rltStoreToken( data.token ); 155 156 // send to registered iframes 157 for ( const [ frameOrigin, frameWindow ] of registeredIframes ) { 158 rltInjectToken( currentToken, frameWindow, frameOrigin ); 159 } 160 161 // send to the parent, unless the event was sent _by_ the parent 162 if ( parentOrigin && parentOrigin !== data.sourceOrigin && window.parent ) { 163 rltInjectToken( currentToken, window.parent, parentOrigin ); 164 } 165 } 166 } 167 168 if ( type === 'rltMessage' ) {
169 if ( data && data.event === 'invalidate' && data.token === currentToken ) { 170 rltInvalidateToken( data.token ); 171 } 172 173 if ( data && data.event === 'register' ) { 174 if ( rltShouldAuthorizeIframe( e.origin ) ) { 175 registeredIframes.push( [ e.origin, e.source ] ); 176 if ( currentToken ) { 177 rltInjectToken( currentToken, e.source, e.origin ); 178 } 179 } 180 } 181 } 182 } ); 183 184 initializationListeners.forEach( function( listener ) { 185 listener( currentToken ); 186 } ); 187 188 initializationListeners = []; 189 190 // inform the parent that we are ready to receive the RLT token 191 window.parent.postMessage( { 192 type: 'rltMessage', 193 data: { 194 event: 'register' 195 }, 196 }, '*' ); 197 198 hasBeenInitialized = true; 199 }; 200} )(); 201;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.