import{ap as Qv}from"./DPgXI4tH.js";var Yv={exports:{}};const Zv=Qv(Yv.exports=(()=>{var Cd={480:(We,je,Ae)=>{var Ie=Ae(697),O=function(ie,we){return we===void 0&&(we=!1),function(Te,U,w){if(Te)ie(Te);else if(U.statusCode>=400&&U.statusCode<=599){var L=w;if(we)if(Ie.TextDecoder){var y=ke(U.headers&&U.headers["content-type"]);try{L=new TextDecoder(y).decode(w)}catch{}}else L=String.fromCharCode.apply(null,new Uint8Array(w));ie({cause:L})}else ie(null,w)}};function ke(ie){return ie===void 0&&(ie=""),ie.toLowerCase().split(";").reduce(function(we,Te){var U=Te.split("="),w=U[0],L=U[1];return w.trim()==="charset"?L.trim():we},"utf-8")}We.exports=O},424:(We,je,Ae)=>{var Ie=Ae(697),O=Ae(110),ke=Ae(988);w.httpHandler=Ae(480);/** * @license * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/> * Copyright (c) 2014 David Björklund * Available under the MIT license * <https://github.com/kesla/parse-headers/blob/master/LICENCE> */var ie=function(I){var E={};return I&&I.trim().split(` `).forEach(function(M){var H=M.indexOf(":"),te=M.slice(0,H).trim().toLowerCase(),V=M.slice(H+1).trim();E[te]===void 0?E[te]=V:Array.isArray(E[te])?E[te].push(V):E[te]=[E[te],V]}),E};function we(I,E){for(var M=0;M<I.length;M++)E(I[M])}function Te(I){for(var E in I)if(I.hasOwnProperty(E))return!1;return!0}function U(I,E,M){var H=I;return ke(E)?(M=E,typeof I=="string"&&(H={uri:I})):H=O({},E,{uri:I}),H.callback=M,H}function w(I,E,M){return L(E=U(I,E,M))}function L(I){if(I.callback===void 0)throw new Error("callback argument missing");var E=!1,M=function(z,ce,ae){E||(E=!0,I.callback(z,ce,ae))};function H(){C.readyState===4&&setTimeout(J,0)}function te(){var z=void 0;if(z=C.response?C.response:C.responseText||y(C),P)try{z=JSON.parse(z)}catch{}return z}function V(z){return clearTimeout(F),z instanceof Error||(z=new Error(""+(z||"Unknown XMLHttpRequest Error"))),z.statusCode=0,M(z,B)}function J(){if(!R){var z;clearTimeout(F),z=I.useXDR&&C.status===void 0?200:C.status===1223?204:C.status;var ce=B,ae=null;return z!==0?(ce={body:te(),statusCode:z,method:D,headers:{},url:ee,rawRequest:C},C.getAllResponseHeaders&&(ce.headers=ie(C.getAllResponseHeaders()))):ae=new Error("Internal XMLHttpRequest Error"),M(ae,ce,ce.body)}}var C=I.xhr||null;C||(C=I.cors||I.useXDR?new w.XDomainRequest:new w.XMLHttpRequest);var N,R,F,ee=C.url=I.uri||I.url,D=C.method=I.method||"GET",X=I.body||I.data,p=C.headers=I.headers||{},v=!!I.sync,P=!1,B={body:void 0,headers:{},statusCode:0,method:D,url:ee,rawRequest:C};if("json"in I&&I.json!==!1&&(P=!0,p.accept||p.Accept||(p.Accept="application/json"),D!=="GET"&&D!=="HEAD"&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),X=JSON.stringify(I.json===!0?X:I.json))),C.onreadystatechange=H,C.onload=J,C.onerror=V,C.onprogress=function(){},C.onabort=function(){R=!0},C.ontimeout=V,C.open(D,ee,!v,I.username,I.password),v||(C.withCredentials=!!I.withCredentials),!v&&I.timeout>0&&(F=setTimeout(function(){if(!R){R=!0,C.abort("timeout");var z=new Error("XMLHttpRequest timeout");z.code="ETIMEDOUT",V(z)}},I.timeout)),C.setRequestHeader)for(N in p)p.hasOwnProperty(N)&&C.setRequestHeader(N,p[N]);else if(I.headers&&!Te(I.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in I&&(C.responseType=I.responseType),"beforeSend"in I&&typeof I.beforeSend=="function"&&I.beforeSend(C),C.send(X||null),C}function y(I){try{if(I.responseType==="document")return I.responseXML;var E=I.responseXML&&I.responseXML.documentElement.nodeName==="parsererror";if(I.responseType===""&&!E)return I.responseXML}catch{}return null}function A(){}We.exports=w,We.exports.default=w,w.XMLHttpRequest=Ie.XMLHttpRequest||A,w.XDomainRequest="withCredentials"in new w.XMLHttpRequest?w.XMLHttpRequest:Ie.XDomainRequest,we(["get","put","post","patch","head","delete"],function(I){w[I==="delete"?"del":I]=function(E,M,H){return(M=U(E,M,H)).method=I.toUpperCase(),L(M)}})},29:(We,je)=>{function Ae(we,Te,U){if(U===void 0&&(U=Array.prototype),we&&typeof U.find=="function")return U.find.call(we,Te);for(var w=0;w<we.length;w++)if(Object.prototype.hasOwnProperty.call(we,w)){var L=we[w];if(Te.call(void 0,L,w,we))return L}}function Ie(we,Te){return Te===void 0&&(Te=Object),Te&&typeof Te.freeze=="function"?Te.freeze(we):we}function O(we,Te){if(we===null||typeof we!="object")throw new TypeError("target is not an object");for(var U in Te)Object.prototype.hasOwnProperty.call(Te,U)&&(we[U]=Te[U]);return we}var ke=Ie({HTML:"text/html",isHTML:function(we){return we===ke.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ie=Ie({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(we){return we===ie.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});je.assign=O,je.find=Ae,je.freeze=Ie,je.MIME_TYPE=ke,je.NAMESPACE=ie},407:(We,je,Ae)=>{var Ie=Ae(29),O=Ae(665),ke=Ae(884),ie=Ae(996),we=O.DOMImplementation,Te=Ie.NAMESPACE,U=ie.ParseError,w=ie.XMLReader;function L(V){return V.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function y(V){this.options=V||{locator:{}}}function A(V,J,C){if(!V){if(J instanceof I)return J;V=J}var N={},R=V instanceof Function;function F(ee){var D=V[ee];!D&&R&&(D=V.length==2?function(X){V(ee,X)}:V),N[ee]=D&&function(X){D("[xmldom "+ee+"] "+X+M(C))}||function(){}}return C=C||{},F("warning"),F("error"),F("fatalError"),N}function I(){this.cdata=!1}function E(V,J){J.lineNumber=V.lineNumber,J.columnNumber=V.columnNumber}function M(V){if(V)return` @`+(V.systemId||"")+"#[line:"+V.lineNumber+",col:"+V.columnNumber+"]"}function H(V,J,C){return typeof V=="string"?V.substr(J,C):V.length>=J+C||J?new java.lang.String(V,J,C)+"":V}function te(V,J){V.currentElement?V.currentElement.appendChild(J):V.doc.appendChild(J)}y.prototype.parseFromString=function(V,J){var C=this.options,N=new w,R=C.domBuilder||new I,F=C.errorHandler,ee=C.locator,D=C.xmlns||{},X=/\/x?html?$/.test(J),p=X?ke.HTML_ENTITIES:ke.XML_ENTITIES;ee&&R.setDocumentLocator(ee),N.errorHandler=A(F,R,ee),N.domBuilder=C.domBuilder||R,X&&(D[""]=Te.HTML),D.xml=D.xml||Te.XML;var v=C.normalizeLineEndings||L;return V&&typeof V=="string"?N.parse(v(V),D,p):N.errorHandler.error("invalid doc source"),R.doc},I.prototype={startDocument:function(){this.doc=new we().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(V,J,C,N){var R=this.doc,F=R.createElementNS(V,C||J),ee=N.length;te(this,F),this.currentElement=F,this.locator&&E(this.locator,F);for(var D=0;D<ee;D++){V=N.getURI(D);var X=N.getValue(D),p=(C=N.getQName(D),R.createAttributeNS(V,C));this.locator&&E(N.getLocator(D),p),p.value=p.nodeValue=X,F.setAttributeNode(p)}},endElement:function(V,J,C){var N=this.currentElement;N.tagName,this.currentElement=N.parentNode},startPrefixMapping:function(V,J){},endPrefixMapping:function(V){},processingInstruction:function(V,J){var C=this.doc.createProcessingInstruction(V,J);this.locator&&E(this.locator,C),te(this,C)},ignorableWhitespace:function(V,J,C){},characters:function(V,J,C){if(V=H.apply(this,arguments)){if(this.cdata)var N=this.doc.createCDATASection(V);else N=this.doc.createTextNode(V);this.currentElement?this.currentElement.appendChild(N):/^\s*$/.test(V)&&this.doc.appendChild(N),this.locator&&E(this.locator,N)}},skippedEntity:function(V){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(V){(this.locator=V)&&(V.lineNumber=0)},comment:function(V,J,C){V=H.apply(this,arguments);var N=this.doc.createComment(V);this.locator&&E(this.locator,N),te(this,N)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(V,J,C){var N=this.doc.implementation;if(N&&N.createDocumentType){var R=N.createDocumentType(V,J,C);this.locator&&E(this.locator,R),te(this,R),this.doc.doctype=R}},warning:function(V){console.warn("[xmldom warning] "+V,M(this.locator))},error:function(V){console.error("[xmldom error] "+V,M(this.locator))},fatalError:function(V){throw new U(V,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(V){I.prototype[V]=function(){return null}}),je.DOMParser=y},665:(We,je,Ae)=>{var Ie=Ae(29),O=Ie.find,ke=Ie.NAMESPACE;function ie(S){return S!==""}function we(S){return S?S.split(/[\t\n\f\r ]+/).filter(ie):[]}function Te(S,k){return S.hasOwnProperty(k)||(S[k]=!0),S}function U(S){if(!S)return[];var k=we(S);return Object.keys(k.reduce(Te,{}))}function w(S){return function(k){return S&&S.indexOf(k)!==-1}}function L(S,k){for(var K in S)Object.prototype.hasOwnProperty.call(S,K)&&(k[K]=S[K])}function y(S,k){var K=S.prototype;if(!(K instanceof k)){let me=function(){};me.prototype=k.prototype,me=new me,L(K,me),S.prototype=K=me}K.constructor!=S&&(typeof S!="function"&&console.error("unknown Class:"+S),K.constructor=S)}var A={},I=A.ELEMENT_NODE=1,E=A.ATTRIBUTE_NODE=2,M=A.TEXT_NODE=3,H=A.CDATA_SECTION_NODE=4,te=A.ENTITY_REFERENCE_NODE=5,V=A.ENTITY_NODE=6,J=A.PROCESSING_INSTRUCTION_NODE=7,C=A.COMMENT_NODE=8,N=A.DOCUMENT_NODE=9,R=A.DOCUMENT_TYPE_NODE=10,F=A.DOCUMENT_FRAGMENT_NODE=11,ee=A.NOTATION_NODE=12,D={},X={};D.INDEX_SIZE_ERR=(X[1]="Index size error",1),D.DOMSTRING_SIZE_ERR=(X[2]="DOMString size error",2);var p=D.HIERARCHY_REQUEST_ERR=(X[3]="Hierarchy request error",3);D.WRONG_DOCUMENT_ERR=(X[4]="Wrong document",4),D.INVALID_CHARACTER_ERR=(X[5]="Invalid character",5),D.NO_DATA_ALLOWED_ERR=(X[6]="No data allowed",6),D.NO_MODIFICATION_ALLOWED_ERR=(X[7]="No modification allowed",7);var v=D.NOT_FOUND_ERR=(X[8]="Not found",8);D.NOT_SUPPORTED_ERR=(X[9]="Not supported",9);var P=D.INUSE_ATTRIBUTE_ERR=(X[10]="Attribute in use",10);function B(S,k){if(k instanceof Error)var K=k;else K=this,Error.call(this,X[S]),this.message=X[S],Error.captureStackTrace&&Error.captureStackTrace(this,B);return K.code=S,k&&(this.message=this.message+": "+k),K}function z(){}function ce(S,k){this._node=S,this._refresh=k,ae(this)}function ae(S){var k=S._node._inc||S._node.ownerDocument._inc;if(S._inc!=k){var K=S._refresh(S._node);et(S,"length",K.length),L(K,S),S._inc=k}}function ge(){}function ue(S,k){for(var K=S.length;K--;)if(S[K]===k)return K}function le(S,k,K,me){if(me?k[ue(k,me)]=K:k[k.length++]=K,S){K.ownerElement=S;var Be=S.ownerDocument;Be&&(me&&$(Be,S,me),de(Be,S,K))}}function pe(S,k,K){var me=ue(k,K);if(!(me>=0))throw new B(v,new Error(S.tagName+"@"+K));for(var Be=k.length-1;me<Be;)k[me]=k[++me];if(k.length=Be,S){var Ke=S.ownerDocument;Ke&&($(Ke,S,K),K.ownerElement=null)}}function se(){}function oe(){}function xe(S){return(S=="<"?"<":S==">"&&">")||S=="&"&&"&"||S=='"'&&"""||"&#"+S.charCodeAt()+";"}function Q(S,k){if(k(S))return!0;if(S=S.firstChild)do if(Q(S,k))return!0;while(S=S.nextSibling)}function Y(){this.ownerDocument=this}function de(S,k,K){S&&S._inc++,K.namespaceURI===ke.XMLNS&&(k._nsMap[K.prefix?K.localName:""]=K.value)}function $(S,k,K,me){S&&S._inc++,K.namespaceURI===ke.XMLNS&&delete k._nsMap[K.prefix?K.localName:""]}function Z(S,k,K){if(S&&S._inc){S._inc++;var me=k.childNodes;if(K)me[me.length++]=K;else{for(var Be=k.firstChild,Ke=0;Be;)me[Ke++]=Be,Be=Be.nextSibling;me.length=Ke,delete me[me.length]}}}function fe(S,k){var K=k.previousSibling,me=k.nextSibling;return K?K.nextSibling=me:S.firstChild=me,me?me.previousSibling=K:S.lastChild=K,k.parentNode=null,k.previousSibling=null,k.nextSibling=null,Z(S.ownerDocument,S),k}function Pe(S){return S&&(S.nodeType===oe.DOCUMENT_NODE||S.nodeType===oe.DOCUMENT_FRAGMENT_NODE||S.nodeType===oe.ELEMENT_NODE)}function Re(S){return S&&(He(S)||Ze(S)||Fe(S)||S.nodeType===oe.DOCUMENT_FRAGMENT_NODE||S.nodeType===oe.COMMENT_NODE||S.nodeType===oe.PROCESSING_INSTRUCTION_NODE)}function Fe(S){return S&&S.nodeType===oe.DOCUMENT_TYPE_NODE}function He(S){return S&&S.nodeType===oe.ELEMENT_NODE}function Ze(S){return S&&S.nodeType===oe.TEXT_NODE}function $e(S,k){var K=S.childNodes||[];if(O(K,He)||Fe(k))return!1;var me=O(K,Fe);return!(k&&me&&K.indexOf(me)>K.indexOf(k))}function Et(S,k){var K=S.childNodes||[];function me(Ke){return He(Ke)&&Ke!==k}if(O(K,me))return!1;var Be=O(K,Fe);return!(k&&Be&&K.indexOf(Be)>K.indexOf(k))}function bn(S,k,K){if(!Pe(S))throw new B(p,"Unexpected parent node type "+S.nodeType);if(K&&K.parentNode!==S)throw new B(v,"child not in parent");if(!Re(k)||Fe(k)&&S.nodeType!==oe.DOCUMENT_NODE)throw new B(p,"Unexpected node type "+k.nodeType+" for parent node type "+S.nodeType)}function Tn(S,k,K){var me=S.childNodes||[],Be=k.childNodes||[];if(k.nodeType===oe.DOCUMENT_FRAGMENT_NODE){var Ke=Be.filter(He);if(Ke.length>1||O(Be,Ze))throw new B(p,"More than one element or text in fragment");if(Ke.length===1&&!$e(S,K))throw new B(p,"Element in fragment can not be inserted before doctype")}if(He(k)&&!$e(S,K))throw new B(p,"Only one element can be added and only after doctype");if(Fe(k)){if(O(me,Fe))throw new B(p,"Only one doctype is allowed");var nt=O(me,He);if(K&&me.indexOf(nt)<me.indexOf(K))throw new B(p,"Doctype can only be inserted before an element");if(!K&&nt)throw new B(p,"Doctype can not be appended since element is present")}}function Lt(S,k,K){var me=S.childNodes||[],Be=k.childNodes||[];if(k.nodeType===oe.DOCUMENT_FRAGMENT_NODE){var Ke=Be.filter(He);if(Ke.length>1||O(Be,Ze))throw new B(p,"More than one element or text in fragment");if(Ke.length===1&&!Et(S,K))throw new B(p,"Element in fragment can not be inserted before doctype")}if(He(k)&&!Et(S,K))throw new B(p,"Only one element can be added and only after doctype");if(Fe(k)){if(O(me,function(at){return Fe(at)&&at!==K}))throw new B(p,"Only one doctype is allowed");var nt=O(me,He);if(K&&me.indexOf(nt)<me.indexOf(K))throw new B(p,"Doctype can only be inserted before an element")}}function Gt(S,k,K,me){bn(S,k,K),S.nodeType===oe.DOCUMENT_NODE&&(me||Tn)(S,k,K);var Be=k.parentNode;if(Be&&Be.removeChild(k),k.nodeType===F){var Ke=k.firstChild;if(Ke==null)return k;var nt=k.lastChild}else Ke=nt=k;var at=K?K.previousSibling:S.lastChild;Ke.previousSibling=at,nt.nextSibling=K,at?at.nextSibling=Ke:S.firstChild=Ke,K==null?S.lastChild=nt:K.previousSibling=nt;do Ke.parentNode=S;while(Ke!==nt&&(Ke=Ke.nextSibling));return Z(S.ownerDocument||S,S),k.nodeType==F&&(k.firstChild=k.lastChild=null),k}function it(S,k){return k.parentNode&&k.parentNode.removeChild(k),k.parentNode=S,k.previousSibling=S.lastChild,k.nextSibling=null,k.previousSibling?k.previousSibling.nextSibling=k:S.firstChild=k,S.lastChild=k,Z(S.ownerDocument,S,k),k}function pt(){this._nsMap={}}function Qt(){}function Xe(){}function _t(){}function Bt(){}function hr(){}function Bn(){}function jn(){}function rr(){}function ut(){}function gn(){}function Tt(){}function ir(){}function wt(S,k){var K=[],me=this.nodeType==9&&this.documentElement||this,Be=me.prefix,Ke=me.namespaceURI;if(Ke&&Be==null&&(Be=me.lookupPrefix(Ke))==null)var nt=[{namespace:Ke,prefix:null}];return on(this,K,S,k,nt),K.join("")}function Fn(S,k,K){var me=S.prefix||"",Be=S.namespaceURI;if(!Be||me==="xml"&&Be===ke.XML||Be===ke.XMLNS)return!1;for(var Ke=K.length;Ke--;){var nt=K[Ke];if(nt.prefix===me)return nt.namespace!==Be}return!0}function qn(S,k,K){S.push(" ",k,'="',K.replace(/[<>&"\t\n\r]/g,xe),'"')}function on(S,k,K,me,Be){if(Be||(Be=[]),me){if(!(S=me(S)))return;if(typeof S=="string")return void k.push(S)}switch(S.nodeType){case I:var Ke=S.attributes,nt=Ke.length,at=S.firstChild,un=S.tagName,Mt=un;if(!(K=ke.isHTML(S.namespaceURI)||K)&&!S.prefix&&S.namespaceURI){for(var nn,Hn=0;Hn<Ke.length;Hn++)if(Ke.item(Hn).name==="xmlns"){nn=Ke.item(Hn).value;break}if(!nn){for(var ln=Be.length-1;ln>=0;ln--)if((cn=Be[ln]).prefix===""&&cn.namespace===S.namespaceURI){nn=cn.namespace;break}}if(nn!==S.namespaceURI)for(ln=Be.length-1;ln>=0;ln--){var cn;if((cn=Be[ln]).namespace===S.namespaceURI){cn.prefix&&(Mt=cn.prefix+":"+un);break}}}k.push("<",Mt);for(var rn=0;rn<nt;rn++)(Ht=Ke.item(rn)).prefix=="xmlns"?Be.push({prefix:Ht.localName,namespace:Ht.value}):Ht.nodeName=="xmlns"&&Be.push({prefix:"",namespace:Ht.value});for(rn=0;rn<nt;rn++){var Ht,vn,An;Fn(Ht=Ke.item(rn),K,Be)&&(qn(k,(vn=Ht.prefix||"")?"xmlns:"+vn:"xmlns",An=Ht.namespaceURI),Be.push({prefix:vn,namespace:An})),on(Ht,k,K,me,Be)}if(un===Mt&&Fn(S,K,Be)&&(qn(k,(vn=S.prefix||"")?"xmlns:"+vn:"xmlns",An=S.namespaceURI),Be.push({prefix:vn,namespace:An})),at||K&&!/^(?:meta|link|img|br|hr|input)$/i.test(un)){if(k.push(">"),K&&/^script$/i.test(un))for(;at;)at.data?k.push(at.data):on(at,k,K,me,Be.slice()),at=at.nextSibling;else for(;at;)on(at,k,K,me,Be.slice()),at=at.nextSibling;k.push("</",Mt,">")}else k.push("/>");return;case N:case F:for(at=S.firstChild;at;)on(at,k,K,me,Be.slice()),at=at.nextSibling;return;case E:return qn(k,S.name,S.value);case M:return k.push(S.data.replace(/[<&>]/g,xe));case H:return k.push("<![CDATA[",S.data,"]]>");case C:return k.push("<!--",S.data,"-->");case R:var Pn=S.publicId,dn=S.systemId;if(k.push("<!DOCTYPE ",S.name),Pn)k.push(" PUBLIC ",Pn),dn&&dn!="."&&k.push(" ",dn),k.push(">");else if(dn&&dn!=".")k.push(" SYSTEM ",dn,">");else{var On=S.internalSubset;On&&k.push(" [",On,"]"),k.push(">")}return;case J:return k.push("<?",S.target," ",S.data,"?>");case te:return k.push("&",S.nodeName,";");default:k.push("??",S.nodeName)}}function ve(S,k,K){var me;switch(k.nodeType){case I:(me=k.cloneNode(!1)).ownerDocument=S;case F:break;case E:K=!0}if(me||(me=k.cloneNode(!1)),me.ownerDocument=S,me.parentNode=null,K)for(var Be=k.firstChild;Be;)me.appendChild(ve(S,Be,K)),Be=Be.nextSibling;return me}function Ee(S,k,K){var me=new k.constructor;for(var Be in k)if(Object.prototype.hasOwnProperty.call(k,Be)){var Ke=k[Be];typeof Ke!="object"&&Ke!=me[Be]&&(me[Be]=Ke)}switch(k.childNodes&&(me.childNodes=new z),me.ownerDocument=S,me.nodeType){case I:var nt=k.attributes,at=me.attributes=new ge,un=nt.length;at._ownerElement=me;for(var Mt=0;Mt<un;Mt++)me.setAttributeNode(Ee(S,nt.item(Mt),!0));break;case E:K=!0}if(K)for(var nn=k.firstChild;nn;)me.appendChild(Ee(S,nn,K)),nn=nn.nextSibling;return me}function et(S,k,K){S[k]=K}D.INVALID_STATE_ERR=(X[11]="Invalid state",11),D.SYNTAX_ERR=(X[12]="Syntax error",12),D.INVALID_MODIFICATION_ERR=(X[13]="Invalid modification",13),D.NAMESPACE_ERR=(X[14]="Invalid namespace",14),D.INVALID_ACCESS_ERR=(X[15]="Invalid access",15),B.prototype=Error.prototype,L(D,B),z.prototype={length:0,item:function(S){return this[S]||null},toString:function(S,k){for(var K=[],me=0;me<this.length;me++)on(this[me],K,S,k);return K.join("")},filter:function(S){return Array.prototype.filter.call(this,S)},indexOf:function(S){return Array.prototype.indexOf.call(this,S)}},ce.prototype.item=function(S){return ae(this),this[S]},y(ce,z),ge.prototype={length:0,item:z.prototype.item,getNamedItem:function(S){for(var k=this.length;k--;){var K=this[k];if(K.nodeName==S)return K}},setNamedItem:function(S){var k=S.ownerElement;if(k&&k!=this._ownerElement)throw new B(P);var K=this.getNamedItem(S.nodeName);return le(this._ownerElement,this,S,K),K},setNamedItemNS:function(S){var k,K=S.ownerElement;if(K&&K!=this._ownerElement)throw new B(P);return k=this.getNamedItemNS(S.namespaceURI,S.localName),le(this._ownerElement,this,S,k),k},removeNamedItem:function(S){var k=this.getNamedItem(S);return pe(this._ownerElement,this,k),k},removeNamedItemNS:function(S,k){var K=this.getNamedItemNS(S,k);return pe(this._ownerElement,this,K),K},getNamedItemNS:function(S,k){for(var K=this.length;K--;){var me=this[K];if(me.localName==k&&me.namespaceURI==S)return me}return null}},se.prototype={hasFeature:function(S,k){return!0},createDocument:function(S,k,K){var me=new Y;if(me.implementation=this,me.childNodes=new z,me.doctype=K||null,K&&me.appendChild(K),k){var Be=me.createElementNS(S,k);me.appendChild(Be)}return me},createDocumentType:function(S,k,K){var me=new Bn;return me.name=S,me.nodeName=S,me.publicId=k||"",me.systemId=K||"",me}},oe.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(S,k){return Gt(this,S,k)},replaceChild:function(S,k){Gt(this,S,k,Lt),k&&this.removeChild(k)},removeChild:function(S){return fe(this,S)},appendChild:function(S){return this.insertBefore(S,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(S){return Ee(this.ownerDocument||this,this,S)},normalize:function(){for(var S=this.firstChild;S;){var k=S.nextSibling;k&&k.nodeType==M&&S.nodeType==M?(this.removeChild(k),S.appendData(k.data)):(S.normalize(),S=k)}},isSupported:function(S,k){return this.ownerDocument.implementation.hasFeature(S,k)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(S){for(var k=this;k;){var K=k._nsMap;if(K){for(var me in K)if(Object.prototype.hasOwnProperty.call(K,me)&&K[me]===S)return me}k=k.nodeType==E?k.ownerDocument:k.parentNode}return null},lookupNamespaceURI:function(S){for(var k=this;k;){var K=k._nsMap;if(K&&Object.prototype.hasOwnProperty.call(K,S))return K[S];k=k.nodeType==E?k.ownerDocument:k.parentNode}return null},isDefaultNamespace:function(S){return this.lookupPrefix(S)==null}},L(A,oe),L(A,oe.prototype),Y.prototype={nodeName:"#document",nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(S,k){if(S.nodeType==F){for(var K=S.firstChild;K;){var me=K.nextSibling;this.insertBefore(K,k),K=me}return S}return Gt(this,S,k),S.ownerDocument=this,this.documentElement===null&&S.nodeType===I&&(this.documentElement=S),S},removeChild:function(S){return this.documentElement==S&&(this.documentElement=null),fe(this,S)},replaceChild:function(S,k){Gt(this,S,k,Lt),S.ownerDocument=this,k&&this.removeChild(k),He(S)&&(this.documentElement=S)},importNode:function(S,k){return ve(this,S,k)},getElementById:function(S){var k=null;return Q(this.documentElement,function(K){if(K.nodeType==I&&K.getAttribute("id")==S)return k=K,!0}),k},getElementsByClassName:function(S){var k=U(S);return new ce(this,function(K){var me=[];return k.length>0&&Q(K.documentElement,function(Be){if(Be!==K&&Be.nodeType===I){var Ke=Be.getAttribute("class");if(Ke){var nt=S===Ke;if(!nt){var at=U(Ke);nt=k.every(w(at))}nt&&me.push(Be)}}}),me})},createElement:function(S){var k=new pt;return k.ownerDocument=this,k.nodeName=S,k.tagName=S,k.localName=S,k.childNodes=new z,(k.attributes=new ge)._ownerElement=k,k},createDocumentFragment:function(){var S=new gn;return S.ownerDocument=this,S.childNodes=new z,S},createTextNode:function(S){var k=new _t;return k.ownerDocument=this,k.appendData(S),k},createComment:function(S){var k=new Bt;return k.ownerDocument=this,k.appendData(S),k},createCDATASection:function(S){var k=new hr;return k.ownerDocument=this,k.appendData(S),k},createProcessingInstruction:function(S,k){var K=new Tt;return K.ownerDocument=this,K.tagName=K.target=S,K.nodeValue=K.data=k,K},createAttribute:function(S){var k=new Qt;return k.ownerDocument=this,k.name=S,k.nodeName=S,k.localName=S,k.specified=!0,k},createEntityReference:function(S){var k=new ut;return k.ownerDocument=this,k.nodeName=S,k},createElementNS:function(S,k){var K=new pt,me=k.split(":"),Be=K.attributes=new ge;return K.childNodes=new z,K.ownerDocument=this,K.nodeName=k,K.tagName=k,K.namespaceURI=S,me.length==2?(K.prefix=me[0],K.localName=me[1]):K.localName=k,Be._ownerElement=K,K},createAttributeNS:function(S,k){var K=new Qt,me=k.split(":");return K.ownerDocument=this,K.nodeName=k,K.name=k,K.namespaceURI=S,K.specified=!0,me.length==2?(K.prefix=me[0],K.localName=me[1]):K.localName=k,K}},y(Y,oe),pt.prototype={nodeType:I,hasAttribute:function(S){return this.getAttributeNode(S)!=null},getAttribute:function(S){var k=this.getAttributeNode(S);return k&&k.value||""},getAttributeNode:function(S){return this.attributes.getNamedItem(S)},setAttribute:function(S,k){var K=this.ownerDocument.createAttribute(S);K.value=K.nodeValue=""+k,this.setAttributeNode(K)},removeAttribute:function(S){var k=this.getAttributeNode(S);k&&this.removeAttributeNode(k)},appendChild:function(S){return S.nodeType===F?this.insertBefore(S,null):it(this,S)},setAttributeNode:function(S){return this.attributes.setNamedItem(S)},setAttributeNodeNS:function(S){return this.attributes.setNamedItemNS(S)},removeAttributeNode:function(S){return this.attributes.removeNamedItem(S.nodeName)},removeAttributeNS:function(S,k){var K=this.getAttributeNodeNS(S,k);K&&this.removeAttributeNode(K)},hasAttributeNS:function(S,k){return this.getAttributeNodeNS(S,k)!=null},getAttributeNS:function(S,k){var K=this.getAttributeNodeNS(S,k);return K&&K.value||""},setAttributeNS:function(S,k,K){var me=this.ownerDocument.createAttributeNS(S,k);me.value=me.nodeValue=""+K,this.setAttributeNode(me)},getAttributeNodeNS:function(S,k){return this.attributes.getNamedItemNS(S,k)},getElementsByTagName:function(S){return new ce(this,function(k){var K=[];return Q(k,function(me){me!==k&&me.nodeType==I&&(S==="*"||me.tagName==S)&&K.push(me)}),K})},getElementsByTagNameNS:function(S,k){return new ce(this,function(K){var me=[];return Q(K,function(Be){Be!==K&&Be.nodeType===I&&(S==="*"||Be.namespaceURI===S)&&(k==="*"||Be.localName==k)&&me.push(Be)}),me})}},Y.prototype.getElementsByTagName=pt.prototype.getElementsByTagName,Y.prototype.getElementsByTagNameNS=pt.prototype.getElementsByTagNameNS,y(pt,oe),Qt.prototype.nodeType=E,y(Qt,oe),Xe.prototype={data:"",substringData:function(S,k){return this.data.substring(S,S+k)},appendData:function(S){S=this.data+S,this.nodeValue=this.data=S,this.length=S.length},insertData:function(S,k){this.replaceData(S,0,k)},appendChild:function(S){throw new Error(X[p])},deleteData:function(S,k){this.replaceData(S,k,"")},replaceData:function(S,k,K){K=this.data.substring(0,S)+K+this.data.substring(S+k),this.nodeValue=this.data=K,this.length=K.length}},y(Xe,oe),_t.prototype={nodeName:"#text",nodeType:M,splitText:function(S){var k=this.data,K=k.substring(S);k=k.substring(0,S),this.data=this.nodeValue=k,this.length=k.length;var me=this.ownerDocument.createTextNode(K);return this.parentNode&&this.parentNode.insertBefore(me,this.nextSibling),me}},y(_t,Xe),Bt.prototype={nodeName:"#comment",nodeType:C},y(Bt,Xe),hr.prototype={nodeName:"#cdata-section",nodeType:H},y(hr,Xe),Bn.prototype.nodeType=R,y(Bn,oe),jn.prototype.nodeType=ee,y(jn,oe),rr.prototype.nodeType=V,y(rr,oe),ut.prototype.nodeType=te,y(ut,oe),gn.prototype.nodeName="#document-fragment",gn.prototype.nodeType=F,y(gn,oe),Tt.prototype.nodeType=J,y(Tt,oe),ir.prototype.serializeToString=function(S,k,K){return wt.call(S,k,K)},oe.prototype.toString=wt;try{if(Object.defineProperty){let S=function(k){switch(k.nodeType){case I:case F:var K=[];for(k=k.firstChild;k;)k.nodeType!==7&&k.nodeType!==8&&K.push(S(k)),k=k.nextSibling;return K.join("");default:return k.nodeValue}};Object.defineProperty(ce.prototype,"length",{get:function(){return ae(this),this.$$length}}),Object.defineProperty(oe.prototype,"textContent",{get:function(){return S(this)},set:function(k){switch(this.nodeType){case I:case F:for(;this.firstChild;)this.removeChild(this.firstChild);(k||String(k))&&this.appendChild(this.ownerDocument.createTextNode(k));break;default:this.data=k,this.value=k,this.nodeValue=k}}}),et=function(k,K,me){k["$$"+K]=me}}}catch{}je.DocumentType=Bn,je.DOMException=B,je.DOMImplementation=se,je.Element=pt,je.Node=oe,je.NodeList=z,je.XMLSerializer=ir},884:(We,je,Ae)=>{var Ie=Ae(29).freeze;je.XML_ENTITIES=Ie({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),je.HTML_ENTITIES=Ie({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Ã",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Ã…",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"ÃŒ",Iacute:"Ã",Icirc:"ÃŽ",Iuml:"Ã",ETH:"Ã",Ntilde:"Ñ",Ograve:"Ã’",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ãœ",Yacute:"Ã",THORN:"Þ",szlig:"ß",agrave:"à ",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"Ã¥",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"Ã",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"Â¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"ÂÂ",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"âˆ",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"âˆ",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"â‹…",Alpha:"Α",Beta:"Î’",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Îœ",Nu:"Î",Xi:"Ξ",Omicron:"Ο",Pi:"Î ",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Î¥",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"Ï€",rho:"Ï",sigmaf:"Ï‚",sigma:"σ",tau:"Ï„",upsilon:"Ï…",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"Ï‘",upsih:"Ï’",piv:"Ï–",OElig:"Å’",oelig:"Å“",Scaron:"Å ",scaron:"Å¡",Yuml:"Ÿ",fnof:"Æ’",circ:"ˆ",tilde:"Ëœ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"â€",lrm:"‎",rlm:"â€",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"â€",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"â„¢",larr:"â†",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"â—Š",spades:"â™ ",clubs:"♣",hearts:"♥",diams:"♦"}),je.entityMap=je.HTML_ENTITIES},331:(We,je,Ae)=>{var Ie=Ae(665);Ie.DOMImplementation,Ie.XMLSerializer,je.DOMParser=Ae(407).DOMParser},996:(We,je,Ae)=>{var Ie=Ae(29).NAMESPACE,O=/[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]/,ke=new RegExp("[\\-\\.0-9"+O.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),ie=new RegExp("^"+O.source+ke.source+"*(?::"+O.source+ke.source+"*)?$"),we=0,Te=1,U=2,w=3,L=4,y=5,A=6,I=7;function E(p,v){this.message=p,this.locator=v,Error.captureStackTrace&&Error.captureStackTrace(this,E)}function M(){}function H(p,v,P,B,z){function ce(it){if(it>65535){var pt=55296+((it-=65536)>>10),Qt=56320+(1023&it);return String.fromCharCode(pt,Qt)}return String.fromCharCode(it)}function ae(it){var pt=it.slice(1,-1);return Object.hasOwnProperty.call(P,pt)?P[pt]:pt.charAt(0)==="#"?ce(parseInt(pt.substr(1).replace("x","0x"))):(z.error("entity not found:"+it),it)}function ge(it){if(it>Y){var pt=p.substring(Y,it).replace(/&#?\w+;/g,ae);oe&&ue(Y),B.characters(pt,0,it-Y),Y=it}}function ue(it,pt){for(;it>=pe&&(pt=se.exec(p));)le=pt.index,pe=le+pt[0].length,oe.lineNumber++;oe.columnNumber=it-le+1}for(var le=0,pe=0,se=/.*(?:\r\n?|\n)|.*$/g,oe=B.locator,xe=[{currentNSMap:v}],Q={},Y=0;;){try{var de=p.indexOf("<",Y);if(de<0){if(!p.substr(Y).match(/^\s*$/)){var $=B.doc,Z=$.createTextNode(p.substr(Y));$.appendChild(Z),B.currentElement=Z}return}switch(de>Y&&ge(de),p.charAt(de+1)){case"/":var fe=p.indexOf(">",de+3),Pe=p.substring(de+2,fe).replace(/[ \t\n\r]+$/g,""),Re=xe.pop();fe<0?(Pe=p.substring(de+2).replace(/[\s<].*/,""),z.error("end tag name: "+Pe+" is not complete:"+Re.tagName),fe=de+1+Pe.length):Pe.match(/\s</)&&(Pe=Pe.replace(/[\s<].*/,""),z.error("end tag name: "+Pe+" maybe not complete"),fe=de+1+Pe.length);var Fe=Re.localNSMap,He=Re.tagName==Pe;if(He||Re.tagName&&Re.tagName.toLowerCase()==Pe.toLowerCase()){if(B.endElement(Re.uri,Re.localName,Pe),Fe)for(var Ze in Fe)Object.prototype.hasOwnProperty.call(Fe,Ze)&&B.endPrefixMapping(Ze);He||z.fatalError("end tag name: "+Pe+" is not match the current start tagName:"+Re.tagName)}else xe.push(Re);fe++;break;case"?":oe&&ue(de),fe=ee(p,de,B);break;case"!":oe&&ue(de),fe=F(p,de,B,z);break;default:oe&&ue(de);var $e=new D,Et=xe[xe.length-1].currentNSMap,bn=(fe=V(p,de,$e,Et,ae,z),$e.length);if(!$e.closed&&N(p,fe,$e.tagName,Q)&&($e.closed=!0,P.nbsp||z.warning("unclosed xml attribute")),oe&&bn){for(var Tn=te(oe,{}),Lt=0;Lt<bn;Lt++){var Gt=$e[Lt];ue(Gt.offset),Gt.locator=te(oe,{})}B.locator=Tn,J($e,B,Et)&&xe.push($e),B.locator=oe}else J($e,B,Et)&&xe.push($e);Ie.isHTML($e.uri)&&!$e.closed?fe=C(p,fe,$e.tagName,ae,B):fe++}}catch(it){if(it instanceof E)throw it;z.error("element parse error: "+it),fe=-1}fe>Y?Y=fe:ge(Math.max(de,Y)+1)}}function te(p,v){return v.lineNumber=p.lineNumber,v.columnNumber=p.columnNumber,v}function V(p,v,P,B,z,ce){function ae(oe,xe,Q){P.attributeNames.hasOwnProperty(oe)&&ce.fatalError("Attribute "+oe+" redefined"),P.addValue(oe,xe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,z),Q)}for(var ge,ue=++v,le=we;;){var pe=p.charAt(ue);switch(pe){case"=":if(le===Te)ge=p.slice(v,ue),le=w;else{if(le!==U)throw new Error("attribute equal must after attrName");le=w}break;case"'":case'"':if(le===w||le===Te){if(le===Te&&(ce.warning('attribute value must after "="'),ge=p.slice(v,ue)),v=ue+1,!((ue=p.indexOf(pe,v))>0))throw new Error("attribute value no end '"+pe+"' match");ae(ge,se=p.slice(v,ue),v-1),le=y}else{if(le!=L)throw new Error('attribute value must after "="');ae(ge,se=p.slice(v,ue),v),ce.warning('attribute "'+ge+'" missed start quot('+pe+")!!"),v=ue+1,le=y}break;case"/":switch(le){case we:P.setTagName(p.slice(v,ue));case y:case A:case I:le=I,P.closed=!0;case L:case Te:case U:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ce.error("unexpected end of input"),le==we&&P.setTagName(p.slice(v,ue)),ue;case">":switch(le){case we:P.setTagName(p.slice(v,ue));case y:case A:case I:break;case L:case Te:(se=p.slice(v,ue)).slice(-1)==="/"&&(P.closed=!0,se=se.slice(0,-1));case U:le===U&&(se=ge),le==L?(ce.warning('attribute "'+se+'" missed quot(")!'),ae(ge,se,v)):((!Ie.isHTML(B[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),ae(se,se,v));break;case w:throw new Error("attribute value missed!!")}return ue;case"€":pe=" ";default:if(pe<=" ")switch(le){case we:P.setTagName(p.slice(v,ue)),le=A;break;case Te:ge=p.slice(v,ue),le=U;break;case L:var se=p.slice(v,ue);ce.warning('attribute "'+se+'" missed quot(")!!'),ae(ge,se,v);case y:le=A}else switch(le){case U:P.tagName,(!Ie.isHTML(B[""])||!ge.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+ge+'" missed value!! "'+ge+'" instead2!!'),ae(ge,ge,v),v=ue,le=Te;break;case y:ce.warning('attribute space is required"'+ge+'"!!');case A:le=Te,v=ue;break;case w:le=L,v=ue;break;case I:throw new Error("elements closed character '/' and '>' must be connected to")}}ue++}}function J(p,v,P){for(var B=p.tagName,z=null,ce=p.length;ce--;){var ae=p[ce],ge=ae.qName,ue=ae.value;if((oe=ge.indexOf(":"))>0)var le=ae.prefix=ge.slice(0,oe),pe=ge.slice(oe+1),se=le==="xmlns"&&pe;else pe=ge,le=null,se=ge==="xmlns"&&"";ae.localName=pe,se!==!1&&(z==null&&(z={},R(P,P={})),P[se]=z[se]=ue,ae.uri=Ie.XMLNS,v.startPrefixMapping(se,ue))}for(ce=p.length;ce--;)(le=(ae=p[ce]).prefix)&&(le==="xml"&&(ae.uri=Ie.XML),le!=="xmlns"&&(ae.uri=P[le||""]));var oe;(oe=B.indexOf(":"))>0?(le=p.prefix=B.slice(0,oe),pe=p.localName=B.slice(oe+1)):(le=null,pe=p.localName=B);var xe=p.uri=P[le||""];if(v.startElement(xe,pe,B,p),!p.closed)return p.currentNSMap=P,p.localNSMap=z,!0;if(v.endElement(xe,pe,B),z)for(le in z)Object.prototype.hasOwnProperty.call(z,le)&&v.endPrefixMapping(le)}function C(p,v,P,B,z){if(/^(?:script|textarea)$/i.test(P)){var ce=p.indexOf("</"+P+">",v),ae=p.substring(v+1,ce);if(/[&<]/.test(ae))return/^script$/i.test(P)?(z.characters(ae,0,ae.length),ce):(ae=ae.replace(/&#?\w+;/g,B),z.characters(ae,0,ae.length),ce)}return v+1}function N(p,v,P,B){var z=B[P];return z==null&&((z=p.lastIndexOf("</"+P+">"))<v&&(z=p.lastIndexOf("</"+P)),B[P]=z),z<v}function R(p,v){for(var P in p)Object.prototype.hasOwnProperty.call(p,P)&&(v[P]=p[P])}function F(p,v,P,B){if(p.charAt(v+2)==="-")return p.charAt(v+3)==="-"?(z=p.indexOf("-->",v+4))>v?(P.comment(p,v+4,z-v-4),z+3):(B.error("Unclosed comment"),-1):-1;if(p.substr(v+3,6)=="CDATA["){var z=p.indexOf("]]>",v+9);return P.startCDATA(),P.characters(p,v+9,z-v-9),P.endCDATA(),z+3}var ce=X(p,v),ae=ce.length;if(ae>1&&/!doctype/i.test(ce[0][0])){var ge=ce[1][0],ue=!1,le=!1;ae>3&&(/^public$/i.test(ce[2][0])?(ue=ce[3][0],le=ae>4&&ce[4][0]):/^system$/i.test(ce[2][0])&&(le=ce[3][0]));var pe=ce[ae-1];return P.startDTD(ge,ue,le),P.endDTD(),pe.index+pe[0].length}return-1}function ee(p,v,P){var B=p.indexOf("?>",v);if(B){var z=p.substring(v,B).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return z?(z[0].length,P.processingInstruction(z[1],z[2]),B+2):-1}return-1}function D(){this.attributeNames={}}function X(p,v){var P,B=[],z=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(z.lastIndex=v,z.exec(p);P=z.exec(p);)if(B.push(P),P[1])return B}E.prototype=new Error,E.prototype.name=E.name,M.prototype={parse:function(p,v,P){var B=this.domBuilder;B.startDocument(),R(v,v={}),H(p,v,P,B,this.errorHandler),B.endDocument()}},D.prototype={setTagName:function(p){if(!ie.test(p))throw new Error("invalid tagName:"+p);this.tagName=p},addValue:function(p,v,P){if(!ie.test(p))throw new Error("invalid attribute:"+p);this.attributeNames[p]=this.length,this[this.length++]={qName:p,value:v,offset:P}},length:0,getLocalName:function(p){return this[p].localName},getLocator:function(p){return this[p].locator},getQName:function(p){return this[p].qName},getURI:function(p){return this[p].uri},getValue:function(p){return this[p].value}},je.XMLReader=M,je.ParseError=E},675:(We,je,Ae)=>{var Ie,O=Ae.g!==void 0?Ae.g:typeof window<"u"?window:{},ke=Ae(893);typeof document<"u"?Ie=document:(Ie=O["__GLOBAL_DOCUMENT_CACHE@4"])||(Ie=O["__GLOBAL_DOCUMENT_CACHE@4"]=ke),We.exports=Ie},697:(We,je,Ae)=>{var Ie;Ie=typeof window<"u"?window:Ae.g!==void 0?Ae.g:typeof self<"u"?self:{},We.exports=Ie},988:We=>{We.exports=Ae;var je=Object.prototype.toString;function Ae(Ie){if(!Ie)return!1;var O=je.call(Ie);return O==="[object Function]"||typeof Ie=="function"&&O!=="[object RegExp]"||typeof window<"u"&&(Ie===window.setTimeout||Ie===window.alert||Ie===window.confirm||Ie===window.prompt)}},642:(We,je)=>{function Ae(Te){if(Te&&typeof Te=="object"){var U=Te.which||Te.keyCode||Te.charCode;U&&(Te=U)}if(typeof Te=="number")return ie[Te];var w,L=String(Te);return(w=Ie[L.toLowerCase()])?w:(w=O[L.toLowerCase()])||(L.length===1?L.charCodeAt(0):void 0)}Ae.isEventKey=function(Te,U){if(Te&&typeof Te=="object"){var w=Te.which||Te.keyCode||Te.charCode;if(w==null)return!1;if(typeof U=="string"){var L;if((L=Ie[U.toLowerCase()])||(L=O[U.toLowerCase()]))return L===w}else if(typeof U=="number")return U===w;return!1}};var Ie=(je=We.exports=Ae).code=je.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},O=je.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*! * Programatically add the following */for(ke=97;ke<123;ke++)Ie[String.fromCharCode(ke)]=ke-32;for(var ke=48;ke<58;ke++)Ie[ke-48]=ke;for(ke=1;ke<13;ke++)Ie["f"+ke]=ke+111;for(ke=0;ke<10;ke++)Ie["numpad "+ke]=ke+96;var ie=je.names=je.title={};for(ke in Ie)ie[Ie[ke]]=ke;for(var we in O)Ie[we]=O[we]},656:(We,je,Ae)=>{var Ie=Ae(559).getUint64,O=function(ke){var ie=new DataView(ke.buffer,ke.byteOffset,ke.byteLength),we={version:ke[0],flags:new Uint8Array(ke.subarray(1,4)),references:[],referenceId:ie.getUint32(4),timescale:ie.getUint32(8)},Te=12;we.version===0?(we.earliestPresentationTime=ie.getUint32(Te),we.firstOffset=ie.getUint32(Te+4),Te+=8):(we.earliestPresentationTime=Ie(ke.subarray(Te)),we.firstOffset=Ie(ke.subarray(Te+8)),Te+=16),Te+=2;var U=ie.getUint16(Te);for(Te+=2;U>0;Te+=12,U--)we.references.push({referenceType:(128&ke[Te])>>>7,referencedSize:2147483647&ie.getUint32(Te),subsegmentDuration:ie.getUint32(Te+4),startsWithSap:!!(128&ke[Te+8]),sapType:(112&ke[Te+8])>>>4,sapDeltaTime:268435455&ie.getUint32(Te+8)});return we};We.exports=O},275:We=>{var je,Ae,Ie,O,ke,ie,we,Te=9e4;je=function(U){return U*Te},Ae=function(U,w){return U*w},Ie=function(U){return U/Te},O=function(U,w){return U/w},ke=function(U,w){return je(O(U,w))},ie=function(U,w){return Ae(Ie(U),w)},we=function(U,w,L){return Ie(L?U:U-w)},We.exports={ONE_SECOND_IN_TS:Te,secondsToVideoTs:je,secondsToAudioTs:Ae,videoTsToSeconds:Ie,audioTsToSeconds:O,audioTsToVideoTs:ke,videoTsToAudioTs:ie,metadataTsToSeconds:we}},559:We=>{var je=Math.pow(2,32),Ae=function(Ie){var O,ke=new DataView(Ie.buffer,Ie.byteOffset,Ie.byteLength);return ke.getBigUint64?(O=ke.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(O):O:ke.getUint32(0)*je+ke.getUint32(4)};We.exports={getUint64:Ae,MAX_UINT32:je}},54:We=>{function je(Ae,Ie){var O,ke=null;try{O=JSON.parse(Ae,Ie)}catch(ie){ke=ie}return[ke,O]}We.exports=je},311:function(We){var je,Ae,Ie,O,ke;je=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Ae=/^(?=([^\/?#]*))\1([^]*)$/,Ie=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,ke={buildAbsoluteURL:function(ie,we,Te){if(Te=Te||{},ie=ie.trim(),!(we=we.trim())){if(!Te.alwaysNormalize)return ie;var U=ke.parseURL(ie);if(!U)throw new Error("Error trying to parse base URL.");return U.path=ke.normalizePath(U.path),ke.buildURLFromParts(U)}var w=ke.parseURL(we);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return Te.alwaysNormalize?(w.path=ke.normalizePath(w.path),ke.buildURLFromParts(w)):we;var L=ke.parseURL(ie);if(!L)throw new Error("Error trying to parse base URL.");if(!L.netLoc&&L.path&&L.path[0]!=="/"){var y=Ae.exec(L.path);L.netLoc=y[1],L.path=y[2]}L.netLoc&&!L.path&&(L.path="/");var A={scheme:L.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(A.netLoc=L.netLoc,w.path[0]!=="/"))if(w.path){var I=L.path,E=I.substring(0,I.lastIndexOf("/")+1)+w.path;A.path=ke.normalizePath(E)}else A.path=L.path,w.params||(A.params=L.params,w.query||(A.query=L.query));return A.path===null&&(A.path=Te.alwaysNormalize?ke.normalizePath(w.path):w.path),ke.buildURLFromParts(A)},parseURL:function(ie){var we=je.exec(ie);return we?{scheme:we[1]||"",netLoc:we[2]||"",path:we[3]||"",params:we[4]||"",query:we[5]||"",fragment:we[6]||""}:null},normalizePath:function(ie){for(ie=ie.split("").reverse().join("").replace(Ie,"");ie.length!==(ie=ie.replace(O,"")).length;);return ie.split("").reverse().join("")},buildURLFromParts:function(ie){return ie.scheme+ie.netLoc+ie.path+ie.params+ie.query+ie.fragment}},We.exports=ke},323:(We,je,Ae)=>{Ae.r(je),Ae.d(je,{default:()=>mg});var Ie=Ae(697),O=Ae.n(Ie),ke=Ae(675),ie=Ae.n(ke);function we(){return we=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},we.apply(this,arguments)}var Te=Ae(642),U=Ae.n(Te);function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L(t,i){return(L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r})(t,i)}function y(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,L(t,i)}var A=Ae(54),I=Ae.n(A),E=Ae(424),M=Ae.n(E),H=Ae(497),te=Ae.n(H);function V(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function J(t,i,r){return(J=V()?Reflect.construct.bind():function(e,n,a){var s=[null];s.push.apply(s,n);var o=new(Function.bind.apply(e,s));return a&&L(o,a.prototype),o}).apply(null,arguments)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),i&&L(t,i)}var N=Ae(311),R=Ae.n(N),F="http://example.com",ee=function(t,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(t)&&(t=O().location&&O().location.href||"");var r=typeof O().URL=="function",e=/^\/\//.test(t),n=!O().location&&!/\/\//i.test(t);if(r?t=new(O()).URL(t,O().location||F):/\/\//i.test(t)||(t=R().buildAbsoluteURL(O().location&&O().location.href||"",t)),r){var a=new URL(i,t);return n?a.href.slice(F.length):e?a.href.slice(a.protocol.length):a.href}return R().buildAbsoluteURL(t,i)};const D=ee;var X=function(){function t(){this.listeners={}}var i=t.prototype;return i.on=function(r,e){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(e)},i.off=function(r,e){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(e);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},i.trigger=function(r){var e=this.listeners[r];if(e)if(arguments.length===2)for(var n=e.length,a=0;a<n;++a)e[a].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),o=e.length,l=0;l<o;++l)e[l].apply(this,s)},i.dispose=function(){this.listeners={}},i.pipe=function(r){this.on("data",function(e){r.push(e)})},t}(),p=function(t){return O().atob?O().atob(t):Buffer.from(t,"base64").toString("binary")};function v(t){for(var i=p(t),r=new Uint8Array(i.length),e=0;e<i.length;e++)r[e]=i.charCodeAt(e);return r}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var P,B,z=function(t){function i(){var r;return(r=t.call(this)||this).buffer="",r}return y(i,t),i.prototype.push=function(r){var e;for(this.buffer+=r,e=this.buffer.indexOf(` `);e>-1;e=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},i}(X),ce=" ",ae=function(t){var i=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),r={};return i[1]&&(r.length=parseInt(i[1],10)),i[2]&&(r.offset=parseInt(i[2],10)),r},ge=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ue=function(t){for(var i,r=t.split(ge()),e={},n=r.length;n--;)r[n]!==""&&((i=/([^=]*)=(.*)/.exec(r[n]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},le=function(t){function i(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}y(i,t);var r=i.prototype;return r.push=function(e){var n,a,s=this;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(o,l){var h=l(e);return h===e?o:o.concat([h])},[e]).forEach(function(o){for(var l=0;l<s.customParsers.length;l++)if(s.customParsers[l].call(s,o))return;if(o.indexOf("#EXT")===0)if(o=o.replace("\r",""),n=/^#EXTM3U/.exec(o))s.trigger("data",{type:"tag",tagType:"m3u"});else{if(n=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(o))return a={type:"tag",tagType:"inf"},n[1]&&(a.duration=parseFloat(n[1])),n[2]&&(a.title=n[2]),void s.trigger("data",a);if(n=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"targetduration"},n[1]&&(a.duration=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"version"},n[1]&&(a.version=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"media-sequence"},n[1]&&(a.number=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"discontinuity-sequence"},n[1]&&(a.number=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(o))return a={type:"tag",tagType:"playlist-type"},n[1]&&(a.playlistType=n[1]),void s.trigger("data",a);if(n=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(o))return a=we(ae(n[1]),{type:"tag",tagType:"byterange"}),void s.trigger("data",a);if(n=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(o))return a={type:"tag",tagType:"allow-cache"},n[1]&&(a.allowed=!/NO/.test(n[1])),void s.trigger("data",a);if(n=/^#EXT-X-MAP:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"map"},n[1]){var h=ue(n[1]);h.URI&&(a.uri=h.URI),h.BYTERANGE&&(a.byterange=ae(h.BYTERANGE))}s.trigger("data",a)}else if(n=/^#EXT-X-STREAM-INF:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"stream-inf"},n[1]){if(a.attributes=ue(n[1]),a.attributes.RESOLUTION){var g=a.attributes.RESOLUTION.split("x"),b={};g[0]&&(b.width=parseInt(g[0],10)),g[1]&&(b.height=parseInt(g[1],10)),a.attributes.RESOLUTION=b}a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["FRAME-RATE"]&&(a.attributes["FRAME-RATE"]=parseFloat(a.attributes["FRAME-RATE"])),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))}s.trigger("data",a)}else{if(n=/^#EXT-X-MEDIA:?(.*)$/.exec(o))return a={type:"tag",tagType:"media"},n[1]&&(a.attributes=ue(n[1])),void s.trigger("data",a);if(n=/^#EXT-X-ENDLIST/.exec(o))s.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(n=/^#EXT-X-DISCONTINUITY/.exec(o)))return(n=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(o))?(a={type:"tag",tagType:"program-date-time"},n[1]&&(a.dateTimeString=n[1],a.dateTimeObject=new Date(n[1])),void s.trigger("data",a)):(n=/^#EXT-X-KEY:?(.*)$/.exec(o))?(a={type:"tag",tagType:"key"},n[1]&&(a.attributes=ue(n[1]),a.attributes.IV&&(a.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void s.trigger("data",a)):(n=/^#EXT-X-START:?(.*)$/.exec(o))?(a={type:"tag",tagType:"start"},n[1]&&(a.attributes=ue(n[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void s.trigger("data",a)):(n=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(o))?(a={type:"tag",tagType:"cue-out-cont"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a)):(n=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(o))?(a={type:"tag",tagType:"cue-out"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a)):(n=/^#EXT-X-CUE-IN:?(.*)?$/.exec(o))?(a={type:"tag",tagType:"cue-in"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a)):(n=/^#EXT-X-SKIP:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"skip"}).attributes=ue(n[1]),a.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(a.attributes["SKIPPED-SEGMENTS"]=parseInt(a.attributes["SKIPPED-SEGMENTS"],10)),a.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(a.attributes["RECENTLY-REMOVED-DATERANGES"]=a.attributes["RECENTLY-REMOVED-DATERANGES"].split(ce)),void s.trigger("data",a)):(n=/^#EXT-X-PART:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"part"}).attributes=ue(n[1]),["DURATION"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=parseFloat(a.attributes[_]))}),["INDEPENDENT","GAP"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=/YES/.test(a.attributes[_]))}),a.attributes.hasOwnProperty("BYTERANGE")&&(a.attributes.byterange=ae(a.attributes.BYTERANGE)),void s.trigger("data",a)):(n=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"server-control"}).attributes=ue(n[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=parseFloat(a.attributes[_]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=/YES/.test(a.attributes[_]))}),void s.trigger("data",a)):(n=/^#EXT-X-PART-INF:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"part-inf"}).attributes=ue(n[1]),["PART-TARGET"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=parseFloat(a.attributes[_]))}),void s.trigger("data",a)):(n=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"preload-hint"}).attributes=ue(n[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(_){if(a.attributes.hasOwnProperty(_)){a.attributes[_]=parseInt(a.attributes[_],10);var G=_==="BYTERANGE-LENGTH"?"length":"offset";a.attributes.byterange=a.attributes.byterange||{},a.attributes.byterange[G]=a.attributes[_],delete a.attributes[_]}}),void s.trigger("data",a)):(n=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(o))&&n[1]?((a={type:"tag",tagType:"rendition-report"}).attributes=ue(n[1]),["LAST-MSN","LAST-PART"].forEach(function(_){a.attributes.hasOwnProperty(_)&&(a.attributes[_]=parseInt(a.attributes[_],10))}),void s.trigger("data",a)):void s.trigger("data",{type:"tag",data:o.slice(4)});s.trigger("data",{type:"tag",tagType:"discontinuity"})}}}else s.trigger("data",{type:"comment",text:o.slice(1)})})}},r.addParser=function(e){var n=this,a=e.expression,s=e.customType,o=e.dataParser,l=e.segment;typeof o!="function"&&(o=function(h){return h}),this.customParsers.push(function(h){if(a.exec(h))return n.trigger("data",{type:"custom",data:o(h),customType:s,segment:l}),!0})},r.addTagMapper=function(e){var n=e.expression,a=e.map,s=function(o){return n.test(o)?a(o):o};this.tagMappers.push(s)},i}(X),pe=function(t){return t.toLowerCase().replace(/-(\w)/g,function(i){return i[1].toUpperCase()})},se=function(t){var i={};return Object.keys(t).forEach(function(r){i[pe(r)]=t[r]}),i},oe=function(t){var i=t.serverControl,r=t.targetDuration,e=t.partTargetDuration;if(i){var n="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=r&&3*r,l=e&&2*e;r&&!i.hasOwnProperty(a)&&(i[a]=o,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&i[a]<o&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+i[a]+") to targetDuration * 3 ("+o+")"}),i[a]=o),e&&!i.hasOwnProperty(s)&&(i[s]=3*e,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+i[s]+")."})),e&&i[s]<l&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+i[s]+") to partTargetDuration * 2 ("+l+")."}),i[s]=l)}},xe=function(t){function i(){var e;(e=t.call(this)||this).lineStream=new z,e.parseStream=new le,e.lineStream.pipe(e.parseStream);var n,a,s=w(e),o=[],l={},h=!1,g=function(){},b={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},_="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",G=0;e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var ne=0,ye=0;return e.on("end",function(){l.uri||!l.parts&&!l.preloadHints||(!l.map&&n&&(l.map=n),!l.key&&a&&(l.key=a),!l.timeline&&typeof G=="number"&&(l.timeline=G),e.manifest.preloadSegment=l)}),e.parseStream.on("data",function(re){var Ue,Ge;({tag:function(){({version:function(){re.version&&(this.manifest.version=re.version)},"allow-cache":function(){this.manifest.allowCache=re.allowed,"allowed"in re||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var be={};"length"in re&&(l.byterange=be,be.length=re.length,"offset"in re||(re.offset=ne)),"offset"in re&&(l.byterange=be,be.offset=re.offset),ne=be.offset+be.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),re.duration>0&&(l.duration=re.duration),re.duration===0&&(l.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(re.attributes)if(re.attributes.METHOD!=="NONE")if(re.attributes.URI){if(re.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:re.attributes});if(re.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:re.attributes.URI});if(re.attributes.KEYFORMAT===_)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(re.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(re.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),re.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):re.attributes.KEYID&&re.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:re.attributes.KEYFORMAT,keyId:re.attributes.KEYID.substring(2)},pssh:v(re.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));re.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:re.attributes.METHOD||"AES-128",uri:re.attributes.URI},re.attributes.IV!==void 0&&(a.iv=re.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else a=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(re.number)?this.manifest.mediaSequence=re.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+re.number})},"discontinuity-sequence":function(){isFinite(re.number)?(this.manifest.discontinuitySequence=re.number,G=re.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+re.number})},"playlist-type":function(){/VOD|EVENT/.test(re.playlistType)?this.manifest.playlistType=re.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+re.playlist})},map:function(){n={},re.uri&&(n.uri=re.uri),re.byterange&&(n.byterange=re.byterange),a&&(n.key=a)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||b,re.attributes?(l.attributes||(l.attributes={}),we(l.attributes,re.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||b,re.attributes&&re.attributes.TYPE&&re.attributes["GROUP-ID"]&&re.attributes.NAME){var be=this.manifest.mediaGroups[re.attributes.TYPE];be[re.attributes["GROUP-ID"]]=be[re.attributes["GROUP-ID"]]||{},Ue=be[re.attributes["GROUP-ID"]],(Ge={default:/yes/i.test(re.attributes.DEFAULT)}).default?Ge.autoselect=!0:Ge.autoselect=/yes/i.test(re.attributes.AUTOSELECT),re.attributes.LANGUAGE&&(Ge.language=re.attributes.LANGUAGE),re.attributes.URI&&(Ge.uri=re.attributes.URI),re.attributes["INSTREAM-ID"]&&(Ge.instreamId=re.attributes["INSTREAM-ID"]),re.attributes.CHARACTERISTICS&&(Ge.characteristics=re.attributes.CHARACTERISTICS),re.attributes.FORCED&&(Ge.forced=/yes/i.test(re.attributes.FORCED)),Ue[re.attributes.NAME]=Ge}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){G+=1,l.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=re.dateTimeString,this.manifest.dateTimeObject=re.dateTimeObject),l.dateTimeString=re.dateTimeString,l.dateTimeObject=re.dateTimeObject},targetduration:function(){!isFinite(re.duration)||re.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+re.duration}):(this.manifest.targetDuration=re.duration,oe.call(this,this.manifest))},start:function(){re.attributes&&!isNaN(re.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:re.attributes["TIME-OFFSET"],precise:re.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){l.cueOut=re.data},"cue-out-cont":function(){l.cueOutCont=re.data},"cue-in":function(){l.cueIn=re.data},skip:function(){this.manifest.skip=se(re.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",re.attributes,["SKIPPED-SEGMENTS"])},part:function(){var be=this;h=!0;var De=this.manifest.segments.length,Se=se(re.attributes);l.parts=l.parts||[],l.parts.push(Se),Se.byterange&&(Se.byterange.hasOwnProperty("offset")||(Se.byterange.offset=ye),ye=Se.byterange.offset+Se.byterange.length);var Me=l.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+Me+" for segment #"+De,re.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(Ce,ze){Ce.hasOwnProperty("lastPart")||be.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ze+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var be=this.manifest.serverControl=se(re.attributes);be.hasOwnProperty("canBlockReload")||(be.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),oe.call(this,this.manifest),be.canSkipDateranges&&!be.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var be=this.manifest.segments.length,De=se(re.attributes),Se=De.type&&De.type==="PART";l.preloadHints=l.preloadHints||[],l.preloadHints.push(De),De.byterange&&(De.byterange.hasOwnProperty("offset")||(De.byterange.offset=Se?ye:0,Se&&(ye=De.byterange.offset+De.byterange.length)));var Me=l.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+Me+" for segment #"+be,re.attributes,["TYPE","URI"]),De.type)for(var Ce=0;Ce<l.preloadHints.length-1;Ce++){var ze=l.preloadHints[Ce];!ze.type||ze.type===De.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+Me+" for segment #"+be+" has the same TYPE "+De.type+" as preload hint #"+Ce})}},"rendition-report":function(){var be=se(re.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(be);var De=this.manifest.renditionReports.length-1,Se=["LAST-MSN","URI"];h&&Se.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+De,re.attributes,Se)},"part-inf":function(){this.manifest.partInf=se(re.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",re.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),oe.call(this,this.manifest)}}[re.tagType]||g).call(s)},uri:function(){l.uri=re.uri,o.push(l),this.manifest.targetDuration&&!("duration"in l)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),l.duration=this.manifest.targetDuration),a&&(l.key=a),l.timeline=G,n&&(l.map=n),ye=0,l={}},comment:function(){},custom:function(){re.segment?(l.custom=l.custom||{},l.custom[re.customType]=re.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[re.customType]=re.data)}})[re.type].call(s)}),e}y(i,t);var r=i.prototype;return r.warnOnMissingAttributes_=function(e,n,a){var s=[];a.forEach(function(o){n.hasOwnProperty(o)||s.push(o)}),s.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+s.join(", ")})},r.push=function(e){this.lineStream.push(e)},r.end=function(){this.lineStream.push(` `),this.trigger("end")},r.addParser=function(e){this.parseStream.addParser(e)},r.addTagMapper=function(e){this.parseStream.addTagMapper(e)},i}(X),Q={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^/},Y=["video","audio","text"],de=["Video","Audio","Text"],$=function(t){return t&&t.replace(/avc1\.(\d+)\.(\d+)/i,function(i,r,e){return"avc1."+("00"+Number(r).toString(16)).slice(-2)+"00"+("00"+Number(e).toString(16)).slice(-2)})},Z=function(t){t===void 0&&(t="");var i=t.split(","),r=[];return i.forEach(function(e){var n;e=e.trim(),Y.forEach(function(a){var s=Q[a].exec(e.toLowerCase());if(s&&!(s.length<=1)){n=a;var o=e.substring(0,s[1].length),l=e.replace(o,"");r.push({type:o,details:l,mediaType:a})}}),n||r.push({type:e,details:"",mediaType:"unknown"})}),r},fe=function(t,i){if(!t.mediaGroups.AUDIO||!i)return null;var r=t.mediaGroups.AUDIO[i];if(!r)return null;for(var e in r){var n=r[e];if(n.default&&n.playlists)return Z(n.playlists[0].attributes.CODECS)}return null},Pe=function(t){return t===void 0&&(t=""),Q.audio.test(t.trim().toLowerCase())},Re=function(t){return t===void 0&&(t=""),Q.text.test(t.trim().toLowerCase())},Fe=function(t){if(t&&typeof t=="string"){var i=t.toLowerCase().split(",").map(function(n){return $(n.trim())}),r="video";i.length===1&&Pe(i[0])?r="audio":i.length===1&&Re(i[0])&&(r="application");var e="mp4";return i.every(function(n){return Q.mp4.test(n)})?e="mp4":i.every(function(n){return Q.webm.test(n)})?e="webm":i.every(function(n){return Q.ogg.test(n)})&&(e="ogg"),r+"/"+e+';codecs="'+t+'"'}},He=function(t){return t===void 0&&(t=""),O().MediaSource&&O().MediaSource.isTypeSupported&&O().MediaSource.isTypeSupported(Fe(t))||!1},Ze=function(t){return t===void 0&&(t=""),t.toLowerCase().split(",").every(function(i){i=i.trim();for(var r=0;r<de.length;r++){var e=de[r];if(Q["muxer"+e].test(i))return!0}return!1})},$e="mp4a.40.2",Et="avc1.4d400d",bn=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Tn=/^application\/dash\+xml/i,Lt=function(t){return bn.test(t)?"hls":Tn.test(t)?"dash":t==="application/vnd.videojs.vhs+json"?"vhs-json":null},Gt=function(t){return t.toString(2).length},it=function(t){return Math.ceil(Gt(t)/8)},pt=function(t){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},Qt=function(t){return pt(t)},Xe=function(t){return t instanceof Uint8Array?t:(!Array.isArray(t)&&!Qt(t)&&!(t instanceof ArrayBuffer)&&(t=typeof t!="number"||typeof t=="number"&&t!=t?0:[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},_t=O().BigInt||Number,Bt=[_t("0x1"),_t("0x100"),_t("0x10000"),_t("0x1000000"),_t("0x100000000"),_t("0x10000000000"),_t("0x1000000000000"),_t("0x100000000000000"),_t("0x10000000000000000")];P=new Uint16Array([65484]),(B=new Uint8Array(P.buffer,P.byteOffset,P.byteLength))[0]===255||B[0];var hr=function(t,i){var r=i===void 0?{}:i,e=r.signed,n=e!==void 0&&e,a=r.le,s=a!==void 0&&a;t=Xe(t);var o=s?"reduce":"reduceRight",l=(t[o]?t[o]:Array.prototype[o]).call(t,function(g,b,_){var G=s?_:Math.abs(_+1-t.length);return g+_t(b)*Bt[G]},_t(0));if(n){var h=Bt[t.length]/_t(2)-_t(1);(l=_t(l))>h&&(l-=h,l-=h,l-=_t(2))}return Number(l)},Bn=function(t,i){var r={}.le,e=r!==void 0&&r;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!=t)&&(t=0),t=_t(t);for(var n=it(t),a=new Uint8Array(new ArrayBuffer(n)),s=0;s<n;s++){var o=e?s:Math.abs(s+1-a.length);a[o]=Number(t/Bt[s]&_t(255)),t<0&&(a[o]=Math.abs(~a[o]),a[o]-=s===0?1:2)}return a},jn=function(t,i){if(typeof t!="string"&&t&&typeof t.toString=="function"&&(t=t.toString()),typeof t!="string")return new Uint8Array;i||(t=unescape(encodeURIComponent(t)));for(var r=new Uint8Array(t.length),e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r},rr=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];if((i=i.filter(function(s){return s&&(s.byteLength||s.length)&&typeof s!="string"})).length<=1)return Xe(i[0]);var e=i.reduce(function(s,o,l){return s+(o.byteLength||o.length)},0),n=new Uint8Array(e),a=0;return i.forEach(function(s){s=Xe(s),n.set(s,a),a+=s.byteLength}),n},ut=function(t,i,r){var e=r===void 0?{}:r,n=e.offset,a=n===void 0?0:n,s=e.mask,o=s===void 0?[]:s;t=Xe(t);var l=(i=Xe(i)).every?i.every:Array.prototype.every;return i.length&&t.length-a>=i.length&&l.call(i,function(h,g){return h===(o[g]?o[g]&t[a+g]:t[a+g])})},gn=function(t,i,r){i.forEach(function(e){for(var n in t.mediaGroups[e])for(var a in t.mediaGroups[e][n]){var s=t.mediaGroups[e][n][a];r(s,e,n,a)}})},Tt=Ae(331),ir=function(t){return!!t&&typeof t=="object"},wt=function t(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return r.reduce(function(n,a){return typeof a!="object"||Object.keys(a).forEach(function(s){Array.isArray(n[s])&&Array.isArray(a[s])?n[s]=n[s].concat(a[s]):ir(n[s])&&ir(a[s])?n[s]=t(n[s],a[s]):n[s]=a[s]}),n},{})},Fn=function(t){return Object.keys(t).map(function(i){return t[i]})},qn=function(t,i){for(var r=[],e=t;e<i;e++)r.push(e);return r},on=function(t){return t.reduce(function(i,r){return i.concat(r)},[])},ve=function(t){if(!t.length)return[];for(var i=[],r=0;r<t.length;r++)i.push(t[r]);return i},Ee=function(t,i){return t.reduce(function(r,e,n){return e[i]&&r.push(n),r},[])},et=function(t,i){for(var r=0;r<t.length;r++)if(i(t[r]))return r;return-1},S=function(t,i){return Fn(t.reduce(function(r,e){return e.forEach(function(n){r[i(n)]=n}),r},{}))},k={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},K=function(t){var i=t.baseUrl,r=i===void 0?"":i,e=t.source,n=e===void 0?"":e,a=t.range,s=a===void 0?"":a,o=t.indexRange,l=o===void 0?"":o,h={uri:n,resolvedUri:D(r||"",n)};if(s||l){var g,b=(s||l).split("-"),_=O().BigInt?O().BigInt(b[0]):parseInt(b[0],10),G=O().BigInt?O().BigInt(b[1]):parseInt(b[1],10);_<Number.MAX_SAFE_INTEGER&&typeof _=="bigint"&&(_=Number(_)),G<Number.MAX_SAFE_INTEGER&&typeof G=="bigint"&&(G=Number(G)),typeof(g=typeof G=="bigint"||typeof _=="bigint"?O().BigInt(G)-O().BigInt(_)+O().BigInt(1):G-_+1)=="bigint"&&g<Number.MAX_SAFE_INTEGER&&(g=Number(g)),h.byterange={length:g,offset:_}}return h},me=function(t){var i;return i=typeof t.offset=="bigint"||typeof t.length=="bigint"?O().BigInt(t.offset)+O().BigInt(t.length)-O().BigInt(1):t.offset+t.length-1,t.offset+"-"+i},Be=function(t){return t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t},Ke={static:function(t){var i=t.duration,r=t.timescale,e=r===void 0?1:r,n=t.sourceDuration,a=t.periodDuration,s=Be(t.endNumber),o=i/e;return typeof s=="number"?{start:0,end:s}:typeof a=="number"?{start:0,end:a/o}:{start:0,end:n/o}},dynamic:function(t){var i=t.NOW,r=t.clientOffset,e=t.availabilityStartTime,n=t.timescale,a=n===void 0?1:n,s=t.duration,o=t.periodStart,l=o===void 0?0:o,h=t.minimumUpdatePeriod,g=h===void 0?0:h,b=t.timeShiftBufferDepth,_=b===void 0?1/0:b,G=Be(t.endNumber),ne=(i+r)/1e3,ye=e+l,re=ne+g-ye,Ue=Math.ceil(re*a/s),Ge=Math.floor((ne-ye-_)*a/s),be=Math.floor((ne-ye)*a/s);return{start:Math.max(0,Ge),end:typeof G=="number"?G:Math.min(Ue,be)}}},nt=function(t){return function(i){var r=t.duration,e=t.timescale,n=e===void 0?1:e,a=t.periodStart,s=t.startNumber;return{number:(s===void 0?1:s)+i,duration:r/n,timeline:a,time:i*r}}},at=function(t){var i=t.type,r=t.duration,e=t.timescale,n=e===void 0?1:e,a=t.periodDuration,s=t.sourceDuration,o=Ke[i](t),l=o.start,h=o.end,g=qn(l,h).map(nt(t));if(i==="static"){var b=g.length-1,_=typeof a=="number"?a:s;g[b].duration=_-r/n*b}return g},un=function(t){var i=t.baseUrl,r=t.initialization,e=r===void 0?{}:r,n=t.sourceDuration,a=t.indexRange,s=a===void 0?"":a,o=t.periodStart,l=t.presentationTime,h=t.number,g=h===void 0?0:h,b=t.duration;if(!i)throw new Error(k.NO_BASE_URL);var _=K({baseUrl:i,source:e.sourceURL,range:e.range}),G=K({baseUrl:i,source:i,indexRange:s});if(G.map=_,b){var ne=at(t);ne.length&&(G.duration=ne[0].duration,G.timeline=ne[0].timeline)}else n&&(G.duration=n,G.timeline=o);return G.presentationTime=l||o,G.number=g,[G]},Mt=function(t,i,r){var e,n=t.sidx.map?t.sidx.map:null,a=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,l=o.offset+o.length,h=i.timescale,g=i.references.filter(function(Me){return Me.referenceType!==1}),b=[],_=t.endList?"static":"dynamic",G=t.sidx.timeline,ne=G,ye=t.mediaSequence||0;e=typeof i.firstOffset=="bigint"?O().BigInt(l)+i.firstOffset:l+i.firstOffset;for(var re=0;re<g.length;re++){var Ue=i.references[re],Ge=Ue.referencedSize,be=Ue.subsegmentDuration,De=void 0;De=typeof e=="bigint"?e+O().BigInt(Ge)-O().BigInt(1):e+Ge-1;var Se=un({baseUrl:r,timescale:h,timeline:s,periodStart:G,presentationTime:ne,number:ye,duration:be,sourceDuration:a,indexRange:e+"-"+De,type:_})[0];n&&(Se.map=n),b.push(Se),e+=typeof e=="bigint"?O().BigInt(Ge):Ge,ne+=be/h,ye++}return t.segments=b,t},nn=["AUDIO","SUBTITLES"],Hn=1/60,ln=function(t){return S(t,function(i){return i.timeline}).sort(function(i,r){return i.timeline>r.timeline?1:-1})},cn=function(t,i){for(var r=0;r<t.length;r++)if(t[r].attributes.NAME===i)return t[r];return null},rn=function(t){var i=[];return gn(t,nn,function(r,e,n,a){i=i.concat(r.playlists||[])}),i},Ht=function(t){var i=t.playlist,r=t.mediaSequence;i.mediaSequence=r,i.segments.forEach(function(e,n){e.number=i.mediaSequence+n})},vn=function(t){var i=t.oldPlaylists,r=t.newPlaylists,e=t.timelineStarts;r.forEach(function(n){n.discontinuitySequence=et(e,function(l){return l.timeline===n.timeline});var a=cn(i,n.attributes.NAME);if(a&&!n.sidx){var s=n.segments[0],o=et(a.segments,function(l){return Math.abs(l.presentationTime-s.presentationTime)<Hn});if(o===-1)return Ht({playlist:n,mediaSequence:a.mediaSequence+a.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),void((!a.segments.length&&n.timeline>a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--);a.segments[o].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),Ht({playlist:n,mediaSequence:a.segments[o].number})}})},An=function(t){var i=t.oldManifest,r=t.newManifest,e=i.playlists.concat(rn(i)),n=r.playlists.concat(rn(r));return r.timelineStarts=ln([i.timelineStarts,r.timelineStarts]),vn({oldPlaylists:e,newPlaylists:n,timelineStarts:r.timelineStarts}),r},Pn=function(t){return t&&t.uri+"-"+me(t.byterange)},dn=function(t){return Fn(t.reduce(function(i,r){var e,n=r.attributes.id+(r.attributes.lang||"");return i[n]?(r.segments&&(r.segments[0]&&(r.segments[0].discontinuity=!0),(e=i[n].segments).push.apply(e,r.segments)),r.attributes.contentProtection&&(i[n].attributes.contentProtection=r.attributes.contentProtection)):(i[n]=r,i[n].attributes.timelineStarts=[]),i[n].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{})).map(function(i){return i.discontinuityStarts=Ee(i.segments||[],"discontinuity"),i})},On=function(t,i){var r=Pn(t.sidx),e=r&&i[r]&&i[r].sidx;return e&&Mt(t,e,t.sidx.resolvedUri),t},Li=function(t,i){if(i===void 0&&(i={}),!Object.keys(i).length)return t;for(var r in t)t[r]=On(t[r],i);return t},ni=function(t,i){var r,e=t.attributes,n=t.segments,a=t.sidx,s=t.mediaSequence,o=t.discontinuitySequence,l=t.discontinuityStarts,h={attributes:(r={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:o,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:s,segments:n};return e.contentProtection&&(h.contentProtection=e.contentProtection),a&&(h.sidx=a),i&&(h.attributes.AUDIO="audio",h.attributes.SUBTITLES="subs"),h},Mi=function(t){var i,r=t.attributes,e=t.segments,n=t.mediaSequence,a=t.discontinuityStarts,s=t.discontinuitySequence;e===void 0&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var o=((i={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,i);return r.codecs&&(o.CODECS=r.codecs),{attributes:o,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:n,segments:e}},ri=function(t,i,r){i===void 0&&(i={}),r===void 0&&(r=!1);var e,n=t.reduce(function(a,s){var o=s.attributes.role&&s.attributes.role.value||"",l=s.attributes.lang||"",h=s.attributes.label||"main";if(l&&!s.attributes.label){var g=o?" ("+o+")":"";h=""+s.attributes.lang+g}a[h]||(a[h]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});var b=On(ni(s,r),i);return a[h].playlists.push(b),e===void 0&&o==="main"&&((e=s).default=!0),a},{});return e||(n[Object.keys(n)[0]].default=!0),n},ar=function(t,i){return i===void 0&&(i={}),t.reduce(function(r,e){var n=e.attributes.lang||"text";return r[n]||(r[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),r[n].playlists.push(On(Mi(e),i)),r},{})},Ir=function(t){return t.reduce(function(i,r){return r&&r.forEach(function(e){var n=e.channel,a=e.language;i[a]={autoselect:!1,default:!1,instreamId:n,language:a},e.hasOwnProperty("aspectRatio")&&(i[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(i[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(i[a]["3D"]=e["3D"])}),i},{})},Ya=function(t){var i,r=t.attributes,e=t.segments,n=t.sidx,a=t.discontinuityStarts,s={attributes:(i={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:e};return r.frameRate&&(s.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(s.contentProtection=r.contentProtection),n&&(s.sidx=n),s},Ri=function(t){var i=t.attributes;return i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video"},xd=function(t){var i=t.attributes;return i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio"},Id=function(t){var i=t.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"},Ad=function(t,i){t.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=et(i,function(e){return e.timeline===r.timeline}),r.segments&&r.segments.forEach(function(e,n){e.number=n})})},Ro=function(t){return t?Object.keys(t).reduce(function(i,r){var e=t[r];return i.concat(e.playlists)},[]):[]},Pd=function(t){var i,r=t.dashPlaylists,e=t.locations,n=t.sidxMapping,a=n===void 0?{}:n,s=t.previousManifest;if(!r.length)return{};var o=r[0].attributes,l=o.sourceDuration,h=o.type,g=o.suggestedPresentationDelay,b=o.minimumUpdatePeriod,_=dn(r.filter(Ri)).map(Ya),G=dn(r.filter(xd)),ne=dn(r.filter(Id)),ye=r.map(function(Me){return Me.attributes.captionServices}).filter(Boolean),re={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:l,playlists:Li(_,a)};b>=0&&(re.minimumUpdatePeriod=1e3*b),e&&(re.locations=e),h==="dynamic"&&(re.suggestedPresentationDelay=g);var Ue=re.playlists.length===0,Ge=G.length?ri(G,a,Ue):null,be=ne.length?ar(ne,a):null,De=_.concat(Ro(Ge),Ro(be)),Se=De.map(function(Me){return Me.timelineStarts});return re.timelineStarts=ln(Se),Ad(De,re.timelineStarts),Ge&&(re.mediaGroups.AUDIO.audio=Ge),be&&(re.mediaGroups.SUBTITLES.subs=be),ye.length&&(re.mediaGroups["CLOSED-CAPTIONS"].cc=Ir(ye)),s?An({oldManifest:s,newManifest:re}):re},Od=function(t,i,r){var e=t.NOW,n=t.clientOffset,a=t.availabilityStartTime,s=t.timescale,o=s===void 0?1:s,l=t.periodStart,h=l===void 0?0:l,g=t.minimumUpdatePeriod,b=(e+n)/1e3+(g===void 0?0:g)-(a+h);return Math.ceil((b*o-i)/r)},No=function(t,i){for(var r=t.type,e=t.minimumUpdatePeriod,n=e===void 0?0:e,a=t.media,s=a===void 0?"":a,o=t.sourceDuration,l=t.timescale,h=l===void 0?1:l,g=t.startNumber,b=g===void 0?1:g,_=t.periodStart,G=[],ne=-1,ye=0;ye<i.length;ye++){var re=i[ye],Ue=re.d,Ge=re.r||0,be=re.t||0;ne<0&&(ne=be),be&&be>ne&&(ne=be);var De=void 0;if(Ge<0){var Se=ye+1;De=Se===i.length?r==="dynamic"&&n>0&&s.indexOf("$Number$")>0?Od(t,ne,Ue):(o*h-ne)/Ue:(i[Se].t-ne)/Ue}else De=Ge+1;for(var Me=b+G.length+De,Ce=b+G.length;Ce<Me;)G.push({number:Ce,duration:Ue/h,time:ne,timeline:_}),ne+=Ue,Ce++}return G},Dd=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Ld=function(t){return function(i,r,e,n){if(i==="$$")return"$";if(t[r]===void 0)return i;var a=""+t[r];return r==="RepresentationID"||(n=e?parseInt(n,10):1,a.length>=n)?a:""+new Array(n-a.length+1).join("0")+a}},Uo=function(t,i){return t.replace(Dd,Ld(i))},Md=function(t,i){return t.duration||i?t.duration?at(t):No(t,i):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]},Rd=function(t,i){var r={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,n=e===void 0?{sourceURL:"",range:""}:e,a=K({baseUrl:t.baseUrl,source:Uo(n.sourceURL,r),range:n.range});return Md(t,i).map(function(s){r.Number=s.number,r.Time=s.time;var o=Uo(t.media||"",r),l=t.timescale||1,h=t.presentationTimeOffset||0,g=t.periodStart+(s.time-h)/l;return{uri:o,timeline:s.timeline,duration:s.duration,resolvedUri:D(t.baseUrl||"",o),map:a,number:s.number,presentationTime:g}})},Nd=function(t,i){var r=t.baseUrl,e=t.initialization,n=e===void 0?{}:e,a=K({baseUrl:r,source:n.sourceURL,range:n.range}),s=K({baseUrl:r,source:i.media,range:i.mediaRange});return s.map=a,s},Ud=function(t,i){var r=t.duration,e=t.segmentUrls,n=e===void 0?[]:e,a=t.periodStart;if(!r&&!i||r&&i)throw new Error(k.SEGMENT_TIME_UNSPECIFIED);var s,o=n.map(function(l){return Nd(t,l)});return r&&(s=at(t)),i&&(s=No(t,i)),s.map(function(l,h){if(o[h]){var g=o[h],b=t.timescale||1,_=t.presentationTimeOffset||0;return g.timeline=l.timeline,g.duration=l.duration,g.number=l.number,g.presentationTime=a+(l.time-_)/b,g}}).filter(function(l){return l})},Bd=function(t){var i,r,e=t.attributes,n=t.segmentInfo;n.template?(r=Rd,i=wt(e,n.template)):n.base?(r=un,i=wt(e,n.base)):n.list&&(r=Ud,i=wt(e,n.list));var a={attributes:e};if(!r)return a;var s=r(i,n.segmentTimeline);if(i.duration){var o=i,l=o.duration,h=o.timescale,g=h===void 0?1:h;i.duration=l/g}else s.length?i.duration=s.reduce(function(b,_){return Math.max(b,Math.ceil(_.duration))},0):i.duration=0;return a.attributes=i,a.segments=s,n.base&&i.indexRange&&(a.sidx=s[0],a.segments=[]),a},jd=function(t){return t.map(Bd)},kt=function(t,i){return ve(t.childNodes).filter(function(r){return r.tagName===i})},$a=function(t){return t.textContent.trim()},Fd=function(t){return parseFloat(t.split("/").reduce(function(i,r){return i/r}))},Ar=function(t){var i=31536e3,r=2592e3,e=86400,n=3600,a=60,s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!s)return 0;var o=s.slice(1),l=o[0],h=o[1],g=o[2],b=o[3],_=o[4],G=o[5];return parseFloat(l||0)*i+parseFloat(h||0)*r+parseFloat(g||0)*e+parseFloat(b||0)*n+parseFloat(_||0)*a+parseFloat(G||0)},qd=function(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)},Bo={mediaPresentationDuration:function(t){return Ar(t)},availabilityStartTime:function(t){return qd(t)/1e3},minimumUpdatePeriod:function(t){return Ar(t)},suggestedPresentationDelay:function(t){return Ar(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return Ar(t)},start:function(t){return Ar(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},frameRate:function(t){return Fd(t)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var i=parseInt(t,10);return isNaN(i)?Ar(t):i},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},zt=function(t){return t&&t.attributes?ve(t.attributes).reduce(function(i,r){var e=Bo[r.name]||Bo.DEFAULT;return i[r.name]=e(r.value),i},{}):{}},Hd={"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"},Ni=function(t,i){return i.length?on(t.map(function(r){return i.map(function(e){return D(r,$a(e))})})):t},Ja=function(t){var i=kt(t,"SegmentTemplate")[0],r=kt(t,"SegmentList")[0],e=r&&kt(r,"SegmentURL").map(function(b){return wt({tag:"SegmentURL"},zt(b))}),n=kt(t,"SegmentBase")[0],a=r||i,s=a&&kt(a,"SegmentTimeline")[0],o=r||n||i,l=o&&kt(o,"Initialization")[0],h=i&&zt(i);h&&l?h.initialization=l&&zt(l):h&&h.initialization&&(h.initialization={sourceURL:h.initialization});var g={template:h,segmentTimeline:s&&kt(s,"S").map(function(b){return zt(b)}),list:r&&wt(zt(r),{segmentUrls:e,initialization:zt(l)}),base:n&&wt(zt(n),{initialization:zt(l)})};return Object.keys(g).forEach(function(b){g[b]||delete g[b]}),g},Vd=function(t,i,r){return function(e){var n=kt(e,"BaseURL"),a=Ni(i,n),s=wt(t,zt(e)),o=Ja(e);return a.map(function(l){return{segmentInfo:wt(r,o),attributes:wt(s,{baseUrl:l})}})}},Wd=function(t){return t.reduce(function(i,r){var e=zt(r);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var n=Hd[e.schemeIdUri];if(n){i[n]={attributes:e};var a=kt(r,"cenc:pssh")[0];if(a){var s=$a(a);i[n].pssh=s&&v(s)}}return i},{})},Gd=function(t){return t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"?(typeof t.value!="string"?[]:t.value.split(";")).map(function(i){var r,e;if(e=i,/^CC\d=/.test(i)){var n=i.split("=");r=n[0],e=n[1]}else/^CC\d$/.test(i)&&(r=i);return{channel:r,language:e}}):t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"?(typeof t.value!="string"?[]:t.value.split(";")).map(function(i){var r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){var e=i.split("="),n=e[0],a=e[1],s=a===void 0?"":a;r.channel=n,r.language=i,s.split(",").forEach(function(o){var l=o.split(":"),h=l[0],g=l[1];h==="lang"?r.language=g:h==="er"?r.easyReader=Number(g):h==="war"?r.aspectRatio=Number(g):h==="3D"&&(r["3D"]=Number(g))})}else r.language=i;return r.channel&&(r.channel="SERVICE"+r.channel),r}):void 0},zd=function(t,i,r){return function(e){var n=zt(e),a=Ni(i,kt(e,"BaseURL")),s=kt(e,"Role")[0],o={role:zt(s)},l=wt(t,n,o),h=kt(e,"Accessibility")[0],g=Gd(zt(h));g&&(l=wt(l,{captionServices:g}));var b=kt(e,"Label")[0];if(b&&b.childNodes.length){var _=b.childNodes[0].nodeValue.trim();l=wt(l,{label:_})}var G=Wd(kt(e,"ContentProtection"));Object.keys(G).length&&(l=wt(l,{contentProtection:G}));var ne=Ja(e),ye=kt(e,"Representation"),re=wt(r,ne);return on(ye.map(Vd(l,a,re)))}},Xd=function(t,i){return function(r,e){var n=Ni(i,kt(r.node,"BaseURL")),a=wt(t,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var s=kt(r.node,"AdaptationSet"),o=Ja(r.node);return on(s.map(zd(a,n,o)))}},Kd=function(t){var i=t.attributes,r=t.priorPeriodAttributes,e=t.mpdType;return typeof i.start=="number"?i.start:r&&typeof r.start=="number"&&typeof r.duration=="number"?r.start+r.duration:r||e!=="static"?null:0},Qd=function(t,i){i===void 0&&(i={});var r=i,e=r.manifestUri,n=e===void 0?"":e,a=r.NOW,s=a===void 0?Date.now():a,o=r.clientOffset,l=o===void 0?0:o,h=kt(t,"Period");if(!h.length)throw new Error(k.INVALID_NUMBER_OF_PERIOD);var g=kt(t,"Location"),b=zt(t),_=Ni([n],kt(t,"BaseURL"));b.type=b.type||"static",b.sourceDuration=b.mediaPresentationDuration||0,b.NOW=s,b.clientOffset=l,g.length&&(b.locations=g.map($a));var G=[];return h.forEach(function(ne,ye){var re=zt(ne),Ue=G[ye-1];re.start=Kd({attributes:re,priorPeriodAttributes:Ue?Ue.attributes:null,mpdType:b.type}),G.push({node:ne,attributes:re})}),{locations:b.locations,representationInfo:on(G.map(Xd(b,_)))}},jo=function(t){if(t==="")throw new Error(k.DASH_EMPTY_MANIFEST);var i,r,e=new Tt.DOMParser;try{r=(i=e.parseFromString(t,"application/xml"))&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(k.DASH_INVALID_XML);return r},Yd=function(t){var i=kt(t,"UTCTiming")[0];if(!i)return null;var r=zt(i);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error(k.UNSUPPORTED_UTC_TIMING_SCHEME)}return r},$d=function(t,i){i===void 0&&(i={});var r=Qd(jo(t),i),e=jd(r.representationInfo);return Pd({dashPlaylists:e,locations:r.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest})},Jd=function(t){return Yd(jo(t))},Zd=Ae(656),eh=Ae.n(Zd),th=Xe([73,68,51]),nh=function(t,i){i===void 0&&(i=0);var r=(t=Xe(t))[i+5],e=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];return(16&r)>>4?e+20:e+10},ii=function t(i,r){return r===void 0&&(r=0),(i=Xe(i)).length-r<10||!ut(i,th,{offset:r})?r:t(i,r+=nh(i,r))},Fo=function(t){return typeof t=="string"?jn(t):t},rh=function(t){return Array.isArray(t)?t.map(function(i){return Fo(i)}):[Fo(t)]},ih=function t(i,r,e){e===void 0&&(e=!1),r=rh(r),i=Xe(i);var n=[];if(!r.length)return n;for(var a=0;a<i.length;){var s=(i[a]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3])>>>0,o=i.subarray(a+4,a+8);if(s===0)break;var l=a+s;if(l>i.length){if(e)break;l=i.length}var h=i.subarray(a+8,l);ut(o,r[0])&&(r.length===1?n.push(h):n.push.apply(n,t(h,r.slice(1),e))),a=l}return n},Ui={EBML:Xe([26,69,223,163]),DocType:Xe([66,130]),Segment:Xe([24,83,128,103]),SegmentInfo:Xe([21,73,169,102]),Tracks:Xe([22,84,174,107]),Track:Xe([174]),TrackNumber:Xe([215]),DefaultDuration:Xe([35,227,131]),TrackEntry:Xe([174]),TrackType:Xe([131]),FlagDefault:Xe([136]),CodecID:Xe([134]),CodecPrivate:Xe([99,162]),VideoTrack:Xe([224]),AudioTrack:Xe([225]),Cluster:Xe([31,67,182,117]),Timestamp:Xe([231]),TimestampScale:Xe([42,215,177]),BlockGroup:Xe([160]),BlockDuration:Xe([155]),Block:Xe([161]),SimpleBlock:Xe([163])},Za=[128,64,32,16,8,4,2,1],ah=function(t){for(var i=1,r=0;r<Za.length&&!(t&Za[r]);r++)i++;return i},Bi=function(t,i,r,e){r===void 0&&(r=!0),e===void 0&&(e=!1);var n=ah(t[i]),a=t.subarray(i,i+n);return r&&((a=Array.prototype.slice.call(t,i,i+n))[0]^=Za[n-1]),{length:n,value:hr(a,{signed:e}),bytes:a}},qo=function t(i){return typeof i=="string"?i.match(/.{1,2}/g).map(function(r){return t(r)}):typeof i=="number"?Bn(i):i},sh=function(t){return Array.isArray(t)?t.map(function(i){return qo(i)}):[qo(t)]},oh=function t(i,r,e){if(e>=r.length)return r.length;var n=Bi(r,e,!1);if(ut(i.bytes,n.bytes))return e;var a=Bi(r,e+n.length);return t(i,r,e+a.length+a.value+n.length)},Ho=function t(i,r){r=sh(r),i=Xe(i);var e=[];if(!r.length)return e;for(var n=0;n<i.length;){var a=Bi(i,n,!1),s=Bi(i,n+a.length),o=n+a.length+s.length;s.value===127&&(s.value=oh(a,i,o),s.value!==i.length&&(s.value-=o));var l=o+s.value>i.length?i.length:o+s.value,h=i.subarray(o,l);ut(r[0],a.bytes)&&(r.length===1?e.push(h):e=e.concat(t(h,r.slice(1)))),n+=a.length+s.length+h.length}return e},uh=Xe([0,0,0,1]),lh=Xe([0,0,1]),ch=Xe([0,0,3]),dh=function(t){for(var i=[],r=1;r<t.length-2;)ut(t.subarray(r,r+3),ch)&&(i.push(r+2),r++),r++;if(i.length===0)return t;var e=t.length-i.length,n=new Uint8Array(e),a=0;for(r=0;r<e;a++,r++)a===i[0]&&(a++,i.shift()),n[r]=t[a];return n},Vo=function(t,i,r,e){t=Xe(t),r=[].concat(r);for(var n,a=0,s=0;a<t.length&&(s<e||n);){var o=void 0;if(ut(t.subarray(a),uh)?o=4:ut(t.subarray(a),lh)&&(o=3),o){if(s++,n)return dh(t.subarray(n,a));var l=void 0;i==="h264"?l=31&t[a+o]:i==="h265"&&(l=t[a+o]>>1&63),r.indexOf(l)!==-1&&(n=a+o),a+=o+(i==="h264"?1:2)}else a++}return t.subarray(0,0)},hh=function(t,i,r){return Vo(t,"h264",i,r)},ph=function(t,i,r){return Vo(t,"h265",i,r)},Yt={webm:Xe([119,101,98,109]),matroska:Xe([109,97,116,114,111,115,107,97]),flac:Xe([102,76,97,67]),ogg:Xe([79,103,103,83]),ac3:Xe([11,119]),riff:Xe([82,73,70,70]),avi:Xe([65,86,73]),wav:Xe([87,65,86,69]),"3gp":Xe([102,116,121,112,51,103]),mp4:Xe([102,116,121,112]),fmp4:Xe([115,116,121,112]),mov:Xe([102,116,121,112,113,116]),moov:Xe([109,111,111,118]),moof:Xe([109,111,111,102])},Pr={aac:function(t){var i=ii(t);return ut(t,[255,16],{offset:i,mask:[255,22]})},mp3:function(t){var i=ii(t);return ut(t,[255,2],{offset:i,mask:[255,6]})},webm:function(t){var i=Ho(t,[Ui.EBML,Ui.DocType])[0];return ut(i,Yt.webm)},mkv:function(t){var i=Ho(t,[Ui.EBML,Ui.DocType])[0];return ut(i,Yt.matroska)},mp4:function(t){return!Pr["3gp"](t)&&!Pr.mov(t)&&(!!(ut(t,Yt.mp4,{offset:4})||ut(t,Yt.fmp4,{offset:4})||ut(t,Yt.moof,{offset:4})||ut(t,Yt.moov,{offset:4}))||void 0)},mov:function(t){return ut(t,Yt.mov,{offset:4})},"3gp":function(t){return ut(t,Yt["3gp"],{offset:4})},ac3:function(t){var i=ii(t);return ut(t,Yt.ac3,{offset:i})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var i=0;i+188<t.length&&i<188;){if(t[i]===71&&t[i+188]===71)return!0;i+=1}return!1},flac:function(t){var i=ii(t);return ut(t,Yt.flac,{offset:i})},ogg:function(t){return ut(t,Yt.ogg)},avi:function(t){return ut(t,Yt.riff)&&ut(t,Yt.avi,{offset:8})},wav:function(t){return ut(t,Yt.riff)&&ut(t,Yt.wav,{offset:8})},h264:function(t){return hh(t,7,3).length},h265:function(t){return ph(t,[32,33],3).length}},es=Object.keys(Pr).filter(function(t){return t!=="ts"&&t!=="h264"&&t!=="h265"}).concat(["ts","h264","h265"]);/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */es.forEach(function(t){var i=Pr[t];Pr[t]=function(r){return i(Xe(r))}});var fh=Pr,ts=function(t){t=Xe(t);for(var i=0;i<es.length;i++){var r=es[i];if(fh[r](t))return r}return""},mh=function(t){return ih(t,["moof"]).length>0},ji=Ae(275);function Wo(t){return(Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)})(t)}function gh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ns(t){var i=typeof Map=="function"?new Map:void 0;return ns=function(r){if(r===null||!gh(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(i!==void 0){if(i.has(r))return i.get(r);i.set(r,e)}function e(){return J(r,arguments,Wo(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),L(e,r)},ns(t);/** * @license * Video.js 7.21.2 <http://videojs.com/> * Copyright Brightcove, Inc. <https://www.brightcove.com/> * Available under Apache License Version 2.0 * <https://github.com/videojs/video.js/blob/main/LICENSE> * * Includes vtt.js <https://github.com/mozilla/vtt.js> * Available under Apache License Version 2.0 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE> */}for(var ai,Go="7.21.2",Vn={},sr=function(t,i){return Vn[t]=Vn[t]||[],i&&(Vn[t]=Vn[t].concat(i)),Vn[t]},vh=function(t,i){sr(t,i)},zo=function(t,i){var r=sr(t).indexOf(i);return!(r<=-1||(Vn[t]=Vn[t].slice(),Vn[t].splice(r,1),0))},yh=function(t,i){sr(t,[].concat(i).map(function(r){var e=function n(){return zo(t,n),r.apply(void 0,arguments)};return e}))},Fi={prefixed:!0},qi=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Xo=qi[0],Hi=0;Hi<qi.length;Hi++)if(qi[Hi][1]in ie()){ai=qi[Hi];break}if(ai){for(var Vi=0;Vi<ai.length;Vi++)Fi[Xo[Vi]]=ai[Vi];Fi.prefixed=ai[0]!==Xo[0]}var an=[],_h=function(t,i){return function(r,e,n){var a=i.levels[e],s=new RegExp("^("+a+")$");if(r!=="log"&&n.unshift(r.toUpperCase()+":"),n.unshift(t+":"),an){an.push([].concat(n));var o=an.length-1e3;an.splice(0,o>0?o:0)}if(O().console){var l=O().console[r];!l&&r==="debug"&&(l=O().console.info||O().console.log),l&&a&&s.test(r)&&l[Array.isArray(n)?"apply":"call"](O().console,n)}}};function Ko(t){var i,r="info",e=function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];i("log",r,a)};return i=_h(t,e),e.createLogger=function(n){return Ko(t+": "+n)},e.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},e.level=function(n){if(typeof n=="string"){if(!e.levels.hasOwnProperty(n))throw new Error('"'+n+'" in not a valid log level');r=n}return r},e.history=function(){return an?[].concat(an):[]},e.history.filter=function(n){return(an||[]).filter(function(a){return new RegExp(".*"+n+".*").test(a[0])})},e.history.clear=function(){an&&(an.length=0)},e.history.disable=function(){an!==null&&(an.length=0,an=null)},e.history.enable=function(){an===null&&(an=[])},e.error=function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return i("error",r,a)},e.warn=function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return i("warn",r,a)},e.debug=function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return i("debug",r,a)},e}var Je=Ko("VIDEOJS"),Qo=Je.createLogger,bh=Object.prototype.toString,Yo=function(t){return Wn(t)?Object.keys(t):[]};function Or(t,i){Yo(t).forEach(function(r){return i(t[r],r)})}function Th(t,i,r){return r===void 0&&(r=0),Yo(t).reduce(function(e,n){return i(e,t[n],n)},r)}function Ct(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),e=1;e<i;e++)r[e-1]=arguments[e];return Object.assign?we.apply(void 0,[t].concat(r)):(r.forEach(function(n){!n||Or(n,function(a,s){t[s]=a})}),t)}function Wn(t){return!!t&&typeof t=="object"}function si(t){return Wn(t)&&bh.call(t)==="[object Object]"&&t.constructor===Object}function oi(t,i){if(!t||!i)return"";if(typeof O().getComputedStyle=="function"){var r;try{r=O().getComputedStyle(t)}catch{return""}return r?r.getPropertyValue(i)||r[i]:""}return""}var jt=O().navigator&&O().navigator.userAgent||"",$o=/AppleWebKit\/([\d.]+)/i.exec(jt),Sh=$o?parseFloat($o.pop()):null,Jo=/iPod/i.test(jt),Eh=function(){var t=jt.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Gn=/Android/i.test(jt),rs=function(){var t=jt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var i=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return i&&r?parseFloat(t[1]+"."+t[2]):i||null}(),Zo=Gn&&rs<5&&Sh<537,eu=/Firefox/i.test(jt),ui=/Edg/i.test(jt),zn=!ui&&(/Chrome/i.test(jt)||/CriOS/i.test(jt)),tu=function(){var t=jt.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),li=function(){var t=/MSIE\s(\d+)\.\d/.exec(jt),i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(jt)&&/rv:11.0/.test(jt)&&(i=11),i}(),is=/Safari/i.test(jt)&&!zn&&!Gn&&!ui,nu=/Windows/i.test(jt),Dr=!!(Lr()&&("ontouchstart"in O()||O().navigator.maxTouchPoints||O().DocumentTouch&&O().document instanceof O().DocumentTouch)),as=/iPad/i.test(jt)||is&&Dr&&!/iPhone/i.test(jt),ss=/iPhone/i.test(jt)&&!as,$t=ss||as||Jo,Wi=(is||$t)&&!zn,wh=Object.freeze({__proto__:null,IS_IPOD:Jo,IOS_VERSION:Eh,IS_ANDROID:Gn,ANDROID_VERSION:rs,IS_NATIVE_ANDROID:Zo,IS_FIREFOX:eu,IS_EDGE:ui,IS_CHROME:zn,CHROME_VERSION:tu,IE_VERSION:li,IS_SAFARI:is,IS_WINDOWS:nu,TOUCH_ENABLED:Dr,IS_IPAD:as,IS_IPHONE:ss,IS_IOS:$t,IS_ANY_SAFARI:Wi});function ru(t){return typeof t=="string"&&!!t.trim()}function iu(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function kh(t){return new RegExp("(^|\\s)"+t+"($|\\s)")}function Lr(){return ie()===O().document}function Mr(t){return Wn(t)&&t.nodeType===1}function au(){try{return O().parent!==O().self}catch{return!0}}function su(t){return function(i,r){if(!ru(i))return ie()[t](null);ru(r)&&(r=ie().querySelector(r));var e=Mr(r)?r:ie();return e[t]&&e[t](i)}}function st(t,i,r,e){t===void 0&&(t="div"),i===void 0&&(i={}),r===void 0&&(r={});var n=ie().createElement(t);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(Je.warn(`Setting attributes in the second argument of createEl() has been deprecated. Use the third argument instead. createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),n.setAttribute(a,s)):a==="textContent"?pr(n,s):(n[a]!==s||a==="tabIndex")&&(n[a]=s)}),Object.getOwnPropertyNames(r).forEach(function(a){n.setAttribute(a,r[a])}),e&&ls(n,e),n}function pr(t,i){return t.textContent===void 0?t.innerText=i:t.textContent=i,t}function os(t,i){i.firstChild?i.insertBefore(t,i.firstChild):i.appendChild(t)}function fr(t,i){return iu(i),t.classList?t.classList.contains(i):kh(i).test(t.className)}function Xn(t,i){return t.classList?t.classList.add(i):fr(t,i)||(t.className=(t.className+" "+i).trim()),t}function ci(t,i){return t?(t.classList?t.classList.remove(i):(iu(i),t.className=t.className.split(/\s+/).filter(function(r){return r!==i}).join(" ")),t):(Je.warn("removeClass was called with an element that doesn't exist"),null)}function ou(t,i,r){var e=fr(t,i);if(typeof r=="function"&&(r=r(t,i)),typeof r!="boolean"&&(r=!e),r!==e)return r?Xn(t,i):ci(t,i),t}function uu(t,i){Object.getOwnPropertyNames(i).forEach(function(r){var e=i[r];e==null||e===!1?t.removeAttribute(r):t.setAttribute(r,e===!0?"":e)})}function Kn(t){var i={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&t.attributes.length>0)for(var e=t.attributes,n=e.length-1;n>=0;n--){var a=e[n].name,s=e[n].value;(typeof t[a]=="boolean"||r.indexOf(","+a+",")!==-1)&&(s=s!==null),i[a]=s}return i}function lu(t,i){return t.getAttribute(i)}function Rr(t,i,r){t.setAttribute(i,r)}function Gi(t,i){t.removeAttribute(i)}function cu(){ie().body.focus(),ie().onselectstart=function(){return!1}}function du(){ie().onselectstart=function(){return!0}}function Nr(t){if(t&&t.getBoundingClientRect&&t.parentNode){var i=t.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(e){i[e]!==void 0&&(r[e]=i[e])}),r.height||(r.height=parseFloat(oi(t,"height"))),r.width||(r.width=parseFloat(oi(t,"width"))),r}}function di(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};for(var i=t.offsetWidth,r=t.offsetHeight,e=0,n=0;t.offsetParent&&t!==ie()[Fi.fullscreenElement];)e+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent;return{left:e,top:n,width:i,height:r}}function zi(t,i){var r={x:0,y:0};if($t)for(var e=t;e&&e.nodeName.toLowerCase()!=="html";){var n=oi(e,"transform");if(/^matrix/.test(n)){var a=n.slice(7,-1).split(/,\s/).map(Number);r.x+=a[4],r.y+=a[5]}else if(/^matrix3d/.test(n)){var s=n.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}e=e.parentNode}var o={},l=di(i.target),h=di(t),g=h.width,b=h.height,_=i.offsetY-(h.top-l.top),G=i.offsetX-(h.left-l.left);return i.changedTouches&&(G=i.changedTouches[0].pageX-h.left,_=i.changedTouches[0].pageY+h.top,$t&&(G-=r.x,_-=r.y)),o.y=1-Math.max(0,Math.min(1,_/b)),o.x=Math.max(0,Math.min(1,G/g)),o}function hu(t){return Wn(t)&&t.nodeType===3}function us(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function pu(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(function(i){return typeof i=="function"&&(i=i()),Mr(i)||hu(i)?i:typeof i=="string"&&/\S/.test(i)?ie().createTextNode(i):void 0}).filter(function(i){return i})}function ls(t,i){return pu(i).forEach(function(r){return t.appendChild(r)}),t}function fu(t,i){return ls(us(t),i)}function hi(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||!(t.button!==0||t.buttons!==1)}var cs,or=su("querySelector"),mu=su("querySelectorAll"),gu=Object.freeze({__proto__:null,isReal:Lr,isEl:Mr,isInFrame:au,createEl:st,textContent:pr,prependTo:os,hasClass:fr,addClass:Xn,removeClass:ci,toggleClass:ou,setAttributes:uu,getAttributes:Kn,getAttribute:lu,setAttribute:Rr,removeAttribute:Gi,blockTextSelection:cu,unblockTextSelection:du,getBoundingClientRect:Nr,findPosition:di,getPointerPosition:zi,isTextNode:hu,emptyEl:us,normalizeContent:pu,appendContent:ls,insertContent:fu,isSingleLeftClick:hi,$:or,$$:mu}),vu=!1,Ch=function(){if(cs.options.autoSetup!==!1){var t=Array.prototype.slice.call(ie().getElementsByTagName("video")),i=Array.prototype.slice.call(ie().getElementsByTagName("audio")),r=Array.prototype.slice.call(ie().getElementsByTagName("video-js")),e=t.concat(i,r);if(e&&e.length>0)for(var n=0,a=e.length;n<a;n++){var s=e[n];if(!s||!s.getAttribute){ds(1);break}s.player===void 0&&s.getAttribute("data-setup")!==null&&cs(s)}else vu||ds(1)}};function ds(t,i){!Lr()||(i&&(cs=i),O().setTimeout(Ch,t))}function hs(){vu=!0,O().removeEventListener("load",hs)}Lr()&&(ie().readyState==="complete"?hs():O().addEventListener("load",hs));var yu,_u=function(t){var i=ie().createElement("style");return i.className=t,i},bu=function(t,i){t.styleSheet?t.styleSheet.cssText=i:t.textContent=i},xh=3;function Qn(){return xh++}O().WeakMap||(yu=function(){function t(){this.vdata="vdata"+Math.floor(O().performance&&O().performance.now()||Date.now()),this.data={}}var i=t.prototype;return i.set=function(r,e){var n=r[this.vdata]||Qn();return r[this.vdata]||(r[this.vdata]=n),this.data[n]=e,this},i.get=function(r){var e=r[this.vdata];if(e)return this.data[e];Je("We have no data for this element",r)},i.has=function(r){return r[this.vdata]in this.data},i.delete=function(r){var e=r[this.vdata];e&&(delete this.data[e],delete r[this.vdata])},t}());var Jt=O().WeakMap?new WeakMap:new yu;function Tu(t,i){if(Jt.has(t)){var r=Jt.get(t);r.handlers[i].length===0&&(delete r.handlers[i],t.removeEventListener?t.removeEventListener(i,r.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+i,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),Object.getOwnPropertyNames(r).length===0&&Jt.delete(t)}}function ps(t,i,r,e){r.forEach(function(n){t(i,n,e)})}function Xi(t){if(t.fixed_)return t;function i(){return!0}function r(){return!1}if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){var e=t||O().event;for(var n in t={},e)n!=="layerX"&&n!=="layerY"&&n!=="keyLocation"&&n!=="webkitMovementX"&&n!=="webkitMovementY"&&n!=="path"&&(n==="returnValue"&&e.preventDefault||(t[n]=e[n]));if(t.target||(t.target=t.srcElement||ie()),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){e.preventDefault&&e.preventDefault(),t.returnValue=!1,e.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){e.stopPropagation&&e.stopPropagation(),t.cancelBubble=!0,e.cancelBubble=!0,t.isPropagationStopped=i},t.isPropagationStopped=r,t.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation(),t.isImmediatePropagationStopped=i,t.stopPropagation()},t.isImmediatePropagationStopped=r,t.clientX!==null&&t.clientX!==void 0){var a=ie().documentElement,s=ie().body;t.pageX=t.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),t.pageY=t.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}t.which=t.charCode||t.keyCode,t.button!==null&&t.button!==void 0&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t.fixed_=!0,t}var Ki,Ih=function(){if(typeof Ki!="boolean"){Ki=!1;try{var t=Object.defineProperty({},"passive",{get:function(){Ki=!0}});O().addEventListener("test",null,t),O().removeEventListener("test",null,t)}catch{}}return Ki},Ah=["touchstart","touchmove"];function hn(t,i,r){if(Array.isArray(i))return ps(hn,t,i,r);Jt.has(t)||Jt.set(t,{});var e=Jt.get(t);if(e.handlers||(e.handlers={}),e.handlers[i]||(e.handlers[i]=[]),r.guid||(r.guid=Qn()),e.handlers[i].push(r),e.dispatcher||(e.disabled=!1,e.dispatcher=function(a,s){if(!e.disabled){a=Xi(a);var o=e.handlers[a.type];if(o)for(var l=o.slice(0),h=0,g=l.length;h<g&&!a.isImmediatePropagationStopped();h++)try{l[h].call(t,a,s)}catch(b){Je.error(b)}}}),e.handlers[i].length===1)if(t.addEventListener){var n=!1;Ih()&&Ah.indexOf(i)>-1&&(n={passive:!0}),t.addEventListener(i,e.dispatcher,n)}else t.attachEvent&&t.attachEvent("on"+i,e.dispatcher)}function Xt(t,i,r){if(Jt.has(t)){var e=Jt.get(t);if(e.handlers){if(Array.isArray(i))return ps(Xt,t,i,r);var n=function(l,h){e.handlers[h]=[],Tu(l,h)};if(i===void 0){for(var a in e.handlers)Object.prototype.hasOwnProperty.call(e.handlers||{},a)&&n(t,a);return}var s=e.handlers[i];if(s){if(!r)return void n(t,i);if(r.guid)for(var o=0;o<s.length;o++)s[o].guid===r.guid&&s.splice(o--,1);Tu(t,i)}}}}function Ur(t,i,r){var e=Jt.has(t)?Jt.get(t):{},n=t.parentNode||t.ownerDocument;if(typeof i=="string"?i={type:i,target:t}:i.target||(i.target=t),i=Xi(i),e.dispatcher&&e.dispatcher.call(t,i,r),n&&!i.isPropagationStopped()&&i.bubbles===!0)Ur.call(null,n,i,r);else if(!n&&!i.defaultPrevented&&i.target&&i.target[i.type]){Jt.has(i.target)||Jt.set(i.target,{});var a=Jt.get(i.target);i.target[i.type]&&(a.disabled=!0,typeof i.target[i.type]=="function"&&i.target[i.type](),a.disabled=!1)}return!i.defaultPrevented}function Qi(t,i,r){if(Array.isArray(i))return ps(Qi,t,i,r);var e=function n(){Xt(t,i,n),r.apply(this,arguments)};e.guid=r.guid=r.guid||Qn(),hn(t,i,e)}function Su(t,i,r){var e=function n(){Xt(t,i,n),r.apply(this,arguments)};e.guid=r.guid=r.guid||Qn(),hn(t,i,e)}var pi,Ph=Object.freeze({__proto__:null,fixEvent:Xi,on:hn,off:Xt,trigger:Ur,one:Qi,any:Su}),Sn=30,gt=function(t,i,r){i.guid||(i.guid=Qn());var e=i.bind(t);return e.guid=r?r+"_"+i.guid:i.guid,e},Yn=function(t,i){var r=O().performance.now(),e=function(){var n=O().performance.now();n-r>=i&&(t.apply(void 0,arguments),r=n)};return e},Oh=function(t,i,r,e){e===void 0&&(e=O());var n,a=function(){e.clearTimeout(n),n=null},s=function(){var o=this,l=arguments,h=function(){n=null,h=null,t.apply(o,l)};!n&&r&&t.apply(o,l),e.clearTimeout(n),n=e.setTimeout(h,i)};return s.cancel=a,s},Ft=function(){};Ft.prototype.allowedEvents_={},Ft.prototype.on=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},hn(this,t,i),this.addEventListener=r},Ft.prototype.addEventListener=Ft.prototype.on,Ft.prototype.off=function(t,i){Xt(this,t,i)},Ft.prototype.removeEventListener=Ft.prototype.off,Ft.prototype.one=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},Qi(this,t,i),this.addEventListener=r},Ft.prototype.any=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},Su(this,t,i),this.addEventListener=r},Ft.prototype.trigger=function(t){var i=t.type||t;typeof t=="string"&&(t={type:i}),t=Xi(t),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](t),Ur(this,t)},Ft.prototype.dispatchEvent=Ft.prototype.trigger,Ft.prototype.queueTrigger=function(t){var i=this;pi||(pi=new Map);var r=t.type||t,e=pi.get(this);e||(e=new Map,pi.set(this,e));var n=e.get(r);e.delete(r),O().clearTimeout(n);var a=O().setTimeout(function(){e.delete(r),e.size===0&&(e=null,pi.delete(i)),i.trigger(t)},0);e.set(r,a)};var Yi=function(t){return typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},$n=function(t){return t instanceof Ft||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof t[i]=="function"})},Dh=function(t,i){$n(t)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))},fs=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},$i=function(t,i,r){if(!t||!t.nodeName&&!$n(t))throw new Error("Invalid target for "+Yi(i)+"#"+r+"; must be a DOM node or evented object.")},Eu=function(t,i,r){if(!fs(t))throw new Error("Invalid event type for "+Yi(i)+"#"+r+"; must be a non-empty string or array.")},wu=function(t,i,r){if(typeof t!="function")throw new Error("Invalid listener for "+Yi(i)+"#"+r+"; must be a function.")},ms=function(t,i,r){var e,n,a,s=i.length<3||i[0]===t||i[0]===t.eventBusEl_;return s?(e=t.eventBusEl_,i.length>=3&&i.shift(),n=i[0],a=i[1]):(e=i[0],n=i[1],a=i[2]),$i(e,t,r),Eu(n,t,r),wu(a,t,r),{isTargetingSelf:s,target:e,type:n,listener:a=gt(t,a)}},mr=function(t,i,r,e){$i(t,t,i),t.nodeName?Ph[i](t,r,e):t[i](r,e)},Lh={on:function(){for(var t=this,i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];var n=ms(this,r,"on"),a=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;if(mr(s,"on",o,l),!a){var h=function(){return t.off(s,o,l)};h.guid=l.guid;var g=function(){return t.off("dispose",h)};g.guid=l.guid,mr(this,"on","dispose",h),mr(s,"on","dispose",g)}},one:function(){for(var t=this,i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];var n=ms(this,r,"one"),a=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;if(a)mr(s,"one",o,l);else{var h=function g(){t.off(s,o,g);for(var b=arguments.length,_=new Array(b),G=0;G<b;G++)_[G]=arguments[G];l.apply(null,_)};h.guid=l.guid,mr(s,"one",o,h)}},any:function(){for(var t=this,i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];var n=ms(this,r,"any"),a=n.isTargetingSelf,s=n.target,o=n.type,l=n.listener;if(a)mr(s,"any",o,l);else{var h=function g(){t.off(s,o,g);for(var b=arguments.length,_=new Array(b),G=0;G<b;G++)_[G]=arguments[G];l.apply(null,_)};h.guid=l.guid,mr(s,"any",o,h)}},off:function(t,i,r){if(!t||fs(t))Xt(this.eventBusEl_,t,i);else{var e=t,n=i;$i(e,this,"off"),Eu(n,this,"off"),wu(r,this,"off"),r=gt(this,r),this.off("dispose",r),e.nodeName?(Xt(e,n,r),Xt(e,"dispose",r)):$n(e)&&(e.off(n,r),e.off("dispose",r))}},trigger:function(t,i){$i(this.eventBusEl_,this,"trigger");var r=t&&typeof t!="string"?t.type:t;if(!fs(r)){var e="Invalid event type for "+Yi(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!t)throw new Error(e);(this.log||Je).error(e)}return Ur(this.eventBusEl_,t,i)}};function gs(t,i){i===void 0&&(i={});var r=i.eventBusKey;if(r){if(!t[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');t.eventBusEl_=t[r]}else t.eventBusEl_=st("span",{className:"vjs-event-bus"});return Ct(t,Lh),t.eventedCallbacks&&t.eventedCallbacks.forEach(function(e){e()}),t.on("dispose",function(){t.off(),[t,t.el_,t.eventBusEl_].forEach(function(e){e&&Jt.has(e)&&Jt.delete(e)}),O().setTimeout(function(){t.eventBusEl_=null},0)}),t}var Mh={state:{},setState:function(t){var i,r=this;return typeof t=="function"&&(t=t()),Or(t,function(e,n){r.state[n]!==e&&((i=i||{})[n]={from:r.state[n],to:e}),r.state[n]=e}),i&&$n(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function ku(t,i){return Ct(t,Mh),t.state=Ct({},t.state,i),typeof t.handleStateChanged=="function"&&$n(t)&&t.on("statechanged",t.handleStateChanged),t}var Ji=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toLowerCase()})},xt=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toUpperCase()})},Rh=function(t,i){return xt(t)===xt(i)};function vt(){for(var t={},i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return r.forEach(function(n){!n||Or(n,function(a,s){si(a)?(si(t[s])||(t[s]={}),t[s]=vt(t[s],a)):t[s]=a})}),t}var Nh=function(){function t(){this.map_={}}var i=t.prototype;return i.has=function(r){return r in this.map_},i.delete=function(r){var e=this.has(r);return delete this.map_[r],e},i.set=function(r,e){return this.map_[r]=e,this},i.forEach=function(r,e){for(var n in this.map_)r.call(e,this.map_[n],n,this)},t}(),Uh=O().Map?O().Map:Nh,Bh=function(){function t(){this.set_={}}var i=t.prototype;return i.has=function(r){return r in this.set_},i.delete=function(r){var e=this.has(r);return delete this.set_[r],e},i.add=function(r){return this.set_[r]=1,this},i.forEach=function(r,e){for(var n in this.set_)r.call(e,n,n,this)},t}(),vs=O().Set?O().Set:Bh,Le=function(){function t(r,e,n){var a=this;if(!r&&this.play?this.player_=r=this:this.player_=r,this.isDisposed_=!1,this.parentComponent_=null,this.options_=vt({},this.options_),e=this.options_=vt(this.options_,e),this.id_=e.id||e.el&&e.el.id,!this.id_){var s=r&&r.id&&r.id()||"no_player";this.id_=s+"_component_"+Qn()}this.name_=e.name||null,e.el?this.el_=e.el:e.createEl!==!1&&(this.el_=this.createEl()),e.className&&this.el_&&e.className.split(" ").forEach(function(o){return a.addClass(o)}),e.evented!==!1&&(gs(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ku(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new vs,this.setIntervalIds_=new vs,this.rafIds_=new vs,this.namedRafs_=new Uh,this.clearingTimersOnDispose_=!1,e.initChildren!==!1&&this.initChildren(),this.ready(n),e.reportTouchActivity!==!1&&this.enableTouchActivity()}var i=t.prototype;return i.dispose=function(r){if(r===void 0&&(r={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},i.isDisposed=function(){return!!this.isDisposed_},i.player=function(){return this.player_},i.options=function(r){return r?(this.options_=vt(this.options_,r),this.options_):this.options_},i.el=function(){return this.el_},i.createEl=function(r,e,n){return st(r,e,n)},i.localize=function(r,e,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[a],l=a&&a.split("-")[0],h=s&&s[l],g=n;return o&&o[r]?g=o[r]:h&&h[r]&&(g=h[r]),e&&(g=g.replace(/\{(\d+)\}/g,function(b,_){var G=e[_-1],ne=G;return G===void 0&&(ne=b),ne})),g},i.handleLanguagechange=function(){},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(r){return this.childIndex_[r]},i.getChild=function(r){if(r)return this.childNameIndex_[r]},i.getDescendant=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];e=e.reduce(function(o,l){return o.concat(l)},[]);for(var a=this,s=0;s<e.length;s++)if(!(a=a.getChild(e[s]))||!a.getChild)return;return a},i.addChild=function(r,e,n){var a,s;if(e===void 0&&(e={}),n===void 0&&(n=this.children_.length),typeof r=="string"){s=xt(r);var o=e.componentClass||s;e.name=s;var l=t.getComponent(o);if(!l)throw new Error("Component "+o+" does not exist");if(typeof l!="function")return null;a=new l(this.player_||this,e)}else a=r;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),(s=s||a.name&&xt(a.name()))&&(this.childNameIndex_[s]=a,this.childNameIndex_[Ji(s)]=a),typeof a.el=="function"&&a.el()){var h=null;this.children_[n+1]&&(this.children_[n+1].el_?h=this.children_[n+1].el_:Mr(this.children_[n+1])&&(h=this.children_[n+1])),this.contentEl().insertBefore(a.el(),h)}return a},i.removeChild=function(r){if(typeof r=="string"&&(r=this.getChild(r)),r&&this.children_){for(var e=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===r){e=!0,this.children_.splice(n,1);break}if(e){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[xt(r.name())]=null,this.childNameIndex_[Ji(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},i.initChildren=function(){var r=this,e=this.options_.children;if(e){var n,a=this.options_,s=function(l){var h=l.name,g=l.opts;if(a[h]!==void 0&&(g=a[h]),g!==!1){g===!0&&(g={}),g.playerOptions=r.options_.playerOptions;var b=r.addChild(h,g);b&&(r[h]=b)}},o=t.getComponent("Tech");(n=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(l){return!n.some(function(h){return typeof h=="string"?l===h:l===h.name})})).map(function(l){var h,g;return typeof l=="string"?g=e[h=l]||r.options_[h]||{}:(h=l.name,g=l),{name:h,opts:g}}).filter(function(l){var h=t.getComponent(l.opts.componentClass||xt(l.name));return h&&!o.isTech(h)}).forEach(s)}},i.buildCSSClass=function(){return""},i.ready=function(r,e){if(e===void 0&&(e=!1),r){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r);e?r.call(this):this.setTimeout(r,1)}},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},i.$=function(r,e){return or(r,e||this.contentEl())},i.$$=function(r,e){return mu(r,e||this.contentEl())},i.hasClass=function(r){return fr(this.el_,r)},i.addClass=function(r){Xn(this.el_,r)},i.removeClass=function(r){ci(this.el_,r)},i.toggleClass=function(r,e){ou(this.el_,r,e)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(r){return lu(this.el_,r)},i.setAttribute=function(r,e){Rr(this.el_,r,e)},i.removeAttribute=function(r){Gi(this.el_,r)},i.width=function(r,e){return this.dimension("width",r,e)},i.height=function(r,e){return this.dimension("height",r,e)},i.dimensions=function(r,e){this.width(r,!0),this.height(e)},i.dimension=function(r,e,n){if(e!==void 0)return(e===null||e!=e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[r]=e:this.el_.style[r]=e==="auto"?"":e+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],s=a.indexOf("px");return parseInt(s!==-1?a.slice(0,s):this.el_["offset"+xt(r)],10)},i.currentDimension=function(r){var e=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(e=oi(this.el_,r),(e=parseFloat(e))===0||isNaN(e)){var n="offset"+xt(r);e=this.el_[n]}return e},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(r){this.player_&&(U().isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},i.handleKeyPress=function(r){this.handleKeyDown(r)},i.emitTapEvents=function(){var r,e=0,n=null,a=10,s=200;this.on("touchstart",function(l){l.touches.length===1&&(n={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=O().performance.now(),r=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)r=!1;else if(n){var h=l.touches[0].pageX-n.pageX,g=l.touches[0].pageY-n.pageY;Math.sqrt(h*h+g*g)>a&&(r=!1)}});var o=function(){r=!1};this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(l){n=null,r===!0&&O().performance.now()-e<s&&(l.preventDefault(),this.trigger("tap"))})},i.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var r,e=gt(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){e(),this.clearInterval(r),r=this.setInterval(e,250)});var n=function(a){e(),this.clearInterval(r)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}},i.setTimeout=function(r,e){var n,a=this;return r=gt(this,r),this.clearTimersOnDispose_(),n=O().setTimeout(function(){a.setTimeoutIds_.has(n)&&a.setTimeoutIds_.delete(n),r()},e),this.setTimeoutIds_.add(n),n},i.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),O().clearTimeout(r)),r},i.setInterval=function(r,e){r=gt(this,r),this.clearTimersOnDispose_();var n=O().setInterval(r,e);return this.setIntervalIds_.add(n),n},i.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),O().clearInterval(r)),r},i.requestAnimationFrame=function(r){var e,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),r=gt(this,r),e=O().requestAnimationFrame(function(){n.rafIds_.has(e)&&n.rafIds_.delete(e),r()}),this.rafIds_.add(e),e):this.setTimeout(r,1e3/60)},i.requestNamedAnimationFrame=function(r,e){var n=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),e=gt(this,e);var a=this.requestAnimationFrame(function(){e(),n.namedRafs_.has(r)&&n.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},i.cancelNamedAnimationFrame=function(r){!this.namedRafs_.has(r)||(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},i.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),O().cancelAnimationFrame(r)),r):this.clearTimeout(r)},i.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var n=e[0],a=e[1];r[n].forEach(function(s,o){return r[a](o)})}),r.clearingTimersOnDispose_=!1}))},t.registerComponent=function(r,e){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var n,a=t.getComponent("Tech"),s=a&&a.isTech(e),o=t===e||t.prototype.isPrototypeOf(e.prototype);if(s||!o)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+r+'"; '+n+".");r=xt(r),t.components_||(t.components_={});var l=t.getComponent("Player");if(r==="Player"&&l&&l.players){var h=l.players,g=Object.keys(h);if(h&&g.length>0&&g.map(function(b){return h[b]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[r]=e,t.components_[Ji(r)]=e,e},t.getComponent=function(r){if(r&&t.components_)return t.components_[r]},t}();function jh(t,i,r){if(typeof i!="number"||i<0||i>r)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+i+") is non-numeric or out of bounds (0-"+r+").")}function Cu(t,i,r,e){return jh(t,e,r.length-1),r[e][i]}function ys(t){var i;return i=t===void 0||t.length===0?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:Cu.bind(null,"start",0,t),end:Cu.bind(null,"end",1,t)},O().Symbol&&O().Symbol.iterator&&(i[O().Symbol.iterator]=function(){return(t||[]).values()}),i}function gr(t,i){return Array.isArray(t)?ys(t):t===void 0||i===void 0?ys():ys([[t,i]])}function xu(t,i){var r,e,n=0;if(!i)return 0;(!t||!t.length)&&(t=gr(0,0));for(var a=0;a<t.length;a++)r=t.start(a),(e=t.end(a))>i&&(e=i),n+=e-r;return n/i}function Zt(t){if(t instanceof Zt)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:Wn(t)&&(typeof t.code=="number"&&(this.code=t.code),Ct(this,t)),this.message||(this.message=Zt.defaultMessages[this.code]||"")}Le.prototype.supportsRaf_=typeof O().requestAnimationFrame=="function"&&typeof O().cancelAnimationFrame=="function",Le.registerComponent("Component",Le),Zt.prototype.code=0,Zt.prototype.message="",Zt.prototype.status=null,Zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Br=0;Br<Zt.errorTypes.length;Br++)Zt[Zt.errorTypes[Br]]=Br,Zt.prototype[Zt.errorTypes[Br]]=Br;function fi(t){return t!=null&&typeof t.then=="function"}function Dn(t){fi(t)&&t.then(null,function(i){})}var _s=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(i,r,e){return t[r]&&(i[r]=t[r]),i},{cues:t.cues&&Array.prototype.map.call(t.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})})},Fh=function(t){var i=t.$$("track"),r=Array.prototype.map.call(i,function(e){return e.track});return Array.prototype.map.call(i,function(e){var n=_s(e.track);return e.src&&(n.src=e.src),n}).concat(Array.prototype.filter.call(t.textTracks(),function(e){return r.indexOf(e)===-1}).map(_s))},qh=function(t,i){return t.forEach(function(r){var e=i.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(n){return e.addCue(n)})}),i.textTracks()},Iu={textTracksToJson:Fh,jsonToTextTracks:qh,trackToJson_:_s},bs="vjs-modal-dialog",jr=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).handleKeyDown_=function(s){return a.handleKeyDown(s)},a.close_=function(s){return a.close(s)},a.opened_=a.hasBeenOpened_=a.hasBeenFilled_=!1,a.closeable(!a.options_.uncloseable),a.content(a.options_.content),a.contentEl_=st("div",{className:bs+"-content"},{role:"document"}),a.descEl_=st("p",{className:bs+"-description vjs-control-text",id:a.el().getAttribute("aria-describedby")}),pr(a.descEl_,a.description()),a.el_.appendChild(a.descEl_),a.el_.appendChild(a.contentEl_),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},r.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,t.prototype.dispose.call(this)},r.buildCSSClass=function(){return bs+" vjs-hidden "+t.prototype.buildCSSClass.call(this)},r.label=function(){return this.localize(this.options_.label||"Modal Window")},r.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},r.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},r.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},r.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},r.closeable=function(e){if(typeof e=="boolean"){var n=this.closeable_=!!e,a=this.getChild("closeButton");if(n&&!a){var s=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},r.fill=function(){this.fillWith(this.content())},r.fillWith=function(e){var n=this.contentEl(),a=n.parentNode,s=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),fu(n,e),this.trigger("modalfill"),s?a.insertBefore(n,s):a.appendChild(n);var o=this.getChild("closeButton");o&&a.appendChild(o.el_)},r.empty=function(){this.trigger("beforemodalempty"),us(this.contentEl()),this.trigger("modalempty")},r.content=function(e){return e!==void 0&&(this.content_=e),this.content_},r.conditionalFocus_=function(){var e=ie().activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(e)||n===e)&&(this.previouslyActiveEl_=e,this.focus())},r.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},r.handleKeyDown=function(e){if(e.stopPropagation(),U().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(U().isEventKey(e,"Tab")){for(var n,a=this.focusableEls_(),s=this.el_.querySelector(":focus"),o=0;o<a.length;o++)if(s===a[o]){n=o;break}ie().activeElement===this.el_&&(n=0),e.shiftKey&&n===0?(a[a.length-1].focus(),e.preventDefault()):!e.shiftKey&&n===a.length-1&&(a[0].focus(),e.preventDefault())}},r.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(n){return(n instanceof O().HTMLAnchorElement||n instanceof O().HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof O().HTMLInputElement||n instanceof O().HTMLSelectElement||n instanceof O().HTMLTextAreaElement||n instanceof O().HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof O().HTMLIFrameElement||n instanceof O().HTMLObjectElement||n instanceof O().HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},i}(Le);jr.prototype.options_={pauseOnOpen:!0,temporary:!0},Le.registerComponent("ModalDialog",jr);var Fr=function(t){function i(e){var n;e===void 0&&(e=[]),(n=t.call(this)||this).tracks_=[],Object.defineProperty(w(n),"length",{get:function(){return this.tracks_.length}});for(var a=0;a<e.length;a++)n.addTrack(e[a]);return n}y(i,t);var r=i.prototype;return r.addTrack=function(e){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){n.trigger({track:e,type:"labelchange",target:n})},$n(e)&&e.addEventListener("labelchange",e.labelchange_)},r.removeTrack=function(e){for(var n,a=0,s=this.length;a<s;a++)if(this[a]===e){(n=this[a]).off&&n.off(),this.tracks_.splice(a,1);break}!n||this.trigger({track:n,type:"removetrack",target:this})},r.getTrackById=function(e){for(var n=null,a=0,s=this.length;a<s;a++){var o=this[a];if(o.id===e){n=o;break}}return n},i}(Ft);for(var Hh in Fr.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},Fr.prototype.allowedEvents_)Fr.prototype["on"+Hh]=null;var Ts=function(t,i){for(var r=0;r<t.length;r++)!Object.keys(t[r]).length||i.id===t[r].id||(t[r].enabled=!1)},Vh=function(t){function i(e){var n;e===void 0&&(e=[]);for(var a=e.length-1;a>=0;a--)if(e[a].enabled){Ts(e,e[a]);break}return(n=t.call(this,e)||this).changing_=!1,n}y(i,t);var r=i.prototype;return r.addTrack=function(e){var n=this;e.enabled&&Ts(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){n.changing_||(n.changing_=!0,Ts(n,e),n.changing_=!1,n.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},i}(Fr),Ss=function(t,i){for(var r=0;r<t.length;r++)!Object.keys(t[r]).length||i.id===t[r].id||(t[r].selected=!1)},Wh=function(t){function i(e){var n;e===void 0&&(e=[]);for(var a=e.length-1;a>=0;a--)if(e[a].selected){Ss(e,e[a]);break}return(n=t.call(this,e)||this).changing_=!1,Object.defineProperty(w(n),"selectedIndex",{get:function(){for(var s=0;s<this.length;s++)if(this[s].selected)return s;return-1},set:function(){}}),n}y(i,t);var r=i.prototype;return r.addTrack=function(e){var n=this;e.selected&&Ss(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){n.changing_||(n.changing_=!0,Ss(n,e),n.changing_=!1,n.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},i}(Fr),Au=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.addTrack=function(e){var n=this;t.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},i}(Fr),Gh=function(){function t(r){r===void 0&&(r=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var e=0,n=r.length;e<n;e++)this.addTrackElement_(r[e])}var i=t.prototype;return i.addTrackElement_=function(r){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),this.trackElements_.indexOf(r)===-1&&this.trackElements_.push(r)},i.getTrackElementByTrack_=function(r){for(var e,n=0,a=this.trackElements_.length;n<a;n++)if(r===this.trackElements_[n].track){e=this.trackElements_[n];break}return e},i.removeTrackElement_=function(r){for(var e=0,n=this.trackElements_.length;e<n;e++)if(r===this.trackElements_[e]){this.trackElements_[e].track&&typeof this.trackElements_[e].track.off=="function"&&this.trackElements_[e].track.off(),typeof this.trackElements_[e].off=="function"&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},t}(),Pu=function(){function t(r){t.prototype.setCues_.call(this,r),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var i=t.prototype;return i.setCues_=function(r){var e=this.length||0,n=0,a=r.length;this.cues_=r,this.length_=r.length;var s=function(o){""+o in this||Object.defineProperty(this,""+o,{get:function(){return this.cues_[o]}})};if(e<a)for(n=e;n<a;n++)s.call(this,n)},i.getCueById=function(r){for(var e=null,n=0,a=this.length;n<a;n++){var s=this[n];if(s.id===r){e=s;break}}return e},t}(),zh={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Xh={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Kh={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ou={disabled:"disabled",hidden:"hidden",showing:"showing"},Es=function(t){function i(r){var e;r===void 0&&(r={}),e=t.call(this)||this;var n={id:r.id||"vjs_track_"+Qn(),kind:r.kind||"",language:r.language||""},a=r.label||"",s=function(l){Object.defineProperty(w(e),l,{get:function(){return n[l]},set:function(){}})};for(var o in n)s(o);return Object.defineProperty(w(e),"label",{get:function(){return a},set:function(l){l!==a&&(a=l,this.trigger("labelchange"))}}),e}return y(i,t),i}(Ft),ws=function(t){var i=["protocol","hostname","port","pathname","search","hash","host"],r=ie().createElement("a");r.href=t;for(var e={},n=0;n<i.length;n++)e[i[n]]=r[i[n]];return e.protocol==="http:"&&(e.host=e.host.replace(/:80$/,"")),e.protocol==="https:"&&(e.host=e.host.replace(/:443$/,"")),e.protocol||(e.protocol=O().location.protocol),e.host||(e.host=O().location.host),e},Du=function(t){if(!t.match(/^https?:\/\//)){var i=ie().createElement("a");i.href=t,t=i.href}return t},ks=function(t){if(typeof t=="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(t);if(i)return i.pop().toLowerCase()}return""},Zi=function(t,i){i===void 0&&(i=O().location);var r=ws(t);return(r.protocol===":"?i.protocol:r.protocol)+r.host!==i.protocol+i.host},Qh=Object.freeze({__proto__:null,parseUrl:ws,getAbsoluteURL:Du,getFileExtension:ks,isCrossOrigin:Zi}),Lu=function(t,i){var r=new(O()).WebVTT.Parser(O(),O().vttjs,O().WebVTT.StringDecoder()),e=[];r.oncue=function(n){i.addCue(n)},r.onparsingerror=function(n){e.push(n)},r.onflush=function(){i.trigger({type:"loadeddata",target:i})},r.parse(t),e.length>0&&(O().console&&O().console.groupCollapsed&&O().console.groupCollapsed("Text Track parsing errors for "+i.src),e.forEach(function(n){return Je.error(n)}),O().console&&O().console.groupEnd&&O().console.groupEnd()),r.flush()},Mu=function(t,i){var r={uri:t},e=Zi(t);e&&(r.cors=e);var n=i.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),M()(r,gt(this,function(a,s,o){if(a)return Je.error(a,s);i.loaded_=!0,typeof O().WebVTT!="function"?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type!=="vttjserror")return Lu(o,i);Je.error("vttjs failed to load, stopping trying to process "+i.src)}):Lu(o,i)}))},mi=function(t){function i(e){var n;if(e===void 0&&(e={}),!e.tech)throw new Error("A tech was not provided.");var a=vt(e,{kind:Kh[e.kind]||"subtitles",language:e.language||e.srclang||""}),s=Ou[a.mode]||"disabled",o=a.default;(a.kind==="metadata"||a.kind==="chapters")&&(s="hidden"),(n=t.call(this,a)||this).tech_=a.tech,n.cues_=[],n.activeCues_=[],n.preload_=n.tech_.preloadTextTracks!==!1;var l=new Pu(n.cues_),h=new Pu(n.activeCues_),g=!1;n.timeupdateHandler=gt(w(n),function(_){if(_===void 0&&(_={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_)return void(_.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)));this.activeCues=this.activeCues,g&&(this.trigger("cuechange"),g=!1),_.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var b=function(){n.stopTracking()};return n.tech_.one("dispose",b),s!=="disabled"&&n.startTracking(),Object.defineProperties(w(n),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(_){!Ou[_]||s!==_&&(s=_,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Mu(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return h;for(var _=this.tech_.currentTime(),G=[],ne=0,ye=this.cues.length;ne<ye;ne++){var re=this.cues[ne];(re.startTime<=_&&re.endTime>=_||re.startTime===re.endTime&&re.startTime<=_&&re.startTime+.5>=_)&&G.push(re)}if(g=!1,G.length!==this.activeCues_.length)g=!0;else for(var Ue=0;Ue<G.length;Ue++)this.activeCues_.indexOf(G[Ue])===-1&&(g=!0);return this.activeCues_=G,h.setCues_(this.activeCues_),h},set:function(){}}}),a.src?(n.src=a.src,n.preload_||(n.loaded_=!0),(n.preload_||a.kind!=="subtitles"&&a.kind!=="captions")&&Mu(n.src,w(n))):n.loaded_=!0,n}y(i,t);var r=i.prototype;return r.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},r.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},r.addCue=function(e){var n=e;if(O().vttjs&&!(e instanceof O().vttjs.VTTCue)){for(var a in n=new(O()).vttjs.VTTCue(e.startTime,e.endTime,e.text),e)a in n||(n[a]=e[a]);n.id=e.id,n.originalCue_=e}for(var s=this.tech_.textTracks(),o=0;o<s.length;o++)s[o]!==this&&s[o].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},r.removeCue=function(e){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===e||a.originalCue_&&a.originalCue_===e){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},i}(Es);mi.prototype.allowedEvents_={cuechange:"cuechange"};var Ru=function(t){function i(r){var e;r===void 0&&(r={});var n=vt(r,{kind:Xh[r.kind]||""});e=t.call(this,n)||this;var a=!1;return Object.defineProperty(w(e),"enabled",{get:function(){return a},set:function(s){typeof s!="boolean"||s===a||(a=s,this.trigger("enabledchange"))}}),n.enabled&&(e.enabled=n.enabled),e.loaded_=!0,e}return y(i,t),i}(Es),Nu=function(t){function i(r){var e;r===void 0&&(r={});var n=vt(r,{kind:zh[r.kind]||""});e=t.call(this,n)||this;var a=!1;return Object.defineProperty(w(e),"selected",{get:function(){return a},set:function(s){typeof s!="boolean"||s===a||(a=s,this.trigger("selectedchange"))}}),n.selected&&(e.selected=n.selected),e}return y(i,t),i}(Es),Uu=0,Yh=1,Bu=2,$h=3,qr=function(t){function i(r){var e;r===void 0&&(r={}),e=t.call(this)||this;var n,a=new mi(r);return e.kind=a.kind,e.src=a.src,e.srclang=a.language,e.label=a.label,e.default=a.default,Object.defineProperties(w(e),{readyState:{get:function(){return n}},track:{get:function(){return a}}}),n=Uu,a.addEventListener("loadeddata",function(){n=Bu,e.trigger({type:"load",target:w(e)})}),e}return y(i,t),i}(Ft);qr.prototype.allowedEvents_={load:"load"},qr.NONE=Uu,qr.LOADING=Yh,qr.LOADED=Bu,qr.ERROR=$h;var yn={audio:{ListClass:Vh,TrackClass:Ru,capitalName:"Audio"},video:{ListClass:Wh,TrackClass:Nu,capitalName:"Video"},text:{ListClass:Au,TrackClass:mi,capitalName:"Text"}};Object.keys(yn).forEach(function(t){yn[t].getterName=t+"Tracks",yn[t].privateName=t+"Tracks_"});var Hr={remoteText:{ListClass:Au,TrackClass:mi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Gh,TrackClass:qr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},en=we({},yn,Hr);function Jh(t,i,r,e,n){n===void 0&&(n={});var a=t.textTracks();n.kind=i,r&&(n.label=r),e&&(n.language=e),n.tech=t;var s=new en.text.TrackClass(n);return a.addTrack(s),s}Hr.names=Object.keys(Hr),yn.names=Object.keys(yn),en.names=[].concat(Hr.names).concat(yn.names);var ft=function(t){function i(e,n){var a;return e===void 0&&(e={}),n===void 0&&(n=function(){}),e.reportTouchActivity=!1,(a=t.call(this,null,e,n)||this).onDurationChange_=function(s){return a.onDurationChange(s)},a.trackProgress_=function(s){return a.trackProgress(s)},a.trackCurrentTime_=function(s){return a.trackCurrentTime(s)},a.stopTrackingCurrentTime_=function(s){return a.stopTrackingCurrentTime(s)},a.disposeSourceHandler_=function(s){return a.disposeSourceHandler(s)},a.queuedHanders_=new Set,a.hasStarted_=!1,a.on("playing",function(){this.hasStarted_=!0}),a.on("loadstart",function(){this.hasStarted_=!1}),en.names.forEach(function(s){var o=en[s];e&&e[o.getterName]&&(a[o.privateName]=e[o.getterName])}),a.featuresProgressEvents||a.manualProgressOn(),a.featuresTimeupdateEvents||a.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){e["native"+s+"Tracks"]===!1&&(a["featuresNative"+s+"Tracks"]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?a.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(a.featuresNativeTextTracks=!0),a.featuresNativeTextTracks||a.emulateTextTracks(),a.preloadTextTracks=e.preloadTextTracks!==!1,a.autoRemoteTextTracks_=new en.text.ListClass,a.initTrackListeners(),e.nativeControlsForTouch||a.emitTapEvents(),a.constructor&&(a.name_=a.constructor.name||"Unknown Tech"),a}y(i,t);var r=i.prototype;return r.triggerSourceset=function(e){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},r.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},r.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(gt(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},r.onDurationChange=function(e){this.duration_=this.duration()},r.buffered=function(){return gr(0,0)},r.bufferedPercent=function(){return xu(this.buffered(),this.duration_)},r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},r.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.dispose=function(){this.clearTracks(yn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},r.clearTracks=function(e){var n=this;(e=[].concat(e)).forEach(function(a){for(var s=n[a+"Tracks"]()||[],o=s.length;o--;){var l=s[o];a==="text"&&n.removeRemoteTextTrack(l),s.removeTrack(l)}})},r.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],n=e.length;n--;){var a=e[n];this.removeRemoteTextTrack(a)}},r.reset=function(){},r.crossOrigin=function(){},r.setCrossOrigin=function(){},r.error=function(e){return e!==void 0&&(this.error_=new Zt(e),this.trigger("error")),this.error_},r.played=function(){return this.hasStarted_?gr(0,0):gr()},r.play=function(){},r.setScrubbing=function(){},r.scrubbing=function(){},r.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.initTrackListeners=function(){var e=this;yn.names.forEach(function(n){var a=yn[n],s=function(){e.trigger(n+"trackchange")},o=e[a.getterName]();o.addEventListener("removetrack",s),o.addEventListener("addtrack",s),e.on("dispose",function(){o.removeEventListener("removetrack",s),o.removeEventListener("addtrack",s)})})},r.addWebVttScript_=function(){var e=this;if(!O().WebVTT)if(ie().body.contains(this.el())){if(!this.options_["vtt.js"]&&si(te())&&Object.keys(te()).length>0)return void this.trigger("vttjsloaded");var n=ie().createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){e.trigger("vttjsloaded")},n.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),O().WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,n=this.textTracks(),a=this.remoteTextTracks(),s=function(g){return n.addTrack(g.track)},o=function(g){return n.removeTrack(g.track)};a.on("addtrack",s),a.on("removetrack",o),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},h=function(){l();for(var g=0;g<n.length;g++){var b=n[g];b.removeEventListener("cuechange",l),b.mode==="showing"&&b.addEventListener("cuechange",l)}};h(),n.addEventListener("change",h),n.addEventListener("addtrack",h),n.addEventListener("removetrack",h),this.on("dispose",function(){a.off("addtrack",s),a.off("removetrack",o),n.removeEventListener("change",h),n.removeEventListener("addtrack",h),n.removeEventListener("removetrack",h);for(var g=0;g<n.length;g++)n[g].removeEventListener("cuechange",l)})},r.addTextTrack=function(e,n,a){if(!e)throw new Error("TextTrack kind is required but was not provided");return Jh(this,e,n,a)},r.createRemoteTextTrack=function(e){var n=vt(e,{tech:this});return new Hr.remoteTextEl.TrackClass(n)},r.addRemoteTextTrack=function(e,n){var a=this;e===void 0&&(e={});var s=this.createRemoteTextTrack(e);return n!==!0&&n!==!1&&(Je.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(s.track)}),s},r.removeRemoteTextTrack=function(e){var n=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},r.getVideoPlaybackQuality=function(){return{}},r.requestPictureInPicture=function(){var e=this.options_.Promise||O().Promise;if(e)return e.reject()},r.disablePictureInPicture=function(){return!0},r.setDisablePictureInPicture=function(){},r.requestVideoFrameCallback=function(e){var n=this,a=Qn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),e())})):this.requestNamedAnimationFrame(a,e),a},r.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},r.setPoster=function(){},r.playsinline=function(){},r.setPlaysinline=function(){},r.overrideNativeAudioTracks=function(){},r.overrideNativeVideoTracks=function(){},r.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(e,n){return i.canPlayType(e.type)},i.isTech=function(e){return e.prototype instanceof i||e instanceof i||e===i},i.registerTech=function(e,n){if(i.techs_||(i.techs_={}),!i.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=xt(e),i.techs_[e]=n,i.techs_[Ji(e)]=n,e!=="Tech"&&i.defaultTechOrder_.push(e),n},i.getTech=function(e){if(e){if(i.techs_&&i.techs_[e])return i.techs_[e];if(e=xt(e),O()&&O().videojs&&O().videojs[e])return Je.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),O().videojs[e]}},i}(Le);en.names.forEach(function(t){var i=en[t];ft.prototype[i.getterName]=function(){return this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName]}}),ft.prototype.featuresVolumeControl=!0,ft.prototype.featuresMuteControl=!0,ft.prototype.featuresFullscreenResize=!1,ft.prototype.featuresPlaybackRate=!1,ft.prototype.featuresProgressEvents=!1,ft.prototype.featuresSourceset=!1,ft.prototype.featuresTimeupdateEvents=!1,ft.prototype.featuresNativeTextTracks=!1,ft.prototype.featuresVideoFrameCallback=!1,ft.withSourceHandlers=function(t){t.registerSourceHandler=function(i,r){var e=t.sourceHandlers;e||(e=t.sourceHandlers=[]),r===void 0&&(r=e.length),e.splice(r,0,i)},t.canPlayType=function(i){for(var r,e=t.sourceHandlers||[],n=0;n<e.length;n++)if(r=e[n].canPlayType(i))return r;return""},t.selectSourceHandler=function(i,r){for(var e=t.sourceHandlers||[],n=0;n<e.length;n++)if(e[n].canHandleSource(i,r))return e[n];return null},t.canPlaySource=function(i,r){var e=t.selectSourceHandler(i,r);return e?e.canHandleSource(i,r):""},["seekable","seeking","duration"].forEach(function(i){var r=this[i];typeof r=="function"&&(this[i]=function(){return this.sourceHandler_&&this.sourceHandler_[i]?this.sourceHandler_[i].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},t.prototype),t.prototype.setSource=function(i){var r=t.selectSourceHandler(i,this.options_);r||(t.nativeSourceHandler?r=t.nativeSourceHandler:Je.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==t.nativeSourceHandler&&(this.currentSource_=i),this.sourceHandler_=r.handleSource(i,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},t.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Le.registerComponent("Tech",ft),ft.registerTech("Tech",ft),ft.defaultTechOrder_=[];var vr={},Cs={},ea={};function Zh(t,i){vr[t]=vr[t]||[],vr[t].push(i)}function ep(t,i,r){t.setTimeout(function(){return yr(i,vr[i.type],r,t)},1)}function tp(t,i){t.forEach(function(r){return r.setTech&&r.setTech(i)})}function np(t,i,r){return t.reduceRight(xs(r),i[r]())}function rp(t,i,r,e){return i[r](t.reduce(xs(r),e))}function ju(t,i,r,e){e===void 0&&(e=null);var n="call"+xt(r),a=t.reduce(xs(n),e),s=a===ea,o=s?null:i[r](a);return sp(t,r,o,s),o}var ip={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ap={setCurrentTime:1,setMuted:1,setVolume:1},Fu={play:1,pause:1};function xs(t){return function(i,r){return i===ea?ea:r[t]?r[t](i):i}}function sp(t,i,r,e){for(var n=t.length-1;n>=0;n--){var a=t[n];a[i]&&a[i](e,r)}}function op(t){Cs[t.id()]=null}function up(t,i){var r=Cs[t.id()],e=null;if(r==null)return e=i(t),Cs[t.id()]=[[i,e]],e;for(var n=0;n<r.length;n++){var a=r[n],s=a[0],o=a[1];s===i&&(e=o)}return e===null&&(e=i(t),r.push([i,e])),e}function yr(t,i,r,e,n,a){t===void 0&&(t={}),i===void 0&&(i=[]),n===void 0&&(n=[]),a===void 0&&(a=!1);var s=i,o=s[0],l=s.slice(1);if(typeof o=="string")yr(t,vr[o],r,e,n,a);else if(o){var h=up(e,o);if(!h.setSource)return n.push(h),yr(t,l,r,e,n,a);h.setSource(Ct({},t),function(g,b){if(g)return yr(t,l,r,e,n,a);n.push(h),yr(b,t.type===b.type?l:vr[b.type],r,e,n,a)})}else l.length?yr(t,l,r,e,n,a):a?r(t,n):yr(t,vr["*"],r,e,n,!0)}var lp={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"},ta=function(t){t===void 0&&(t="");var i=ks(t);return lp[i.toLowerCase()]||""},cp=function(t,i){if(!i)return"";if(t.cache_.source.src===i&&t.cache_.source.type)return t.cache_.source.type;var r=t.cache_.sources.filter(function(s){return s.src===i});if(r.length)return r[0].type;for(var e=t.$$("source"),n=0;n<e.length;n++){var a=e[n];if(a.type&&a.src&&a.src===i)return a.type}return ta(i)},dp=function t(i){if(Array.isArray(i)){var r=[];i.forEach(function(e){e=t(e),Array.isArray(e)?r=r.concat(e):Wn(e)&&r.push(e)}),i=r}else i=typeof i=="string"&&i.trim()?[qu({src:i})]:Wn(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?[qu(i)]:[];return i};function qu(t){if(!t.type){var i=ta(t.src);i&&(t.type=i)}return t}var hp=function(t){function i(r,e,n){var a,s=vt({createEl:!1},e);if(a=t.call(this,r,s,n)||this,e.playerOptions.sources&&e.playerOptions.sources.length!==0)r.src(e.playerOptions.sources);else for(var o=0,l=e.playerOptions.techOrder;o<l.length;o++){var h=xt(l[o]),g=ft.getTech(h);if(h||(g=Le.getComponent(h)),g&&g.isSupported()){r.loadTech_(h);break}}return a}return y(i,t),i}(Le);Le.registerComponent("MediaLoader",hp);var na=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).options_.controlText&&a.controlText(a.options_.controlText),a.handleMouseOver_=function(s){return a.handleMouseOver(s)},a.handleMouseOut_=function(s){return a.handleMouseOut(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.emitTapEvents(),a.enable(),a}y(i,t);var r=i.prototype;return r.createEl=function(e,n,a){e===void 0&&(e="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=Ct({className:this.buildCSSClass(),tabIndex:0},n),e==="button"&&Je.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),a=Ct({role:"button"},a),this.tabIndex_=n.tabIndex;var s=st(e,n,a);return s.appendChild(st("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s},r.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},r.createControlTextEl=function(e){return this.controlTextEl_=st("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},r.controlText=function(e,n){if(n===void 0&&(n=this.el()),e===void 0)return this.controlText_||"Need Text";var a=this.localize(e);this.controlText_=e,pr(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",a)},r.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},r.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},r.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(e){U().isEventKey(e,"Space")||U().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},i}(Le);Le.registerComponent("ClickableComponent",na);var pp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update(),a.update_=function(s){return a.update(s)},e.on("posterchange",a.update_),a}y(i,t);var r=i.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),t.prototype.dispose.call(this)},r.createEl=function(){return st("div",{className:"vjs-poster",tabIndex:-1})},r.update=function(e){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},r.setSrc=function(e){var n="";e&&(n='url("'+e+'")'),this.el_.style.backgroundImage=n},r.handleClick=function(e){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((li||ui)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Dn(this.player_.play()):this.player_.pause()}},i}(na);Le.registerComponent("PosterImage",pp);var _n="#222",Hu="#ccc",fp={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Is(t,i){var r;if(t.length===4)r=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(t.length!==7)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");r=t.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+i+")"}function As(t,i,r){try{t.style[i]=r}catch{return}}var mp=function(t){function i(e,n,a){var s;s=t.call(this,e,n,a)||this;var o=function(l){return s.updateDisplay(l)};return e.on("loadstart",function(l){return s.toggleDisplay(l)}),e.on("texttrackchange",o),e.on("loadedmetadata",function(l){return s.preselectTrack(l)}),e.ready(gt(w(s),function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",o),e.on("playerresize",o),O().addEventListener("orientationchange",o),e.on("dispose",function(){return O().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],h=0;h<l.length;h++)this.player_.addRemoteTextTrack(l[h],!0);this.preselectTrack()}})),s}y(i,t);var r=i.prototype;return r.preselectTrack=function(){for(var e,n,a,s={captions:1,subtitles:1},o=this.player_.textTracks(),l=this.player_.cache_.selectedLanguage,h=0;h<o.length;h++){var g=o[h];l&&l.enabled&&l.language&&l.language===g.language&&g.kind in s?g.kind===l.kind?a=g:a||(a=g):l&&!l.enabled?(a=null,e=null,n=null):g.default&&(g.kind!=="descriptions"||e?g.kind in s&&!n&&(n=g):e=g)}a?a.mode="showing":n?n.mode="showing":e&&(e.mode="showing")},r.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},r.clearDisplay=function(){typeof O().WebVTT=="function"&&O().WebVTT.processCues(O(),[],this.el_)},r.updateDisplay=function(){var e=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],s=0;s<e.length;++s){var o=e[s];o.mode==="showing"&&a.push(o)}this.updateForTrack(a)}else{for(var l=null,h=null,g=e.length;g--;){var b=e[g];b.mode==="showing"&&(b.kind==="descriptions"?l=b:h=b)}h?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(h)):l&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(l))}},r.updateDisplayState=function(e){for(var n=this.player_.textTrackSettings.getValues(),a=e.activeCues,s=a.length;s--;){var o=a[s];if(o){var l=o.displayState;if(n.color&&(l.firstChild.style.color=n.color),n.textOpacity&&As(l.firstChild,"color",Is(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(l.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&As(l.firstChild,"backgroundColor",Is(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?As(l,"backgroundColor",Is(n.windowColor,n.windowOpacity)):l.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?l.firstChild.style.textShadow="2px 2px 3px "+_n+", 2px 2px 4px "+_n+", 2px 2px 5px "+_n:n.edgeStyle==="raised"?l.firstChild.style.textShadow="1px 1px "+_n+", 2px 2px "+_n+", 3px 3px "+_n:n.edgeStyle==="depressed"?l.firstChild.style.textShadow="1px 1px "+Hu+", 0 1px "+Hu+", -1px -1px "+_n+", 0 -1px "+_n:n.edgeStyle==="uniform"&&(l.firstChild.style.textShadow="0 0 4px "+_n+", 0 0 4px "+_n+", 0 0 4px "+_n+", 0 0 4px "+_n)),n.fontPercent&&n.fontPercent!==1){var h=O().parseFloat(l.style.fontSize);l.style.fontSize=h*n.fontPercent+"px",l.style.height="auto",l.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?l.firstChild.style.fontVariant="small-caps":l.firstChild.style.fontFamily=fp[n.fontFamily])}}},r.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),typeof O().WebVTT=="function"&&!e.every(function(_){return!_.activeCues})){for(var n=[],a=0;a<e.length;++a)for(var s=e[a],o=0;o<s.activeCues.length;++o)n.push(s.activeCues[o]);O().WebVTT.processCues(O(),n,this.el_);for(var l=0;l<e.length;++l){for(var h=e[l],g=0;g<h.activeCues.length;++g){var b=h.activeCues[g].displayState;Xn(b,"vjs-text-track-cue"),Xn(b,"vjs-text-track-cue-"+(h.language?h.language:l)),h.language&&Rr(b,"lang",h.language)}this.player_.textTrackSettings&&this.updateDisplayState(h)}}},i}(Le);Le.registerComponent("TextTrackDisplay",mp);var gp=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){var r=this.player_.isAudio(),e=this.localize(r?"Audio Player":"Video Player"),n=st("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])}),a=t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return a.appendChild(n),a},i}(Le);Le.registerComponent("LoadingSpinner",gp);var En=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.createEl=function(e,n,a){n===void 0&&(n={}),a===void 0&&(a={});var s=st("button",n=Ct({className:this.buildCSSClass()},n),a=Ct({type:"button"},a));return s.appendChild(st("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s},r.addChild=function(e,n){n===void 0&&(n={});var a=this.constructor.name;return Je.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),Le.prototype.addChild.call(this,e,n)},r.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(e){U().isEventKey(e,"Space")||U().isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},i}(na);Le.registerComponent("Button",En);var Vu=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).mouseused_=!1,a.on("mousedown",function(s){return a.handleMouseDown(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(e){var n=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Dn(n),void(this.player_.tech(!0)&&(!li&&!ui||!a)&&this.player_.tech(!0).focus())}var s=this.player_.getChild("controlBar"),o=s&&s.getChild("playToggle");if(o){var l=function(){return o.focus()};fi(n)?n.then(l,function(){}):this.setTimeout(l,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(e){this.mouseused_=!1,t.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(e){this.mouseused_=!0},i}(En);Vu.prototype.controlText_="Play Video",Le.registerComponent("BigPlayButton",Vu);var vp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).controlText(n&&n.controlText||a.localize("Close")),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){U().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},i}(En);Le.registerComponent("CloseButton",vp);var Wu=function(t){function i(e,n){var a;return n===void 0&&(n={}),a=t.call(this,e,n)||this,n.replay=n.replay===void 0||n.replay,a.on(e,"play",function(s){return a.handlePlay(s)}),a.on(e,"pause",function(s){return a.handlePause(s)}),n.replay&&a.on(e,"ended",function(s){return a.handleEnded(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?Dn(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(e){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},i}(En);Wu.prototype.controlText_="Play",Le.registerComponent("PlayToggle",Wu);var Gu=function(t,i){t=t<0?0:t;var r=Math.floor(t%60),e=Math.floor(t/60%60),n=Math.floor(t/3600),a=Math.floor(i/60%60),s=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(n=e=r="-"),(n=n>0||s>0?n+":":"")+(e=((n||a>=10)&&e<10?"0"+e:e)+":")+(r=r<10?"0"+r:r)},Ps=Gu;function yp(t){Ps=t}function _p(){Ps=Gu}function Vr(t,i){return i===void 0&&(i=t),Ps(t,i)}var Wr=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,["timeupdate","ended"],function(s){return a.updateContent(s)}),a.updateTextNode_(),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=this.buildCSSClass(),n=t.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=st("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=st("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},r.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},r.updateTextNode_=function(e){var n=this;e===void 0&&(e=0),e=Vr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,Je.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=ie().createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},r.updateContent=function(e){},i}(Le);Wr.prototype.labelText_="Time",Wr.prototype.controlText_="Time",Le.registerComponent("TimeDisplay",Wr);var Os=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(e){var n;n=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},i}(Wr);Os.prototype.labelText_="Current Time",Os.prototype.controlText_="Current Time",Le.registerComponent("CurrentTimeDisplay",Os);var Ds=function(t){function i(e,n){var a,s=function(o){return a.updateContent(o)};return(a=t.call(this,e,n)||this).on(e,"durationchange",s),a.on(e,"loadstart",s),a.on(e,"loadedmetadata",s),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var n=this.player_.duration();this.updateTextNode_(n)},i}(Wr);Ds.prototype.labelText_="Duration",Ds.prototype.controlText_="Duration",Le.registerComponent("DurationDisplay",Ds);var bp=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){var r=t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),e=t.prototype.createEl.call(this,"div"),n=t.prototype.createEl.call(this,"span",{textContent:"/"});return e.appendChild(n),r.appendChild(e),r},i}(Le);Le.registerComponent("TimeDivider",bp);var Ls=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"durationchange",function(s){return a.updateContent(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=t.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(st("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(e){var n;typeof this.player_.duration()=="number"&&(n=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(n))},i}(Wr);Ls.prototype.labelText_="Remaining Time",Ls.prototype.controlText_="Remaining Time",Le.registerComponent("RemainingTimeDisplay",Ls);var Tp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).updateShowing(),a.on(a.player(),"durationchange",function(s){return a.updateShowing(s)}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=st("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(st("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(ie().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},i}(Le);Le.registerComponent("LiveDisplay",Tp);var zu=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).updateLiveEdgeStatus(),a.player_.liveTracker&&(a.updateLiveEdgeStatusHandler_=function(s){return a.updateLiveEdgeStatus(s)},a.on(a.player_.liveTracker,"liveedgechange",a.updateLiveEdgeStatusHandler_)),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=st("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,t.prototype.dispose.call(this)},i}(En);zu.prototype.controlText_="Seek to live, currently playing live",Le.registerComponent("SeekToLive",zu);var ra=function(t,i,r){return t=Number(t),Math.min(r,Math.max(i,isNaN(t)?i:t))},Ms=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).handleMouseDown_=function(s){return a.handleMouseDown(s)},a.handleMouseUp_=function(s){return a.handleMouseUp(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleMouseMove_=function(s){return a.handleMouseMove(s)},a.update_=function(s){return a.update(s)},a.bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}y(i,t);var r=i.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=Ct({tabIndex:0},n),a=Ct({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),t.prototype.createEl.call(this,e,n,a)},r.handleMouseDown=function(e){var n=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!zn&&e.preventDefault(),cu(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;du(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var e=this;if(this.el_&&this.bar){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*n).toFixed(2)+"%"})),n}},r.getProgress=function(){return Number(ra(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var n=zi(this.el_,e);return this.vertical()?n.y:n.x},r.handleKeyDown=function(e){U().isEventKey(e,"Left")||U().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):U().isEventKey(e,"Right")||U().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):t.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},i}(Le);Le.registerComponent("Slider",Ms);var Rs=function(t,i){return ra(t/i*100,0,100).toFixed(2)+"%"},Sp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).partEls_=[],a.on(e,"progress",function(s){return a.update(s)}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=st("span",{className:"vjs-control-text"}),a=st("span",{textContent:this.localize("Loaded")}),s=ie().createTextNode(": ");return this.percentageEl_=st("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(n),n.appendChild(a),n.appendChild(s),n.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,t.prototype.dispose.call(this)},r.update=function(e){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,s=n.player_.buffered(),o=a&&a.isLive()?a.seekableEnd():n.player_.duration(),l=n.player_.bufferedEnd(),h=n.partEls_,g=Rs(l,o);n.percent_!==g&&(n.el_.style.width=g,pr(n.percentageEl_,g),n.percent_=g);for(var b=0;b<s.length;b++){var _=s.start(b),G=s.end(b),ne=h[b];ne||(ne=n.el_.appendChild(st()),h[b]=ne),(ne.dataset.start!==_||ne.dataset.end!==G)&&(ne.dataset.start=_,ne.dataset.end=G,ne.style.left=Rs(_,l),ne.style.width=Rs(G-_,l))}for(var ye=h.length;ye>s.length;ye--)n.el_.removeChild(h[ye-1]);h.length=s.length})},i}(Le);Le.registerComponent("LoadProgressBar",Sp);var Ep=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Yn(gt(w(a),a.update),Sn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,n,a){var s=di(this.el_),o=Nr(this.player_.el()),l=e.width*n;if(o&&s){var h=e.left-o.left+l,g=e.width-l+(o.right-e.right),b=s.width/2;h<b?b+=b-h:g<b&&(b=g),b<0?b=0:b>s.width&&(b=s.width),b=Math.round(b),this.el_.style.right="-"+b+"px",this.write(a)}},r.write=function(e){pr(this.el_,e)},r.updateTime=function(e,n,a,s){var o=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,h=o.player_.duration();if(o.player_.liveTracker&&o.player_.liveTracker.isLive()){var g=o.player_.liveTracker.liveWindow(),b=g-n*g;l=(b<1?"":"-")+Vr(b,g)}else l=Vr(a,h);o.update(e,n,l),s&&s()})},i}(Le);Le.registerComponent("TimeTooltip",Ep);var Ns=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Yn(gt(w(a),a.update),Sn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,n){var a=this.getChild("timeTooltip");if(a){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,n,s)}},i}(Le);Ns.prototype.options_={children:[]},!$t&&!Gn&&Ns.prototype.options_.children.push("timeTooltip"),Le.registerComponent("PlayProgressBar",Ns);var Xu=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Yn(gt(w(a),a.update),Sn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,n){var a=this,s=n*this.player_.duration();this.getChild("timeTooltip").updateTime(e,n,s,function(){a.el_.style.left=e.width*n+"px"})},i}(Le);Xu.prototype.options_={children:["timeTooltip"]},Le.registerComponent("MouseTimeDisplay",Xu);var ia=5,Ku=12,Us=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).setEventHandlers_(),a}y(i,t);var r=i.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=gt(this,this.update),this.update=Yn(this.update_,Sn),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return e.enableInterval_(n)},this.disableIntervalHandler_=function(n){return e.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie()&&"visibilityState"in ie()&&this.on(ie(),"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){ie().visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Sn))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var n=this;if(ie().visibilityState!=="hidden"){var a=t.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var s=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),o=n.player_.liveTracker,l=n.player_.duration();o&&o.isLive()&&(l=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),n.percent_=a),(n.currentTime_!==s||n.duration_!==l)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Vr(s,l),Vr(l,l)],"{1} of {2}")),n.currentTime_=s,n.duration_=l),n.bar&&n.bar.update(Nr(n.el()),n.getProgress())}),a}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e,n=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(e=(n-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(e=1)):e=n/this.player_.duration(),e},r.handleMouseDown=function(e){!hi(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(e,n){if(n===void 0&&(n=!1),hi(e)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,s=this.calculateDistance(e),o=this.player_.liveTracker;if(o&&o.isLive()){if(s>=.99)return void o.seekToLiveEdge();var l=o.seekableStart(),h=o.liveCurrentTime();if((a=l+s*o.liveWindow())>=h&&(a=h),a<=l&&(a=l+.1),a===1/0)return}else(a=s*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},r.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},r.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},r.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Dn(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+ia)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-ia)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var n=this.player_.liveTracker;if(U().isEventKey(e,"Space")||U().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(U().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(U().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(U()(e))){e.preventDefault(),e.stopPropagation();var a=10*(U().codes[U()(e)]-U().codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else U().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-ia*Ku)):U().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+ia*Ku)):t.prototype.handleKeyDown.call(this,e)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie()&&"visibilityState"in ie()&&this.off(ie(),"visibilitychange",this.toggleVisibility_),t.prototype.dispose.call(this)},i}(Ms);Us.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!$t&&!Gn&&Us.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Le.registerComponent("SeekBar",Us);var Qu=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).handleMouseMove=Yn(gt(w(a),a.handleMouseMove),Sn),a.throttledHandleMouseSeek=Yn(gt(w(a),a.handleMouseSeek),Sn),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.handleMouseDownHandler_=function(s){return a.handleMouseDown(s)},a.enable(),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),s=n.getChild("mouseTimeDisplay");if(a||s){var o=n.el(),l=di(o),h=zi(o,e).x;h=ra(h,0,1),s&&s.update(l,h),a&&a.update(l,n.getProgress())}}},r.handleMouseSeek=function(e){var n=this.getChild("seekBar");n&&n.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Dn(this.player_.play())}},r.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(e){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},i}(Le);Qu.prototype.options_={children:["seekBar"]},Le.registerComponent("ProgressControl",Qu);var Yu=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],function(s){return a.handlePictureInPictureChange(s)}),a.on(e,["disablepictureinpicturechanged","loadedmetadata"],function(s){return a.handlePictureInPictureEnabledChange(s)}),a.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){e.currentType().substring(0,5)==="audio"||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),a.hide()):a.show()}),a.disable(),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+t.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){ie().pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(En);Yu.prototype.controlText_="Picture-in-Picture",Le.registerComponent("PictureInPictureToggle",Yu);var $u=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"fullscreenchange",function(s){return a.handleFullscreenChange(s)}),ie()[e.fsApi_.fullscreenEnabled]===!1&&a.disable(),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(En);$u.prototype.controlText_="Fullscreen",Le.registerComponent("FullscreenToggle",$u);var wp=function(t,i){i.tech_&&!i.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},kp=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){var r=t.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(t.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},i}(Le);Le.registerComponent("VolumeLevel",kp);var Cp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Yn(gt(w(a),a.update),Sn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,n,a,s){if(!a){var o=Nr(this.el_),l=Nr(this.player_.el()),h=e.width*n;if(!l||!o)return;var g=e.left-l.left+h,b=e.width-h+(l.right-e.right),_=o.width/2;g<_?_+=_-g:b<_&&(_=b),_<0?_=0:_>o.width&&(_=o.width),this.el_.style.right="-"+_+"px"}this.write(s+"%")},r.write=function(e){pr(this.el_,e)},r.updateVolume=function(e,n,a,s,o){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,n,a,s.toFixed(0)),o&&o()})},i}(Le);Le.registerComponent("VolumeLevelTooltip",Cp);var Ju=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Yn(gt(w(a),a.update),Sn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,n,a){var s=this,o=100*n;this.getChild("volumeLevelTooltip").updateVolume(e,n,a,o,function(){a?s.el_.style.bottom=e.height*n+"px":s.el_.style.left=e.width*n+"px"})},i}(Le);Ju.prototype.options_={children:["volumeLevelTooltip"]},Le.registerComponent("MouseVolumeLevelDisplay",Ju);var aa=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on("slideractive",function(s){return a.updateLastVolume_(s)}),a.on(e,"volumechange",function(s){return a.updateARIAAttributes(s)}),e.ready(function(){return a.updateARIAAttributes()}),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){!hi(e)||t.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(e){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),s=Nr(a),o=this.vertical(),l=zi(a,e);l=o?l.y:l.x,l=ra(l,0,1),n.update(s,l,o)}!hi(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var e=this,n=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(n)})},i}(Ms);aa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!$t&&!Gn&&aa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),aa.prototype.playerEvent="volumechange",Le.registerComponent("VolumeBar",aa);var Zu=function(t){function i(e,n){var a;return n===void 0&&(n={}),n.vertical=n.vertical||!1,(n.volumeBar===void 0||si(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),a=t.call(this,e,n)||this,wp(w(a),e),a.throttledHandleMouseMove=Yn(gt(w(a),a.handleMouseMove),Sn),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.on("mousedown",function(s){return a.handleMouseDown(s)}),a.on("touchstart",function(s){return a.handleMouseDown(s)}),a.on("mousemove",function(s){return a.handleMouseMove(s)}),a.on(a.volumeBar,["focus","slideractive"],function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")}),a.on(a.volumeBar,["blur","sliderinactive"],function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(e){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},i}(Le);Zu.prototype.options_={children:["volumeBar"]},Le.registerComponent("VolumeControl",Zu);var xp=function(t,i){i.tech_&&!i.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},el=function(t){function i(e,n){var a;return a=t.call(this,e,n)||this,xp(w(a),e),a.on(e,["loadstart","volumechange"],function(s){return a.update(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var s=a<.1?.1:a;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),n=3;$t&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?n=0:e<.33?n=1:e<.67&&(n=2);for(var a=0;a<4;a++)ci(this.el_,"vjs-vol-"+a);Xn(this.el_,"vjs-vol-"+n)},r.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},i}(En);el.prototype.controlText_="Mute",Le.registerComponent("MuteToggle",el);var tl=function(t){function i(e,n){var a;return n===void 0&&(n={}),n.inline!==void 0?n.inline=n.inline:n.inline=!0,(n.volumeControl===void 0||si(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(a=t.call(this,e,n)||this).handleKeyPressHandler_=function(s){return a.handleKeyPress(s)},a.on(e,["loadstart"],function(s){return a.volumePanelState_(s)}),a.on(a.muteToggle,"keyup",function(s){return a.handleKeyPress(s)}),a.on(a.volumeControl,"keyup",function(s){return a.handleVolumeControlKeyUp(s)}),a.on("keydown",function(s){return a.handleKeyPress(s)}),a.on("mouseover",function(s){return a.handleMouseOver(s)}),a.on("mouseout",function(s){return a.handleMouseOut(s)}),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}y(i,t);var r=i.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),t.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){U().isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),hn(ie(),"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Xt(ie(),"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){U().isEventKey(e,"Esc")&&this.handleMouseOut()},i}(Le);tl.prototype.options_={children:["muteToggle","volumeControl"]},Le.registerComponent("VolumePanel",tl);var nl=function(t){function i(e,n){var a;return a=t.call(this,e,n)||this,n&&(a.menuButton_=n.menuButton),a.focusedChild_=-1,a.on("keydown",function(s){return a.handleKeyDown(s)}),a.boundHandleBlur_=function(s){return a.handleBlur(s)},a.boundHandleTapClick_=function(s){return a.handleTapClick(s)},a}y(i,t);var r=i.prototype;return r.addEventListenerForItem=function(e){e instanceof Le&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof Le&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),t.prototype.removeChild.call(this,e)},r.addItem=function(e){var n=this.addChild(e);n&&this.addEventListenerForItem(n)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=st(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),hn(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,t.prototype.dispose.call(this)},r.handleBlur=function(e){var n=e.relatedTarget||ie().activeElement;if(!this.children().some(function(s){return s.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(s){return s.el()===e.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(e){U().isEventKey(e,"Left")||U().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(U().isEventKey(e,"Right")||U().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){e===void 0&&(e=0);var n=this.children().slice();n.length&&n[0].hasClass("vjs-menu-title")&&n.shift(),n.length>0&&(e<0?e=0:e>=n.length&&(e=n.length-1),this.focusedChild_=e,n[e].el_.focus())},i}(Le);Le.registerComponent("Menu",nl);var Bs=function(t){function i(e,n){var a;n===void 0&&(n={}),(a=t.call(this,e,n)||this).menuButton_=new En(e,n),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var s=En.prototype.buildCSSClass();a.menuButton_.el_.className=a.buildCSSClass()+" "+s,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0;var o=function(l){return a.handleClick(l)};return a.handleMenuKeyUp_=function(l){return a.handleMenuKeyUp(l)},a.on(a.menuButton_,"tap",o),a.on(a.menuButton_,"click",o),a.on(a.menuButton_,"keydown",function(l){return a.handleKeyDown(l)}),a.on(a.menuButton_,"mouseenter",function(){a.addClass("vjs-hover"),a.menu.show(),hn(ie(),"keyup",a.handleMenuKeyUp_)}),a.on("mouseleave",function(l){return a.handleMouseLeave(l)}),a.on("keydown",function(l){return a.handleSubmenuKeyDown(l)}),a}y(i,t);var r=i.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var e=new nl(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=st("li",{className:"vjs-menu-title",textContent:xt(this.options_.title),tabIndex:-1}),a=new Le(this.player_,{el:n});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var s=0;s<this.items.length;s++)e.addItem(this.items[s]);return e},r.createItems=function(){},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+En.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},r.controlText=function(e,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(e,n)},r.dispose=function(){this.handleMouseLeave(),t.prototype.dispose.call(this)},r.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Xt(ie(),"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(e){U().isEventKey(e,"Esc")||U().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),U().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(U().isEventKey(e,"Up")||U().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(e){(U().isEventKey(e,"Esc")||U().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},r.handleSubmenuKeyDown=function(e){(U().isEventKey(e,"Esc")||U().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),U().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),$t&&au())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},i}(Le);Le.registerComponent("MenuButton",Bs);var js=function(t){function i(r,e){var n,a=e.tracks;if((n=t.call(this,r,e)||this).items.length<=1&&n.hide(),!a)return w(n);var s=gt(w(n),n.update);return a.addEventListener("removetrack",s),a.addEventListener("addtrack",s),a.addEventListener("labelchange",s),n.player_.on("ready",s),n.player_.on("dispose",function(){a.removeEventListener("removetrack",s),a.removeEventListener("addtrack",s),a.removeEventListener("labelchange",s)}),n}return y(i,t),i}(Bs);Le.registerComponent("TrackButton",js);var Ip=["Tab","Esc","Up","Down","Right","Left"],gi=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).selectable=n.selectable,a.isSelected_=n.selected||!1,a.multiSelectable=n.multiSelectable,a.selected(a.isSelected_),a.selectable?a.multiSelectable?a.el_.setAttribute("role","menuitemcheckbox"):a.el_.setAttribute("role","menuitemradio"):a.el_.setAttribute("role","menuitem"),a}y(i,t);var r=i.prototype;return r.createEl=function(e,n,a){this.nonIconControl=!0;var s=t.prototype.createEl.call(this,"li",Ct({className:"vjs-menu-item",tabIndex:-1},n),a);return s.replaceChild(st("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),s.querySelector(".vjs-icon-placeholder")),s},r.handleKeyDown=function(e){Ip.some(function(n){return U().isEventKey(e,n)})||t.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){this.selected(!0)},r.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},i}(na);Le.registerComponent("MenuItem",gi);var vi=function(t){function i(e,n){var a,s=n.track,o=e.textTracks();n.label=s.label||s.language||"Unknown",n.selected=s.mode==="showing",(a=t.call(this,e,n)||this).track=s,a.kinds=(n.kinds||[n.kind||a.track.kind]).filter(Boolean);var l,h=function(){for(var b=arguments.length,_=new Array(b),G=0;G<b;G++)_[G]=arguments[G];a.handleTracksChange.apply(w(a),_)},g=function(){for(var b=arguments.length,_=new Array(b),G=0;G<b;G++)_[G]=arguments[G];a.handleSelectedLanguageChange.apply(w(a),_)};return e.on(["loadstart","texttrackchange"],h),o.addEventListener("change",h),o.addEventListener("selectedlanguagechange",g),a.on("dispose",function(){e.off(["loadstart","texttrackchange"],h),o.removeEventListener("change",h),o.removeEventListener("selectedlanguagechange",g)}),o.onchange===void 0&&a.on(["tap","click"],function(){if(typeof O().Event!="object")try{l=new(O()).Event("change")}catch{}l||(l=ie().createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(l)}),a.handleTracksChange(),a}y(i,t);var r=i.prototype;return r.handleClick=function(e){var n=this.track,a=this.player_.textTracks();if(t.prototype.handleClick.call(this,e),a)for(var s=0;s<a.length;s++){var o=a[s];this.kinds.indexOf(o.kind)!==-1&&(o===n?o.mode!=="showing"&&(o.mode="showing"):o.mode!=="disabled"&&(o.mode="disabled"))}},r.handleTracksChange=function(e){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},r.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},r.dispose=function(){this.track=null,t.prototype.dispose.call(this)},i}(gi);Le.registerComponent("TextTrackMenuItem",vi);var rl=function(t){function i(e,n){return n.track={player:e,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,t.call(this,e,n)||this}y(i,t);var r=i.prototype;return r.handleTracksChange=function(e){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s<o;s++){var l=n[s];if(this.options_.kinds.indexOf(l.kind)>-1&&l.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},r.handleSelectedLanguageChange=function(e){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s<o;s++){var l=n[s];if(["captions","descriptions","subtitles"].indexOf(l.kind)>-1&&l.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(vi);Le.registerComponent("OffTextTrackMenuItem",rl);var Gr=function(t){function i(r,e){return e===void 0&&(e={}),e.tracks=r.textTracks(),t.call(this,r,e)||this}return y(i,t),i.prototype.createItems=function(r,e){var n;r===void 0&&(r=[]),e===void 0&&(e=vi),this.label_&&(n=this.label_+" off"),r.push(new rl(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var s=0;s<a.length;s++){var o=a[s];if(this.kinds_.indexOf(o.kind)>-1){var l=new e(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass("vjs-"+o.kind+"-menu-item"),r.push(l)}}return r},i}(js);Le.registerComponent("TextTrackButton",Gr);var il=function(t){function i(r,e){var n,a=e.track,s=e.cue,o=r.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=s.text,e.selected=s.startTime<=o&&o<s.endTime,(n=t.call(this,r,e)||this).track=a,n.cue=s,n}return y(i,t),i.prototype.handleClick=function(r){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},i}(gi);Le.registerComponent("ChaptersTrackMenuItem",il);var Fs=function(t){function i(e,n,a){var s;return(s=t.call(this,e,n,a)||this).selectCurrentItem_=function(){s.items.forEach(function(o){o.selected(s.track_.activeCues[0]===o.cue)})},s}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},r.update=function(e){if(!e||!e.track||e.track.kind==="chapters"){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),t.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&t.prototype.update.call(this)}},r.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},r.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],n=e.length-1;n>=0;n--){var a=e[n];if(a.kind===this.kind_)return a}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(xt(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var n=this.track_.cues;if(!n)return e;for(var a=0,s=n.length;a<s;a++){var o=n[a],l=new il(this.player_,{track:this.track_,cue:o});e.push(l)}return e},i}(Gr);Fs.prototype.kind_="chapters",Fs.prototype.controlText_="Chapters",Le.registerComponent("ChaptersButton",Fs);var qs=function(t){function i(e,n,a){var s;s=t.call(this,e,n,a)||this;var o=e.textTracks(),l=gt(w(s),s.handleTracksChange);return o.addEventListener("change",l),s.on("dispose",function(){o.removeEventListener("change",l)}),s}y(i,t);var r=i.prototype;return r.handleTracksChange=function(e){for(var n=this.player().textTracks(),a=!1,s=0,o=n.length;s<o;s++){var l=n[s];if(l.kind!==this.kind_&&l.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},i}(Gr);qs.prototype.kind_="descriptions",qs.prototype.controlText_="Descriptions",Le.registerComponent("DescriptionsButton",qs);var Hs=function(t){function i(e,n,a){return t.call(this,e,n,a)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},i}(Gr);Hs.prototype.kind_="subtitles",Hs.prototype.controlText_="Subtitles",Le.registerComponent("SubtitlesButton",Hs);var Vs=function(t){function i(r,e){var n;return e.track={player:r,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",(n=t.call(this,r,e)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+e.kind+" settings dialog"),n}return y(i,t),i.prototype.handleClick=function(r){this.player().getChild("textTrackSettings").open()},i}(vi);Le.registerComponent("CaptionSettingsMenuItem",Vs);var Ws=function(t){function i(e,n,a){return t.call(this,e,n,a)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Vs(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},i}(Gr);Ws.prototype.kind_="captions",Ws.prototype.controlText_="Captions",Le.registerComponent("CaptionsButton",Ws);var al=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(r,e,n){var a=t.prototype.createEl.call(this,r,e,n),s=a.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(s.appendChild(st("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(st("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),a},i}(vi);Le.registerComponent("SubsCapsMenuItem",al);var Gs=function(t){function i(e,n){var a;return n===void 0&&(n={}),(a=t.call(this,e,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(a.player_.language_)>-1&&(a.label_="captions"),a.menuButton_.controlText(xt(a.label_)),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Vs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,al)},i}(Gr);Gs.prototype.kinds_=["captions","subtitles"],Gs.prototype.controlText_="Subtitles",Le.registerComponent("SubsCapsButton",Gs);var sl=function(t){function i(e,n){var a,s=n.track,o=e.audioTracks();n.label=s.label||s.language||"Unknown",n.selected=s.enabled,(a=t.call(this,e,n)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");var l=function(){for(var h=arguments.length,g=new Array(h),b=0;b<h;b++)g[b]=arguments[b];a.handleTracksChange.apply(w(a),g)};return o.addEventListener("change",l),a.on("dispose",function(){o.removeEventListener("change",l)}),a}y(i,t);var r=i.prototype;return r.createEl=function(e,n,a){var s=t.prototype.createEl.call(this,e,n,a),o=s.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(o.appendChild(st("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),o.appendChild(st("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s},r.handleClick=function(e){if(t.prototype.handleClick.call(this,e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var s=n[a];s!==this.track&&(s.enabled=s===this.track)}},r.handleTracksChange=function(e){this.selected(this.track.enabled)},i}(gi);Le.registerComponent("AudioTrackMenuItem",sl);var ol=function(t){function i(e,n){return n===void 0&&(n={}),n.tracks=e.audioTracks(),t.call(this,e,n)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var s=n[a];e.push(new sl(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e},i}(js);ol.prototype.controlText_="Audio Track",Le.registerComponent("AudioTrackButton",ol);var zs=function(t){function i(e,n){var a,s=n.rate,o=parseFloat(s,10);return n.label=s,n.selected=o===e.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(a=t.call(this,e,n)||this).label=s,a.rate=o,a.on(e,"ratechange",function(l){return a.update(l)}),a}y(i,t);var r=i.prototype;return r.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(e){this.selected(this.player().playbackRate()===this.rate)},i}(gi);zs.prototype.contentElType="button",Le.registerComponent("PlaybackRateMenuItem",zs);var ul=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).menuButton_.el_.setAttribute("aria-describedby",a.labelElId_),a.updateVisibility(),a.updateLabel(),a.on(e,"loadstart",function(s){return a.updateVisibility(s)}),a.on(e,"ratechange",function(s){return a.updateLabel(s)}),a.on(e,"playbackrateschange",function(s){return a.handlePlaybackRateschange(s)}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=st("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e},r.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){for(var e=this.playbackRates(),n=[],a=e.length-1;a>=0;a--)n.push(new zs(this.player(),{rate:e[a]+"x"}));return n},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){var n=this.player().playbackRate(),a=this.playbackRates(),s=(a.indexOf(n)+1)%a.length;this.player().playbackRate(a[s])},r.handlePlaybackRateschange=function(e){this.update()},r.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},i}(Bs);ul.prototype.controlText_="Playback Rate",Le.registerComponent("PlaybackRateMenuButton",ul);var ll=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(e,n,a){return e===void 0&&(e="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),t.prototype.createEl.call(this,e,n,a)},i}(Le);Le.registerComponent("Spacer",ll);var Ap=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},i}(ll);Le.registerComponent("CustomControlSpacer",Ap);var sa=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(Le);sa.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in ie()&&sa.prototype.options_.children.splice(sa.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Le.registerComponent("ControlBar",sa);var cl=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"error",function(s){return a.open(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},i}(jr);cl.prototype.options_=we({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Le.registerComponent("ErrorDisplay",cl);var Xs="vjs-text-track-settings",dl=["#000","Black"],hl=["#00F","Blue"],pl=["#0FF","Cyan"],fl=["#0F0","Green"],ml=["#F0F","Magenta"],gl=["#F00","Red"],vl=["#FFF","White"],yl=["#FF0","Yellow"],Ks=["1","Opaque"],Qs=["0.5","Semi-Transparent"],_l=["0","Transparent"],_r={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[dl,vl,gl,fl,hl,yl,ml,pl]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ks,Qs,_l]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[vl,dl,gl,fl,hl,yl,ml,pl]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ks,Qs]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[_l,Qs,Ks]}};function bl(t,i){if(i&&(t=i(t)),t&&t!=="none")return t}function Pp(t,i){return bl(t.options[t.options.selectedIndex].value,i)}function Op(t,i,r){if(i){for(var e=0;e<t.options.length;e++)if(bl(t.options[e].value,r)===i){t.selectedIndex=e;break}}}_r.windowColor.options=_r.backgroundColor.options;var Dp=function(t){function i(e,n){var a;return n.temporary=!1,(a=t.call(this,e,n)||this).updateDisplay=a.updateDisplay.bind(w(a)),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=st("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),n.persistTextTrackSettings===void 0&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),Or(_r,function(s){a.on(a.$(s.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}y(i,t);var r=i.prototype;return r.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},r.createElSelect_=function(e,n,a){var s=this;n===void 0&&(n=""),a===void 0&&(a="label");var o=_r[e],l=o.id.replace("%s",this.id_),h=[n,l].join(" ").trim();return["<"+a+' id="'+l+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(o.label),"</"+a+">",'<select aria-labelledby="'+h+'">'].concat(o.options.map(function(g){var b=l+"-"+g[1].replace(/\W+/g,"");return['<option id="'+b+'" value="'+g[0]+'" ','aria-labelledby="'+h+" "+b+'">',s.localize(g[1]),"</option>"].join("")})).concat("</select>").join("")},r.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},r.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},r.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},r.createElColors_=function(){return st("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return st("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},r.createElControls_=function(){var e=this.localize("restore all settings to the default values");return st("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var e=this;return Th(_r,function(n,a,s){var o=Pp(e.$(a.selector),a.parser);return o!==void 0&&(n[s]=o),n},{})},r.setValues=function(e){var n=this;Or(_r,function(a,s){Op(n.$(a.selector),e[s],a.parser)})},r.setDefaults=function(){var e=this;Or(_r,function(n){var a=n.hasOwnProperty("default")?n.default:0;e.$(n.selector).selectedIndex=a})},r.restoreSettings=function(){var e;try{e=JSON.parse(O().localStorage.getItem(Xs))}catch(n){Je.warn(n)}e&&this.setValues(e)},r.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?O().localStorage.setItem(Xs,JSON.stringify(e)):O().localStorage.removeItem(Xs)}catch(n){Je.warn(n)}}},r.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,n=e&&e.subsCapsButton,a=e&&e.captionsButton;n?n.focus():a&&a.focus()},i}(jr);Le.registerComponent("TextTrackSettings",Dp);var Lp=function(t){function i(e,n){var a,s=n.ResizeObserver||O().ResizeObserver;n.ResizeObserver===null&&(s=!1);var o=vt({createEl:!s,reportTouchActivity:!1},n);return(a=t.call(this,e,o)||this).ResizeObserver=n.ResizeObserver||O().ResizeObserver,a.loadListener_=null,a.resizeObserver_=null,a.debouncedHandler_=Oh(function(){a.resizeHandler()},100,!1,w(a)),s?(a.resizeObserver_=new a.ResizeObserver(a.debouncedHandler_),a.resizeObserver_.observe(e.el())):(a.loadListener_=function(){if(a.el_&&a.el_.contentWindow){var l=a.debouncedHandler_,h=a.unloadListener_=function(){Xt(this,"resize",l),Xt(this,"unload",h),h=null};hn(a.el_.contentWindow,"unload",h),hn(a.el_.contentWindow,"resize",l)}},a.one("load",a.loadListener_)),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},r.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,t.prototype.dispose.call(this)},i}(Le);Le.registerComponent("ResizeManager",Lp);var Mp={trackingThreshold:20,liveTolerance:15},Rp=function(t){function i(e,n){var a,s=vt(Mp,n,{createEl:!1});return(a=t.call(this,e,s)||this).handleVisibilityChange_=function(o){return a.handleVisibilityChange(o)},a.trackLiveHandler_=function(){return a.trackLive_()},a.handlePlay_=function(o){return a.handlePlay(o)},a.handleFirstTimeupdate_=function(o){return a.handleFirstTimeupdate(o)},a.handleSeeked_=function(o){return a.handleSeeked(o)},a.seekToLiveEdge_=function(o){return a.seekToLiveEdge(o)},a.reset_(),a.on(a.player_,"durationchange",function(o){return a.handleDurationchange(o)}),a.on(a.player_,"canplay",function(){return a.toggleTracking()}),li&&"hidden"in ie()&&"visibilityState"in ie()&&a.on(ie(),"visibilitychange",a.handleVisibilityChange_),a}y(i,t);var r=i.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(ie().hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var n=Number(O().performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var s=this.liveCurrentTime(),o=this.player_.currentTime(),l=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-o)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(l=!1),l!==this.behindLiveEdge_&&(this.behindLiveEdge_=l,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Sn),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_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var e=this.player_.seekable(),n=[],a=e?e.length:0;a--;)n.push(e.end(a));return n.length?n.sort()[n.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),n=[],a=e?e.length:0;a--;)n.push(e.start(a));return n.length?n.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(ie(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),t.prototype.dispose.call(this)},i}(Le);Le.registerComponent("LiveTracker",Rp);var oa,Ys=function(t){var i=t.el();if(i.hasAttribute("src"))return t.triggerSourceset(i.src),!0;var r=t.$$("source"),e=[],n="";if(!r.length)return!1;for(var a=0;a<r.length;a++){var s=r[a].src;s&&e.indexOf(s)===-1&&e.push(s)}return!!e.length&&(e.length===1&&(n=e[0]),t.triggerSourceset(n),!0)},Np=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var i=ie().createElement(this.nodeName.toLowerCase());i.innerHTML=t;for(var r=ie().createDocumentFragment();i.childNodes.length;)r.appendChild(i.childNodes[0]);return this.innerText="",O().Element.prototype.appendChild.call(this,r),this.innerHTML}}),Tl=function(t,i){for(var r={},e=0;e<t.length&&!((r=Object.getOwnPropertyDescriptor(t[e],i))&&r.set&&r.get);e++);return r.enumerable=!0,r.configurable=!0,r},Up=function(t){return Tl([t.el(),O().HTMLMediaElement.prototype,O().Element.prototype,Np],"innerHTML")},Sl=function(t){var i=t.el();if(!i.resetSourceWatch_){var r={},e=Up(t),n=function(a){return function(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];var h=a.apply(i,o);return Ys(t),h}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){!i[a]||(r[a]=i[a],i[a]=n(r[a]))}),Object.defineProperty(i,"innerHTML",vt(e,{set:n(e.set)})),i.resetSourceWatch_=function(){i.resetSourceWatch_=null,Object.keys(r).forEach(function(a){i[a]=r[a]}),Object.defineProperty(i,"innerHTML",e)},t.one("sourceset",i.resetSourceWatch_)}},Bp=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Du(O().Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return O().Element.prototype.setAttribute.call(this,"src",t),t}}),jp=function(t){return Tl([t.el(),O().HTMLMediaElement.prototype,Bp],"src")},Fp=function(t){if(t.featuresSourceset){var i=t.el();if(!i.resetSourceset_){var r=jp(t),e=i.setAttribute,n=i.load;Object.defineProperty(i,"src",vt(r,{set:function(a){var s=r.set.call(i,a);return t.triggerSourceset(i.src),s}})),i.setAttribute=function(a,s){var o=e.call(i,a,s);return/src/i.test(a)&&t.triggerSourceset(i.src),o},i.load=function(){var a=n.call(i);return Ys(t)||(t.triggerSourceset(""),Sl(t)),a},i.currentSrc?t.triggerSourceset(i.currentSrc):Ys(t)||Sl(t),i.resetSourceset_=function(){i.resetSourceset_=null,i.load=n,i.setAttribute=e,Object.defineProperty(i,"src",r),i.resetSourceWatch_&&i.resetSourceWatch_()}}}},$s=function(t,i,r,e){e===void 0&&(e=!0);var n=function(s){return Object.defineProperty(t,i,{value:s,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var s=r();return n(s),s}};return e&&(a.set=n),Object.defineProperty(t,i,a)},qe=function(t){function i(e,n){var a;a=t.call(this,e,n)||this;var s=e.source,o=!1;if(a.featuresVideoFrameCallback=a.featuresVideoFrameCallback&&a.el_.tagName==="VIDEO",s&&(a.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?a.setSource(s):a.handleLateInit_(a.el_),e.enableSourceset&&a.setupSourcesetHandling_(),a.isScrubbing_=!1,a.el_.hasChildNodes()){for(var l=a.el_.childNodes,h=l.length,g=[];h--;){var b=l[h];b.nodeName.toLowerCase()==="track"&&(a.featuresNativeTextTracks?(a.remoteTextTrackEls().addTrackElement_(b),a.remoteTextTracks().addTrack(b.track),a.textTracks().addTrack(b.track),!o&&!a.el_.hasAttribute("crossorigin")&&Zi(b.src)&&(o=!0)):g.push(b))}for(var _=0;_<g.length;_++)a.el_.removeChild(g[_])}return a.proxyNativeTracks_(),a.featuresNativeTextTracks&&o&&Je.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. This may prevent text tracks from loading.`),a.restoreMetadataTracksInIOSNativePlayer_(),(Dr||ss||Zo)&&e.nativeControlsForTouch===!0&&a.setControls(!0),a.proxyWebkitFullscreen_(),a.triggerReady(),a}y(i,t);var r=i.prototype;return r.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},r.setupSourcesetHandling_=function(){Fp(this)},r.restoreMetadataTracksInIOSNativePlayer_=function(){var e,n=this.textTracks(),a=function(){e=[];for(var o=0;o<n.length;o++){var l=n[o];l.kind==="metadata"&&e.push({track:l,storedMode:l.mode})}};a(),n.addEventListener("change",a),this.on("dispose",function(){return n.removeEventListener("change",a)});var s=function o(){for(var l=0;l<e.length;l++){var h=e[l];h.track.mode==="disabled"&&h.track.mode!==h.storedMode&&(h.track.mode=h.storedMode)}n.removeEventListener("change",o)};this.on("webkitbeginfullscreen",function(){n.removeEventListener("change",a),n.removeEventListener("change",s),n.addEventListener("change",s)}),this.on("webkitendfullscreen",function(){n.removeEventListener("change",a),n.addEventListener("change",a),n.removeEventListener("change",s)})},r.overrideNative_=function(e,n){var a=this;if(n===this["featuresNative"+e+"Tracks"]){var s=e.toLowerCase();this[s+"TracksListeners_"]&&Object.keys(this[s+"TracksListeners_"]).forEach(function(o){a.el()[s+"Tracks"].removeEventListener(o,a[s+"TracksListeners_"][o])}),this["featuresNative"+e+"Tracks"]=!n,this[s+"TracksListeners_"]=null,this.proxyNativeTracksForType_(s)}},r.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},r.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},r.proxyNativeTracksForType_=function(e){var n=this,a=yn[e],s=this.el()[a.getterName],o=this[a.getterName]();if(this["featuresNative"+a.capitalName+"Tracks"]&&s&&s.addEventListener){var l={change:function(g){var b={type:"change",target:o,currentTarget:o,srcElement:o};o.trigger(b),e==="text"&&n[Hr.remoteText.getterName]().trigger(b)},addtrack:function(g){o.addTrack(g.track)},removetrack:function(g){o.removeTrack(g.track)}},h=function(){for(var g=[],b=0;b<o.length;b++){for(var _=!1,G=0;G<s.length;G++)if(s[G]===o[b]){_=!0;break}_||g.push(o[b])}for(;g.length;)o.removeTrack(g.shift())};this[a.getterName+"Listeners_"]=l,Object.keys(l).forEach(function(g){var b=l[g];s.addEventListener(g,b),n.on("dispose",function(_){return s.removeEventListener(g,b)})}),this.on("loadstart",h),this.on("dispose",function(g){return n.off("loadstart",h)})}},r.proxyNativeTracks_=function(){var e=this;yn.names.forEach(function(n){e.proxyNativeTracksForType_(n)})},r.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),i.disposeMediaElement(e),e=n}else{e=ie().createElement("video");var a=vt({},this.options_.tag&&Kn(this.options_.tag));(!Dr||this.options_.nativeControlsForTouch!==!0)&&delete a.controls,uu(e,Ct(a,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&Rr(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var s=["loop","muted","playsinline","autoplay"],o=0;o<s.length;o++){var l=s[o],h=this.options_[l];h!==void 0&&(h?Rr(e,l,l):Gi(e,l),e[l]=h)}return e},r.handleLateInit_=function(e){if(e.networkState!==0&&e.networkState!==3){if(e.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var s=function(){n||this.trigger("loadstart")};return this.on("loadedmetadata",s),void this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",s),n||this.trigger("loadstart")})}var o=["loadstart"];o.push("loadedmetadata"),e.readyState>=2&&o.push("loadeddata"),e.readyState>=3&&o.push("canplay"),e.readyState>=4&&o.push("canplaythrough"),this.ready(function(){o.forEach(function(l){this.trigger(l)},this)})}},r.setScrubbing=function(e){this.isScrubbing_=e},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Wi?this.el_.fastSeek(e):this.el_.currentTime=e}catch(n){Je(n,"Video is not ready. (Video.js)")}},r.duration=function(){var e=this;if(this.el_.duration===1/0&&Gn&&zn&&this.el_.currentTime===0){var n=function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",n)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=O().navigator&&O().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},r.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Dn(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{e.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},r.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):t.prototype.requestVideoFrameCallback.call(this,e)},r.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):t.prototype.cancelVideoFrameCallback.call(this,e)},r.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},r.reset=function(){i.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(e){this.el_.controls=!!e},r.addTextTrack=function(e,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,a):t.prototype.addTextTrack.call(this,e,n,a)},r.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var n=ie().createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e.default&&(n.default=e.default),e.id&&(n.id=e.id),e.src&&(n.src=e.src),n},r.addRemoteTextTrack=function(e,n){var a=t.prototype.addRemoteTextTrack.call(this,e,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},r.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(e===n[a]||e===n[a].track)&&this.el().removeChild(n[a])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),O().performance&&typeof O().performance.now=="function"?e.creationTime=O().performance.now():O().performance&&O().performance.timing&&typeof O().performance.timing.navigationStart=="number"&&(e.creationTime=O().Date.now()-O().performance.timing.navigationStart),e},i}(ft);$s(qe,"TEST_VID",function(){if(Lr()){var t=ie().createElement("video"),i=ie().createElement("track");return i.kind="captions",i.srclang="en",i.label="English",t.appendChild(i),t}}),qe.isSupported=function(){try{qe.TEST_VID.volume=.5}catch{return!1}return!(!qe.TEST_VID||!qe.TEST_VID.canPlayType)},qe.canPlayType=function(t){return qe.TEST_VID.canPlayType(t)},qe.canPlaySource=function(t,i){return qe.canPlayType(t.type)},qe.canControlVolume=function(){try{var t=qe.TEST_VID.volume;qe.TEST_VID.volume=t/2+.1;var i=t!==qe.TEST_VID.volume;return i&&$t?(O().setTimeout(function(){qe&&qe.prototype&&(qe.prototype.featuresVolumeControl=t!==qe.TEST_VID.volume)}),!1):i}catch{return!1}},qe.canMuteVolume=function(){try{var t=qe.TEST_VID.muted;return qe.TEST_VID.muted=!t,qe.TEST_VID.muted?Rr(qe.TEST_VID,"muted","muted"):Gi(qe.TEST_VID,"muted","muted"),t!==qe.TEST_VID.muted}catch{return!1}},qe.canControlPlaybackRate=function(){if(Gn&&zn&&tu<58)return!1;try{var t=qe.TEST_VID.playbackRate;return qe.TEST_VID.playbackRate=t/2+.1,t!==qe.TEST_VID.playbackRate}catch{return!1}},qe.canOverrideAttributes=function(){try{var t=function(){};Object.defineProperty(ie().createElement("video"),"src",{get:t,set:t}),Object.defineProperty(ie().createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(ie().createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(ie().createElement("audio"),"innerHTML",{get:t,set:t})}catch{return!1}return!0},qe.supportsNativeTextTracks=function(){return Wi||$t&&zn},qe.supportsNativeVideoTracks=function(){return!(!qe.TEST_VID||!qe.TEST_VID.videoTracks)},qe.supportsNativeAudioTracks=function(){return!(!qe.TEST_VID||!qe.TEST_VID.audioTracks)},qe.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(t){var i=t[0],r=t[1];$s(qe.prototype,i,function(){return qe[r]()},!0)}),qe.prototype.featuresVolumeControl=qe.canControlVolume(),qe.prototype.movingMediaElementInDOM=!$t,qe.prototype.featuresFullscreenResize=!0,qe.prototype.featuresProgressEvents=!0,qe.prototype.featuresTimeupdateEvents=!0,qe.prototype.featuresVideoFrameCallback=!(!qe.TEST_VID||!qe.TEST_VID.requestVideoFrameCallback),qe.patchCanPlayType=function(){rs>=4&&!eu&&!zn&&(oa=qe.TEST_VID&&qe.TEST_VID.constructor.prototype.canPlayType,qe.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(t)?"maybe":oa.call(this,t)})},qe.unpatchCanPlayType=function(){var t=qe.TEST_VID.constructor.prototype.canPlayType;return oa&&(qe.TEST_VID.constructor.prototype.canPlayType=oa),t},qe.patchCanPlayType(),qe.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},qe.resetMediaElement=function(t){if(t){for(var i=t.querySelectorAll("source"),r=i.length;r--;)t.removeChild(i[r]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){qe.prototype["set"+xt(t)]=function(i){this.el_[t]=i,i?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){qe.prototype["set"+xt(t)]=function(i){this.el_[t]=i}}),["pause","load","play"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]()}}),ft.withSourceHandlers(qe),qe.nativeSourceHandler={},qe.nativeSourceHandler.canPlayType=function(t){try{return qe.TEST_VID.canPlayType(t)}catch{return""}},qe.nativeSourceHandler.canHandleSource=function(t,i){if(t.type)return qe.nativeSourceHandler.canPlayType(t.type);if(t.src){var r=ks(t.src);return qe.nativeSourceHandler.canPlayType("video/"+r)}return""},qe.nativeSourceHandler.handleSource=function(t,i,r){i.setSrc(t.src)},qe.nativeSourceHandler.dispose=function(){},qe.registerSourceHandler(qe.nativeSourceHandler),ft.registerTech("Html5",qe);var El=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Js={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Zs=["tiny","xsmall","small","medium","large","xlarge","huge"],ua={};Zs.forEach(function(t){var i=t.charAt(0)==="x"?"x-"+t.substring(1):t;ua[t]="vjs-layout-"+i});var qp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ot=function(t){function i(e,n,a){var s;if(e.id=e.id||n.id||"vjs_video_"+Qn(),(n=Ct(i.getTagSettings(e),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if(typeof e.closest=="function"){var o=e.closest("[lang]");o&&o.getAttribute&&(n.language=o.getAttribute("lang"))}else for(var l=e;l&&l.nodeType===1;){if(Kn(l).hasOwnProperty("lang")){n.language=l.getAttribute("lang");break}l=l.parentNode}if((s=t.call(this,null,n,a)||this).boundDocumentFullscreenChange_=function(_){return s.documentFullscreenChange_(_)},s.boundFullWindowOnEscKey_=function(_){return s.fullWindowOnEscKey(_)},s.boundUpdateStyleEl_=function(_){return s.updateStyleEl_(_)},s.boundApplyInitTime_=function(_){return s.applyInitTime_(_)},s.boundUpdateCurrentBreakpoint_=function(_){return s.updateCurrentBreakpoint_(_)},s.boundHandleTechClick_=function(_){return s.handleTechClick_(_)},s.boundHandleTechDoubleClick_=function(_){return s.handleTechDoubleClick_(_)},s.boundHandleTechTouchStart_=function(_){return s.handleTechTouchStart_(_)},s.boundHandleTechTouchMove_=function(_){return s.handleTechTouchMove_(_)},s.boundHandleTechTouchEnd_=function(_){return s.handleTechTouchEnd_(_)},s.boundHandleTechTap_=function(_){return s.handleTechTap_(_)},s.isFullscreen_=!1,s.log=Qo(s.id_),s.fsApi_=Fi,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=e,s.tagAttributes=e&&Kn(e),s.language(s.options_.language),n.languages){var h={};Object.getOwnPropertyNames(n.languages).forEach(function(_){h[_.toLowerCase()]=n.languages[_]}),s.languages_=h}else s.languages_=i.prototype.options_.languages;s.resetCache_(),s.poster_=n.poster||"",s.controls_=!!n.controls,e.controls=!1,e.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],e.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(_){if(typeof s[_]!="function")throw new Error('plugin "'+_+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),gs(w(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(hn(ie(),s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var g=vt(s.options_);n.plugins&&Object.keys(n.plugins).forEach(function(_){s[_](n.plugins[_])}),n.debug&&s.debug(!0),s.options_.playerOptions=g,s.middleware_=[],s.playbackRates(n.playbackRates),s.initChildren(),s.isAudio(e.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),Dr&&s.addClass("vjs-touch-enabled"),$t||s.addClass("vjs-workinghover"),i.players[s.id_]=w(s);var b=Go.split(".")[0];return s.addClass("vjs-v"+b),s.userActive(!0),s.reportUserActivity(),s.one("play",function(_){return s.listenForUserActivity_(_)}),s.on("stageclick",function(_){return s.handleStageClick_(_)}),s.on("keydown",function(_){return s.handleKeyDown(_)}),s.on("languagechange",function(_){return s.handleLanguagechange(_)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}y(i,t);var r=i.prototype;return r.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Xt(ie(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Xt(ie(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),op(this),en.names.forEach(function(n){var a=en[n],s=e[a.getterName]();s&&s.off&&s.off()}),t.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var e,n=this.tag,a=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";a?e=this.el_=n.parentNode:s||(e=this.el_=t.prototype.createEl.call(this,"div"));var o=Kn(n);if(s){for(e=this.el_=n,n=this.tag=ie().createElement("video");e.children.length;)n.appendChild(e.firstChild);fr(e,"video-js")||Xn(e,"video-js"),e.appendChild(n),a=this.playerElIngest_=e,Object.keys(e).forEach(function(G){try{n[G]=e[G]}catch{}})}if(n.setAttribute("tabindex","-1"),o.tabindex="-1",(li||zn&&nu)&&(n.setAttribute("role","application"),o.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(G){s&&G==="class"||e.setAttribute(G,o[G]),s&&n.setAttribute(G,o[G])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=e.player=this,this.addClass("vjs-paused"),O().VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=_u("vjs-styles-dimensions");var l=or(".vjs-styles-defaults"),h=or("head");h.insertBefore(this.styleEl_,l?l.nextSibling:h.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var g=n.getElementsByTagName("a"),b=0;b<g.length;b++){var _=g.item(b);Xn(_,"vjs-hidden"),_.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!a&&n.parentNode.insertBefore(e,n),os(n,e),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e},r.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");e==="anonymous"||e==="use-credentials"?this.techCall_("setCrossOrigin",e):Je.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},r.width=function(e){return this.dimension("width",e)},r.height=function(e){return this.dimension("height",e)},r.dimension=function(e,n){var a=e+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto")return this[a]=void 0,void this.updateStyleEl_();var s=parseFloat(n);isNaN(s)?Je.error('Improper value "'+n+'" supplied for for '+e):(this[a]=s,this.updateStyleEl_())},r.fluid=function(e){var n=this;if(e===void 0)return!!this.fluid_;this.fluid_=!!e,$n(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Dh(this,function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},r.fill=function(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},r.aspectRatio=function(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},r.updateStyleEl_=function(){if(O().VIDEOJS_NO_DYNAMIC_STYLE!==!0){var e,n,a,s=(this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/o:this.videoWidth()||300,n=this.height_!==void 0?this.height_:e*o,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),bu(this.styleEl_,` .`+a+` { width: `+e+`px; height: `+n+`px; } .`+a+`.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: `+100*o+`%; } `)}else{var l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,g=this.tech_&&this.tech_.el();g&&(l>=0&&(g.width=l),h>=0&&(g.height=h))}},r.loadTech_=function(e,n){var a=this;this.tech_&&this.unloadTech_();var s=xt(e),o=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(ft.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);var h={source:n,autoplay:l,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};en.names.forEach(function(b){var _=en[b];h[_.getterName]=a[_.privateName]}),Ct(h,this.options_[s]),Ct(h,this.options_[o]),Ct(h,this.options_[e.toLowerCase()]),this.tag&&(h.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(h.startTime=this.cache_.currentTime);var g=ft.getTech(e);if(!g)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new g(h),this.tech_.ready(gt(this,this.handleTechReady_),!0),Iu.jsonToTextTracks(this.textTracksJson_||[],this.tech_),El.forEach(function(b){a.on(a.tech_,b,function(_){return a["handleTech"+xt(b)+"_"](_)})}),Object.keys(Js).forEach(function(b){a.on(a.tech_,b,function(_){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+Js[b]+"_"].bind(a),event:_}):a["handleTech"+Js[b]+"_"](_)})}),this.on(this.tech_,"loadstart",function(b){return a.handleTechLoadStart_(b)}),this.on(this.tech_,"sourceset",function(b){return a.handleTechSourceset_(b)}),this.on(this.tech_,"waiting",function(b){return a.handleTechWaiting_(b)}),this.on(this.tech_,"ended",function(b){return a.handleTechEnded_(b)}),this.on(this.tech_,"seeking",function(b){return a.handleTechSeeking_(b)}),this.on(this.tech_,"play",function(b){return a.handleTechPlay_(b)}),this.on(this.tech_,"firstplay",function(b){return a.handleTechFirstPlay_(b)}),this.on(this.tech_,"pause",function(b){return a.handleTechPause_(b)}),this.on(this.tech_,"durationchange",function(b){return a.handleTechDurationChange_(b)}),this.on(this.tech_,"fullscreenchange",function(b,_){return a.handleTechFullscreenChange_(b,_)}),this.on(this.tech_,"fullscreenerror",function(b,_){return a.handleTechFullscreenError_(b,_)}),this.on(this.tech_,"enterpictureinpicture",function(b){return a.handleTechEnterPictureInPicture_(b)}),this.on(this.tech_,"leavepictureinpicture",function(b){return a.handleTechLeavePictureInPicture_(b)}),this.on(this.tech_,"error",function(b){return a.handleTechError_(b)}),this.on(this.tech_,"posterchange",function(b){return a.handleTechPosterChange_(b)}),this.on(this.tech_,"textdata",function(b){return a.handleTechTextData_(b)}),this.on(this.tech_,"ratechange",function(b){return a.handleTechRateChange_(b)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&os(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var e=this;en.names.forEach(function(n){var a=en[n];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=Iu.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(e){return e===void 0&&Je.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_},r.addTechControlsListeners_=function(){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_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var n=this;if(this.tech_&&typeof e=="string"){var a,s=function(){var o=n.muted();n.muted(!0);var l=function(){n.muted(o)};n.playTerminatedQueue_.push(l);var h=n.play();if(fi(h))return h.catch(function(g){throw l(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if(e!=="any"||this.muted()?a=e!=="muted"||this.muted()?this.play():s():fi(a=this.play())&&(a=a.catch(s)),fi(a))return a.then(function(){n.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){e===void 0&&(e="");var n=e,a="";typeof n!="string"&&(n=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=cp(this,n)),this.cache_.source=vt({},e,{src:n,type:a});for(var s=this.cache_.sources.filter(function(_){return _.src&&_.src===n}),o=[],l=this.$$("source"),h=[],g=0;g<l.length;g++){var b=Kn(l[g]);o.push(b),b.src&&b.src===n&&h.push(b.src)}h.length&&!s.length?this.cache_.sources=o:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},r.handleTechSourceset_=function(e){var n=this;if(!this.changingSrc_){var a=function(l){return n.updateSourceCaches_(l)},s=this.currentSource().src,o=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(o)&&(!this.lastSource_||this.lastSource_.tech!==o&&this.lastSource_.player!==s)&&(a=function(){}),a(o),e.src||this.tech_.any(["sourceset","loadstart"],function(l){if(l.type!=="sourceset"){var h=n.techGet("currentSrc");n.lastSource_.tech=h,n.updateSourceCaches_(h)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},r.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},r.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},r.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function s(){n!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",s))};this.on("timeupdate",a)},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(Je.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){!this.controls_||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Dn(this.play()):this.pause())},r.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(n){return n.contains(e.target)})||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var n=e.target.player;if(!n||n===this){var a=this.el(),s=ie()[this.fsApi_.fullscreenElement]===a;!s&&a.matches?s=a.matches(":"+this.fsApi_.fullscreen):!s&&a.msMatchesSelector&&(s=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}},r.handleTechFullscreenChange_=function(e,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},r.handleTechFullscreenError_=function(e,n){this.trigger("fullscreenerror",n)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,n){this.ready(function(){if(e in ap)return rp(this.middleware_,this.tech_,e,n);if(e in Fu)return ju(this.middleware_,this.tech_,e,n);try{this.tech_&&this.tech_[e](n)}catch(a){throw Je(a),a}},!0)},r.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in ip)return np(this.middleware_,this.tech_,e);if(e in Fu)return ju(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){throw this.tech_[e]===void 0?(Je("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Je("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Je(n),n)}}},r.play=function(){var e=this,n=this.options_.Promise||O().Promise;return n?new n(function(a){e.play_(a)}):this.play_()},r.play_=function(e){var n=this;e===void 0&&(e=Dn),this.playCallbacks_.push(e);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(o){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&(Wi||$t)&&this.load());var s=this.techGet_("play");s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(n){n()})},r.runPlayCallbacks_=function(e){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||gr(0,0)},r.scrubbing=function(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){return e!==void 0?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=gr(0,0)),e},r.bufferedPercent=function(){return xu(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),n=this.duration(),a=e.end(e.length-1);return a>n&&(a=n),a},r.volume=function(e){var n;return e!==void 0?(n=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=n,this.techCall_("setVolume",n),void(n>0&&this.lastVolume_(n))):(n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n)},r.muted=function(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},r.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(e!==void 0){var n=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},r.requestFullscreen=function(e){var n=this.options_.Promise||O().Promise;if(n){var a=this;return new n(function(s,o){function l(){a.off("fullscreenerror",g),a.off("fullscreenchange",h)}function h(){l(),s()}function g(_,G){l(),o(G)}a.one("fullscreenchange",h),a.one("fullscreenerror",g);var b=a.requestFullscreenHelper_(e);b&&(b.then(l,l),b.then(s,o))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var n,a=this;if(this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(n=e)),this.fsApi_.requestFullscreen){var s=this.el_[this.fsApi_.requestFullscreen](n);return s&&s.then(function(){return a.isFullscreen(!0)},function(){return a.isFullscreen(!1)}),s}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||O().Promise;if(e){var n=this;return new e(function(a,s){function o(){n.off("fullscreenerror",h),n.off("fullscreenchange",l)}function l(){o(),a()}function h(b,_){o(),s(_)}n.one("fullscreenchange",l),n.one("fullscreenerror",h);var g=n.exitFullscreenHelper_();g&&(g.then(o,o),g.then(a,s))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var n=ie()[this.fsApi_.exitFullscreen]();return n&&Dn(n.then(function(){return e.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ie().documentElement.style.overflow,hn(ie(),"keydown",this.boundFullWindowOnEscKey_),ie().documentElement.style.overflow="hidden",Xn(ie().body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){U().isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Xt(ie(),"keydown",this.boundFullWindowOnEscKey_),ie().documentElement.style.overflow=this.docOrigOverflow,ci(ie().body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in ie()&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in ie())return ie().exitPictureInPicture()},r.handleKeyDown=function(e){var n,a,s=this.options_.userActions;s&&s.hotkeys&&(n=this.el_.ownerDocument.activeElement,a=n.tagName.toLowerCase(),n.isContentEditable||(a==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(n.type)===-1:["textarea"].indexOf(a)!==-1)||(typeof s.hotkeys=="function"?s.hotkeys.call(this,e):this.handleHotkeys(e)))},r.handleHotkeys=function(e){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,s=a===void 0?function(_){return U().isEventKey(_,"f")}:a,o=n.muteKey,l=o===void 0?function(_){return U().isEventKey(_,"m")}:o,h=n.playPauseKey,g=h===void 0?function(_){return U().isEventKey(_,"k")||U().isEventKey(_,"Space")}:h;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();var b=Le.getComponent("FullscreenToggle");ie()[this.fsApi_.fullscreenEnabled]!==!1&&b.prototype.handleClick.call(this,e)}else l.call(this,e)?(e.preventDefault(),e.stopPropagation(),Le.getComponent("MuteToggle").prototype.handleClick.call(this,e)):g.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Le.getComponent("PlayToggle").prototype.handleClick.call(this,e))},r.canPlayType=function(e){for(var n,a=0,s=this.options_.techOrder;a<s.length;a++){var o=s[a],l=ft.getTech(o);if(l||(l=Le.getComponent(o)),l){if(l.isSupported()&&(n=l.canPlayType(e)))return n}else Je.error('The "'+o+'" tech is undefined. Skipped browser support check for that tech.')}return""},r.selectSource=function(e){var n=this,a=this.options_.techOrder.map(function(h){return[h,ft.getTech(h)]}).filter(function(h){var g=h[0],b=h[1];return b?b.isSupported():(Je.error('The "'+g+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),s=function(h,g,b){var _;return h.some(function(G){return g.some(function(ne){if(_=b(G,ne))return!0})}),_},o=function(h){return function(g,b){return h(b,g)}},l=function(h,g){var b=h[0];if(h[1].canPlaySource(g,n.options_[b.toLowerCase()]))return{source:g,tech:b}};return(this.options_.sourceOrder?s(e,a,o(l)):s(a,e,l))||!1},r.handleSrc_=function(e,n){var a=this;if(e===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var s=dp(e);if(s.length){if(this.changingSrc_=!0,n||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),ep(this,s[0],function(h,g){if(a.middleware_=g,n||(a.cache_.sources=s),a.updateSourceCaches_(h),a.src_(h))return s.length>1?a.handleSrc_(s.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void a.triggerReady());tp(g,a.tech_)}),this.options_.retryOnError&&s.length>1){var o=function(){a.error(null),a.handleSrc_(s.slice(1),!0)},l=function(){a.off("error",o)};this.one("error",o),this.one("playing",l),this.resetRetryOnError_=function(){a.off("error",o),a.off("playing",l)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var n=this,a=this.selectSource([e]);return!a||(Rh(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1))},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,n=this.options_.Promise||O().Promise;this.paused()||!n?this.doReset_():Dn(this.play().then(function(){return e.doReset_()}))},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),$n(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},n=e.durationDisplay,a=e.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),n=[];return Object.keys(e).length!==0&&n.push(e),this.cache_.sources||n},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},r.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var n;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),n=!1):this.options_.autoplay=!!e,n=n===void 0?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},r.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},r.poster=function(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(e){var n=this;if(e===void 0)return this.error_||null;if(sr("beforeerror").forEach(function(s){var o=s(n,e);Wn(o)&&!Array.isArray(o)||typeof o=="string"||typeof o=="number"||o===null?e=o:n.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(e===null)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Zt(e),this.addClass("vjs-error"),Je.error("(CODE:"+this.error_.code+" "+Zt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),sr("error").forEach(function(s){return s(n,n.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(e===void 0)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,n,a,s=gt(this,this.reportUserActivity),o=function(_){(_.screenX!==n||_.screenY!==a)&&(n=_.screenX,a=_.screenY,s())},l=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},h=function(_){s(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",o),this.on("mouseup",h),this.on("mouseleave",h);var g,b=this.getChild("controlBar");b&&!$t&&!Gn&&(b.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),b.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var _=this.options_.inactivityTimeout;_<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))}},250)},r.playbackRate=function(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},r.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),s=a&&a.currentHeight();n.forEach(function(o){o!==a&&o.el_&&!o.hasClass("vjs-hidden")&&(o.hide(),e.audioOnlyCache_.hiddenChildren.push(o))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var n=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var a=this.options_.Promise||O().Promise;if(a){if(e){var s=[];return this.isInPictureInPicture()&&s.push(this.exitPictureInPicture()),this.isFullscreen()&&s.push(this.exitFullscreen()),this.audioPosterMode()&&s.push(this.audioPosterMode(!1)),a.all(s).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var n=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var a=this.options_.Promise||O().Promise;return a?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.disablePosterModeUI_()}):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},r.addTextTrack=function(e,n,a){if(this.tech_)return this.tech_.addTextTrack(e,n,a)},r.addRemoteTextTrack=function(e,n){if(this.tech_)return this.tech_.addRemoteTextTrack(e,n)},r.removeRemoteTextTrack=function(e){e===void 0&&(e={});var n=e.track;if(n||(n=e),this.tech_)return this.tech_.removeRemoteTextTrack(n)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),$n(this)&&this.trigger("languagechange"))},r.languages=function(){return vt(i.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=vt(this.options_),n=e.tracks;e.tracks=[];for(var a=0;a<n.length;a++){var s=n[a];(s=vt(s)).player=void 0,e.tracks[a]=s}return e},r.createModal=function(e,n){var a=this;(n=n||{}).content=e||"";var s=new jr(this,n);return this.addChild(s),s.on("dispose",function(){a.removeChild(s)}),s.open(),s},r.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<Zs.length;a++){var s=Zs[a];if(n<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(ua[e]),this.addClass(ua[s]),this.breakpoint_=s;break}}},r.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},r.breakpoints=function(e){return e===void 0||(this.breakpoint_="",this.breakpoints_=Ct({},qp,e),this.updateCurrentBreakpoint_()),Ct(this.breakpoints_)},r.responsive=function(e){return e===void 0?this.responsive_:(e=!!e)!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},r.currentBreakpoint=function(){return this.breakpoint_},r.currentBreakpointClass=function(){return ua[this.breakpoint_]||""},r.loadMedia=function(e,n){var a=this;if(e&&typeof e=="object"){this.reset(),this.cache_.media=vt(e);var s=this.cache_.media,o=s.artwork,l=s.poster,h=s.src,g=s.textTracks;!o&&l&&(this.cache_.media.artwork=[{src:l,type:ta(l)}]),h&&this.src(h),l&&this.poster(l),Array.isArray(g)&&g.forEach(function(b){return a.addRemoteTextTrack(b,!1)}),this.ready(n)}},r.getMedia=function(){if(!this.cache_.media){var e=this.poster(),n={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(a){return{kind:a.kind,label:a.label,language:a.language,src:a.src}})};return e&&(n.poster=e,n.artwork=[{src:n.poster,type:ta(n.poster)}]),n}return vt(this.cache_.media)},i.getTagSettings=function(e){var n={sources:[],tracks:[]},a=Kn(e),s=a["data-setup"];if(fr(e,"vjs-fill")&&(a.fill=!0),fr(e,"vjs-fluid")&&(a.fluid=!0),s!==null){var o=I()(s||"{}"),l=o[0],h=o[1];l&&Je.error(l),Ct(a,h)}if(Ct(n,a),e.hasChildNodes())for(var g=e.childNodes,b=0,_=g.length;b<_;b++){var G=g[b],ne=G.nodeName.toLowerCase();ne==="source"?n.sources.push(Kn(G)):ne==="track"&&n.tracks.push(Kn(G))}return n},r.flexNotSupported_=function(){var e=ie().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},r.debug=function(e){if(e===void 0)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)},r.playbackRates=function(e){if(e===void 0)return this.cache_.playbackRates;!Array.isArray(e)||!e.every(function(n){return typeof n=="number"})||(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},i}(Le);en.names.forEach(function(t){var i=en[t];Ot.prototype[i.getterName]=function(){return this.tech_?this.tech_[i.getterName]():(this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName])}}),Ot.prototype.crossorigin=Ot.prototype.crossOrigin,Ot.players={};var yi=O().navigator;Ot.prototype.options_={techOrder:ft.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:yi&&(yi.languages&&yi.languages[0]||yi.userLanguage||yi.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},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){Ot.prototype[t]=function(){return this.techGet_(t)}}),El.forEach(function(t){Ot.prototype["handleTech"+xt(t)+"_"]=function(){return this.trigger(t)}}),Le.registerComponent("Player",Ot);var la="plugin",zr="activePlugins_",Xr={},ca=function(t){return Xr.hasOwnProperty(t)},da=function(t){return ca(t)?Xr[t]:void 0},wl=function(t,i){t[zr]=t[zr]||{},t[zr][i]=!0},ha=function(t,i,r){var e=(r?"before":"")+"pluginsetup";t.trigger(e,i),t.trigger(e+":"+i.name,i)},Hp=function(t,i){var r=function(){ha(this,{name:t,plugin:i,instance:null},!0);var e=i.apply(this,arguments);return wl(this,t),ha(this,{name:t,plugin:i,instance:e}),e};return Object.keys(i).forEach(function(e){r[e]=i[e]}),r},kl=function(t,i){return i.prototype.name=t,function(){ha(this,{name:t,plugin:i,instance:null},!0);for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];var a=J(i,[this].concat(e));return this[t]=function(){return a},ha(this,a.getEventHash()),a}},Ln=function(){function t(r){if(this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=r,this.log||(this.log=this.player.log.createLogger(this.name)),gs(this),delete this.trigger,ku(this,this.constructor.defaultState),wl(r,this.name),this.dispose=this.dispose.bind(this),r.on("dispose",this.dispose)}var i=t.prototype;return i.version=function(){return this.constructor.VERSION},i.getEventHash=function(r){return r===void 0&&(r={}),r.name=this.name,r.plugin=this.constructor,r.instance=this,r},i.trigger=function(r,e){return e===void 0&&(e={}),Ur(this.eventBusEl_,r,this.getEventHash(e))},i.handleStateChanged=function(r){},i.dispose=function(){var r=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[zr][r]=!1,this.player=this.state=null,e[r]=kl(r,Xr[r])},t.isBasic=function(r){var e=typeof r=="string"?da(r):r;return typeof e=="function"&&!t.prototype.isPrototypeOf(e.prototype)},t.registerPlugin=function(r,e){if(typeof r!="string")throw new Error('Illegal plugin name, "'+r+'", must be a string, was '+typeof r+".");if(ca(r))Je.warn('A plugin named "'+r+'" already exists. You may want to avoid re-registering plugins!');else if(Ot.prototype.hasOwnProperty(r))throw new Error('Illegal plugin name, "'+r+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+r+'", must be a function, was '+typeof e+".");return Xr[r]=e,r!==la&&(t.isBasic(e)?Ot.prototype[r]=Hp(r,e):Ot.prototype[r]=kl(r,e)),e},t.deregisterPlugin=function(r){if(r===la)throw new Error("Cannot de-register base plugin.");ca(r)&&(delete Xr[r],delete Ot.prototype[r])},t.getPlugins=function(r){var e;return r===void 0&&(r=Object.keys(Xr)),r.forEach(function(n){var a=da(n);a&&((e=e||{})[n]=a)}),e},t.getPluginVersion=function(r){var e=da(r);return e&&e.VERSION||""},t}();Ln.getPlugin=da,Ln.BASE_PLUGIN_NAME=la,Ln.registerPlugin(la,Ln),Ot.prototype.usingPlugin=function(t){return!!this[zr]&&this[zr][t]===!0},Ot.prototype.hasPlugin=function(t){return!!ca(t)};var Cl=!1,Vp=function(t,i){i===void 0&&(i={}),Cl||(Je.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),Cl=!0);var r=function(){t.apply(this,arguments)},e={};for(var n in typeof i=="object"?(i.constructor!==Object.prototype.constructor&&(r=i.constructor),e=i):typeof i=="function"&&(r=i),C(r,t),t&&(r.super_=t),e)e.hasOwnProperty(n)&&(r.prototype[n]=e[n]);return r},xl=function(t){return t.indexOf("#")===0?t.slice(1):t};function he(t,i,r){var e=he.getPlayer(t);if(e)return i&&Je.warn('Player "'+t+'" is already initialised. Options will not be applied.'),r&&e.ready(r),e;var n=typeof t=="string"?or("#"+xl(t)):t;if(!Mr(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!n.ownerDocument.defaultView||!n.ownerDocument.body.contains(n))&&Je.warn("The element supplied is not included in the DOM"),(i=i||{}).restoreEl===!0&&(i.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),sr("beforesetup").forEach(function(s){var o=s(n,vt(i));Wn(o)&&!Array.isArray(o)?i=vt(i,o):Je.error("please return an object in beforesetup hooks")});var a=Le.getComponent("Player");return e=new a(n,i,r),sr("setup").forEach(function(s){return s(e)}),e}if(he.hooks_=Vn,he.hooks=sr,he.hook=vh,he.hookOnce=yh,he.removeHook=zo,O().VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Lr()){var pa=or(".vjs-styles-defaults");if(!pa){pa=_u("vjs-styles-defaults");var eo=or("head");eo&&eo.insertBefore(pa,eo.firstChild),bu(pa,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}ds(1,he),he.VERSION=Go,he.options=Ot.prototype.options_,he.getPlayers=function(){return Ot.players},he.getPlayer=function(t){var i,r=Ot.players;if(typeof t=="string"){var e=xl(t),n=r[e];if(n)return n;i=or("#"+e)}else i=t;if(Mr(i)){var a=i,s=a.player,o=a.playerId;if(s||r[o])return s||r[o]}},he.getAllPlayers=function(){return Object.keys(Ot.players).map(function(t){return Ot.players[t]}).filter(Boolean)},he.players=Ot.players,he.getComponent=Le.getComponent,he.registerComponent=function(t,i){ft.isTech(i)&&Je.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Le.registerComponent.call(Le,t,i)},he.getTech=ft.getTech,he.registerTech=ft.registerTech,he.use=Zh,Object.defineProperty(he,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(he.middleware,"TERMINATOR",{value:ea,writeable:!1,enumerable:!0}),he.browser=wh,he.TOUCH_ENABLED=Dr,he.extend=Vp,he.mergeOptions=vt,he.bind=gt,he.registerPlugin=Ln.registerPlugin,he.deregisterPlugin=Ln.deregisterPlugin,he.plugin=function(t,i){return Je.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ln.registerPlugin(t,i)},he.getPlugins=Ln.getPlugins,he.getPlugin=Ln.getPlugin,he.getPluginVersion=Ln.getPluginVersion,he.addLanguage=function(t,i){var r;return t=(""+t).toLowerCase(),he.options.languages=vt(he.options.languages,((r={})[t]=i,r)),he.options.languages[t]},he.log=Je,he.createLogger=Qo,he.createTimeRange=he.createTimeRanges=gr,he.formatTime=Vr,he.setFormatTime=yp,he.resetFormatTime=_p,he.parseUrl=ws,he.isCrossOrigin=Zi,he.EventTarget=Ft,he.on=hn,he.one=Qi,he.off=Xt,he.trigger=Ur,he.xhr=M(),he.TextTrack=mi,he.AudioTrack=Ru,he.VideoTrack=Nu,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){he[t]=function(){return Je.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),gu[t].apply(null,arguments)}}),he.computedStyle=oi,he.dom=gu,he.url=Qh,he.defineLazyProperty=$s,he.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.0 @license Apache-2.0 */var wn=D,fa=function(t,i,r){return t&&r&&r.responseURL&&i!==r.responseURL?r.responseURL:i},kn=function(t){return he.log.debug?he.log.debug.bind(he,"VHS:",t+" >"):function(){}},ur=1/30,Mn=3*ur,Il=function(t,i){var r,e=[];if(t&&t.length)for(r=0;r<t.length;r++)i(t.start(r),t.end(r))&&e.push([t.start(r),t.end(r)]);return he.createTimeRanges(e)},Kr=function(t,i){return Il(t,function(r,e){return r-Mn<=i&&e+Mn>=i})},ma=function(t,i){return Il(t,function(r){return r-ur>=i})},Wp=function(t){if(t.length<2)return he.createTimeRanges();for(var i=[],r=1;r<t.length;r++){var e=t.end(r-1),n=t.start(r);i.push([e,n])}return he.createTimeRanges(i)},Gp=function(t,i){var r=null,e=null,n=0,a=[],s=[];if(!(t&&t.length&&i&&i.length))return he.createTimeRange();for(var o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(o=i.length;o--;)a.push({time:i.start(o),type:"start"}),a.push({time:i.end(o),type:"end"});for(a.sort(function(l,h){return l.time-h.time}),o=0;o<a.length;o++)a[o].type==="start"?++n==2&&(r=a[o].time):a[o].type==="end"&&--n==1&&(e=a[o].time),r!==null&&e!==null&&(s.push([r,e]),r=null,e=null);return he.createTimeRanges(s)},Al=function(t){var i=[];if(!t||!t.length)return"";for(var r=0;r<t.length;r++)i.push(t.start(r)+" => "+t.end(r));return i.join(", ")},zp=function(t,i,r){return r===void 0&&(r=1),((t.length?t.end(t.length-1):0)-i)/r},br=function(t){for(var i=[],r=0;r<t.length;r++)i.push({start:t.start(r),end:t.end(r)});return i},Xp=function(t,i){if(t===i)return!1;if(!t&&i||!i&&t||t.length!==i.length)return!0;for(var r=0;r<t.length;r++)if(t.start(r)!==i.start(r)||t.end(r)!==i.end(r))return!0;return!1},Pl=function(t){if(t&&t.length&&t.end)return t.end(t.length-1)},to=function(t,i){var r=0;if(!t||!t.length)return r;for(var e=0;e<t.length;e++){var n=t.start(e),a=t.end(e);if(!(i>a)){if(i>n&&i<=a){r+=a-i;continue}r+=a-n}}return r},Ol=he.createTimeRange,no=function(t,i){if(!i.preload)return i.duration;var r=0;return(i.parts||[]).forEach(function(e){r+=e.duration}),(i.preloadHints||[]).forEach(function(e){e.type==="PART"&&(r+=t.partTargetDuration)}),r},ro=function(t){return(t.segments||[]).reduce(function(i,r,e){return r.parts?r.parts.forEach(function(n,a){i.push({duration:n.duration,segmentIndex:e,partIndex:a,part:n,segment:r})}):i.push({duration:r.duration,segmentIndex:e,partIndex:null,segment:r,part:null}),i},[])},Dl=function(t){var i=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return i&&i.parts||[]},Ll=function(t){var i=t.preloadSegment;if(i){var r=i.parts,e=(i.preloadHints||[]).reduce(function(n,a){return n+(a.type==="PART"?1:0)},0);return e+=r&&r.length?r.length:0}},Ml=function(t,i){if(i.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var r=Dl(i).length>0;return r&&i.serverControl&&i.serverControl.partHoldBack?i.serverControl.partHoldBack:r&&i.partTargetDuration?3*i.partTargetDuration:i.serverControl&&i.serverControl.holdBack?i.serverControl.holdBack:i.targetDuration?3*i.targetDuration:0},Kp=function(t,i){var r=0,e=i-t.mediaSequence,n=t.segments[e];if(n){if(n.start!==void 0)return{result:n.start,precise:!0};if(n.end!==void 0)return{result:n.end-n.duration,precise:!0}}for(;e--;){if((n=t.segments[e]).end!==void 0)return{result:r+n.end,precise:!0};if(r+=no(t,n),n.start!==void 0)return{result:r+n.start,precise:!0}}return{result:r,precise:!1}},Qp=function(t,i){for(var r,e=0,n=i-t.mediaSequence;n<t.segments.length;n++){if((r=t.segments[n]).start!==void 0)return{result:r.start-e,precise:!0};if(e+=no(t,r),r.end!==void 0)return{result:r.end-e,precise:!0}}return{result:-1,precise:!1}},Rl=function(t,i,r){if(i===void 0&&(i=t.mediaSequence+t.segments.length),i<t.mediaSequence)return 0;var e=Kp(t,i);if(e.precise)return e.result;var n=Qp(t,i);return n.precise?n.result:e.result+r},Nl=function(t,i,r){if(!t)return 0;if(typeof r!="number"&&(r=0),i===void 0){if(t.totalDuration)return t.totalDuration;if(!t.endList)return O()[1/0]}return Rl(t,i,r)},_i=function(t){var i=t.defaultDuration,r=t.durationList,e=t.startIndex,n=t.endIndex,a=0;if(e>n){var s=[n,e];e=s[0],n=s[1]}if(e<0){for(var o=e;o<Math.min(0,n);o++)a+=i;e=0}for(var l=e;l<n;l++)a+=r[l].duration;return a},Ul=function(t,i,r,e){if(!t||!t.segments)return null;if(t.endList)return Nl(t);if(i===null)return null;i=i||0;var n=Rl(t,t.mediaSequence+t.segments.length,i);return r&&(n-=e=typeof e=="number"?e:Ml(null,t)),Math.max(0,n)},Yp=function(t,i,r){var e=i||0,n=Ul(t,i,!0,r);return n===null?Ol():Ol(e,n)},$p=function(t){for(var i=t.playlist,r=t.currentTime,e=t.startingSegmentIndex,n=t.startingPartIndex,a=t.startTime,s=t.experimentalExactManifestTimings,o=r-a,l=ro(i),h=0,g=0;g<l.length;g++){var b=l[g];if(e===b.segmentIndex&&(typeof n!="number"||typeof b.partIndex!="number"||n===b.partIndex)){h=g;break}}if(o<0){if(h>0)for(var _=h-1;_>=0;_--){var G=l[_];if(o+=G.duration,s){if(o<0)continue}else if(o+ur<=0)continue;return{partIndex:G.partIndex,segmentIndex:G.segmentIndex,startTime:a-_i({defaultDuration:i.targetDuration,durationList:l,startIndex:h,endIndex:_})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:r}}if(h<0){for(var ne=h;ne<0;ne++)if((o-=i.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:r};h=0}for(var ye=h;ye<l.length;ye++){var re=l[ye];if(o-=re.duration,s){if(o>0)continue}else if(o-ur>=0)continue;return{partIndex:re.partIndex,segmentIndex:re.segmentIndex,startTime:a+_i({defaultDuration:i.targetDuration,durationList:l,startIndex:h,endIndex:ye})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:r}},Bl=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},io=function(t){return t.excludeUntil&&t.excludeUntil===1/0},ga=function(t){var i=Bl(t);return!t.disabled&&!i},Jp=function(t){return t.disabled},Zp=function(t){for(var i=0;i<t.segments.length;i++)if(t.segments[i].key)return!0;return!1},jl=function(t,i){return i.attributes&&i.attributes[t]},ef=function(t,i,r,e){return e===void 0&&(e=0),jl("BANDWIDTH",r)?(t*r.attributes.BANDWIDTH-8*e)/i:NaN},ao=function(t,i){if(t.playlists.length===1)return!0;var r=i.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){return!!ga(e)&&(e.attributes.BANDWIDTH||0)<r}).length===0},so=function(t,i){return!(!t&&!i||!t&&i||t&&!i||!(t===i||t.id&&i.id&&t.id===i.id||t.resolvedUri&&i.resolvedUri&&t.resolvedUri===i.resolvedUri||t.uri&&i.uri&&t.uri===i.uri))},Fl=function(t,i){var r=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{},e=!1;for(var n in r){for(var a in r[n])if(e=i(r[n][a]))break;if(e)break}return!!e},bi=function(t){if(!t||!t.playlists||!t.playlists.length)return Fl(t,function(n){return n.playlists&&n.playlists.length||n.uri});for(var i=function(n){var a=t.playlists[n],s=a.attributes&&a.attributes.CODECS;return s&&s.split(",").every(function(o){return Pe(o)})||Fl(t,function(o){return so(a,o)})?"continue":{v:!1}},r=0;r<t.playlists.length;r++){var e=i(r);if(e!=="continue"&&typeof e=="object")return e.v}return!0},sn={liveEdgeDelay:Ml,duration:Nl,seekable:Yp,getMediaInfoForTime:$p,isEnabled:ga,isDisabled:Jp,isBlacklisted:Bl,isIncompatible:io,playlistEnd:Ul,isAes:Zp,hasAttribute:jl,estimateSegmentRequestTime:ef,isLowestEnabledRendition:ao,isAudioOnly:bi,playlistMatch:so,segmentDurationWithParts:no},ql=he.log,oo=function(t,i){return t+"-"+i},tf=function(t){var i=t.onwarn,r=t.oninfo,e=t.manifestString,n=t.customTagParsers,a=n===void 0?[]:n,s=t.customTagMappers,o=s===void 0?[]:s,l=t.experimentalLLHLS,h=new xe;i&&h.on("warn",i),r&&h.on("info",r),a.forEach(function(ne){return h.addParser(ne)}),o.forEach(function(ne){return h.addTagMapper(ne)}),h.push(e),h.end();var g=h.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(ne){g.hasOwnProperty(ne)&&delete g[ne]}),g.segments&&g.segments.forEach(function(ne){["parts","preloadHints"].forEach(function(ye){ne.hasOwnProperty(ye)&&delete ne[ye]})})),!g.targetDuration){var b=10;g.segments&&g.segments.length&&(b=g.segments.reduce(function(ne,ye){return Math.max(ne,ye.duration)},0)),i&&i("manifest has no targetDuration defaulting to "+b),g.targetDuration=b}var _=Dl(g);if(_.length&&!g.partTargetDuration){var G=_.reduce(function(ne,ye){return Math.max(ne,ye.duration)},0);i&&(i("manifest has no partTargetDuration defaulting to "+G),ql.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.")),g.partTargetDuration=G}return g},Ti=function(t,i){!t.mediaGroups||["AUDIO","SUBTITLES"].forEach(function(r){if(t.mediaGroups[r])for(var e in t.mediaGroups[r])for(var n in t.mediaGroups[r][e]){var a=t.mediaGroups[r][e][n];i(a,r,e,n)}})},Hl=function(t){var i=t.playlist,r=t.uri,e=t.id;i.id=e,i.playlistErrors_=0,r&&(i.uri=r),i.attributes=i.attributes||{}},nf=function(t){for(var i=t.playlists.length;i--;){var r=t.playlists[i];Hl({playlist:r,id:oo(i,r.uri)}),r.resolvedUri=wn(t.uri,r.uri),t.playlists[r.id]=r,t.playlists[r.uri]=r,r.attributes.BANDWIDTH||ql.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},rf=function(t){Ti(t,function(i){i.uri&&(i.resolvedUri=wn(t.uri,i.uri))})},af=function(t,i){var r=oo(0,i),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:O().location.href,resolvedUri:O().location.href,playlists:[{uri:i,id:r,resolvedUri:i,attributes:{}}]};return e.playlists[r]=e.playlists[0],e.playlists[i]=e.playlists[0],e},Vl=function(t,i){t.uri=i;for(var r=0;r<t.playlists.length;r++)if(!t.playlists[r].uri){var e="placeholder-uri-"+r;t.playlists[r].uri=e}var n=bi(t);Ti(t,function(a,s,o,l){var h="placeholder-uri-"+s+"-"+o+"-"+l;if(!a.playlists||!a.playlists.length){if(n&&s==="AUDIO"&&!a.uri)for(var g=0;g<t.playlists.length;g++){var b=t.playlists[g];if(b.attributes&&b.attributes.AUDIO&&b.attributes.AUDIO===o)return}a.playlists=[we({},a)]}a.playlists.forEach(function(_,G){var ne=oo(G,h);_.uri?_.resolvedUri=_.resolvedUri||wn(t.uri,_.uri):(_.uri=G===0?h:ne,_.resolvedUri=_.uri),_.id=_.id||ne,_.attributes=_.attributes||{},t.playlists[_.id]=_,t.playlists[_.uri]=_})}),nf(t),rf(t)},va=he.mergeOptions,sf=he.EventTarget,of=function(t,i){if(i.endList||!i.serverControl)return t;var r={};if(i.serverControl.canBlockReload){var e=i.preloadSegment,n=i.mediaSequence+i.segments.length;if(e){var a=e.parts||[],s=Ll(i)-1;s>-1&&s!==a.length-1&&(r._HLS_part=s),(s>-1||a.length)&&n--}r._HLS_msn=n}if(i.serverControl&&i.serverControl.canSkipUntil&&(r._HLS_skip=i.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var o=new(O()).URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){!r.hasOwnProperty(l)||o.searchParams.set(l,r[l])}),t=o.toString()}return t},uf=function(t,i){if(!t)return i;var r=va(t,i);if(t.preloadHints&&!i.preloadHints&&delete r.preloadHints,t.parts&&!i.parts)delete r.parts;else if(t.parts&&i.parts)for(var e=0;e<i.parts.length;e++)t.parts&&t.parts[e]&&(r.parts[e]=va(t.parts[e],i.parts[e]));return!t.skipped&&i.skipped&&(r.skipped=!1),t.preload&&!i.preload&&(r.preload=!1),r},lf=function(t,i,r){var e=t.slice(),n=i.slice();r=r||0;for(var a,s=[],o=0;o<n.length;o++){var l=e[o+r],h=n[o];l?(a=l.map||a,s.push(uf(l,h))):(a&&!h.map&&(h.map=a),s.push(h))}return s},Wl=function(t,i){!t.resolvedUri&&t.uri&&(t.resolvedUri=wn(i,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=wn(i,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=wn(i,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=wn(i,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(function(r){r.resolvedUri||(r.resolvedUri=wn(i,r.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(function(r){r.resolvedUri||(r.resolvedUri=wn(i,r.uri))})},Gl=function(t){var i=t.segments||[],r=t.preloadSegment;if(r&&r.parts&&r.parts.length){if(r.preloadHints){for(var e=0;e<r.preloadHints.length;e++)if(r.preloadHints[e].type==="MAP")return i}r.duration=t.targetDuration,r.preload=!0,i.push(r)}return i},zl=function(t,i){return t===i||t.segments&&i.segments&&t.segments.length===i.segments.length&&t.endList===i.endList&&t.mediaSequence===i.mediaSequence&&t.preloadSegment===i.preloadSegment},uo=function(t,i,r){r===void 0&&(r=zl);var e=va(t,{}),n=e.playlists[i.id];if(!n||r(n,i))return null;i.segments=Gl(i);var a=va(n,i);if(a.preloadSegment&&!i.preloadSegment&&delete a.preloadSegment,n.segments){if(i.skip){i.segments=i.segments||[];for(var s=0;s<i.skip.skippedSegments;s++)i.segments.unshift({skipped:!0})}a.segments=lf(n.segments,i.segments,i.mediaSequence-n.mediaSequence)}a.segments.forEach(function(l){Wl(l,a.resolvedUri)});for(var o=0;o<e.playlists.length;o++)e.playlists[o].id===i.id&&(e.playlists[o]=a);return e.playlists[i.id]=a,e.playlists[i.uri]=a,Ti(t,function(l,h,g,b){if(l.playlists)for(var _=0;_<l.playlists.length;_++)i.id===l.playlists[_].id&&(l.playlists[_]=a)}),e},lo=function(t,i){var r=t.segments||[],e=r[r.length-1],n=e&&e.parts&&e.parts[e.parts.length-1],a=n&&n.duration||e&&e.duration;return i&&a?1e3*a:500*(t.partTargetDuration||t.targetDuration||10)},Qr=function(t){function i(e,n,a){var s;if(a===void 0&&(a={}),s=t.call(this)||this,!e)throw new Error("A non-empty playlist URL or object is required");s.logger_=kn("PlaylistLoader");var o=a,l=o.withCredentials,h=l!==void 0&&l,g=o.handleManifestRedirects,b=g!==void 0&&g;s.src=e,s.vhs_=n,s.withCredentials=h,s.handleManifestRedirects=b;var _=n.options_;return s.customTagParsers=_&&_.customTagParsers||[],s.customTagMappers=_&&_.customTagMappers||[],s.experimentalLLHLS=_&&_.experimentalLLHLS||!1,he.browser.IE_VERSION&&(s.experimentalLLHLS=!1),s.state="HAVE_NOTHING",s.handleMediaupdatetimeout_=s.handleMediaupdatetimeout_.bind(w(s)),s.on("mediaupdatetimeout",s.handleMediaupdatetimeout_),s}y(i,t);var r=i.prototype;return r.handleMediaupdatetimeout_=function(){var e=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=wn(this.master.uri,n.uri);this.experimentalLLHLS&&(a=of(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(s,o){if(e.request){if(s)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},r.playlistRequestError=function(e,n,a){var s=n.uri,o=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[o],status:e.status,message:"HLS playlist request error at URL: "+s+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},r.parseManifest_=function(e){var n=this,a=e.url,s=e.manifestString;return tf({onwarn:function(o){var l=o.message;return n.logger_("m3u8-parser warn for "+a+": "+l)},oninfo:function(o){var l=o.message;return n.logger_("m3u8-parser info for "+a+": "+l)},manifestString:s,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(e){var n=e.playlistString,a=e.playlistObject,s=e.url,o=e.id;this.request=null,this.state="HAVE_METADATA";var l=a||this.parseManifest_({url:s,manifestString:n});l.lastRequest=Date.now(),Hl({playlist:l,uri:s,id:o});var h=uo(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,h?(this.master=h,this.media_=this.master.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(lo(this.media(),!!h)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),O().clearTimeout(this.mediaUpdateTimeout),O().clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e,n){var a=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(O().clearTimeout(this.finalRenditionTimeout),n){var s=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=O().setTimeout(this.media.bind(this,e,!1),s)}else{var o=this.state,l=!this.media_||e.id!==this.media_.id,h=this.master.playlists[e.id];if(h&&h.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(l&&(this.trigger("mediachanging"),o==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(lo(e,!0)),l){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(g,b){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=fa(a.handleManifestRedirects,e.resolvedUri,b),g)return a.playlistRequestError(a.request,e,o);a.haveMetadata({playlistString:b.responseText,url:e.uri,id:e.id}),o==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}}},r.pause=function(){this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(e){var n=this;this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var s=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=O().setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},s)}else this.started?a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},r.updateMediaUpdateTimeout_=function(e){var n=this;this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=O().setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(e)},e))},r.start=function(){var e=this;if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=O().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(e.request){if(e.request=null,n)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=fa(e.handleManifestRedirects,e.src,a);var s=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(s)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Vl(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Gl(a),a.segments.forEach(function(s){Wl(s,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var n=this.srcUri()||O().location.href;this.master=af(e,n),this.haveMetadata({playlistObject:e,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},i}(sf),cf=he.xhr,df=he.mergeOptions,co=function(t,i,r,e){var n=t.responseType==="arraybuffer"?t.response:t.responseText;!i&&n&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=n.byteLength||n.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),r.headers&&(t.responseHeaders=r.headers),i&&i.code==="ETIMEDOUT"&&(t.timedout=!0),!i&&!t.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(i=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))),e(i,t)},Xl=function(){var t=function i(r,e){r=df({timeout:45e3},r);var n=i.beforeRequest||he.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var s=(he.Vhs.xhr.original===!0?cf:he.Vhs.xhr)(r,function(l,h){return co(s,l,h,e)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=r.uri,s.requestTime=Date.now(),s};return t.original=!0,t},hf=function(t){return"bytes="+t.offset+"-"+(typeof t.offset=="bigint"||typeof t.length=="bigint"?O().BigInt(t.offset)+O().BigInt(t.length)-O().BigInt(1):t.offset+t.length-1)},ho=function(t){var i={};return t.byterange&&(i.Range=hf(t.byterange)),i},pf=function(t,i){return t.start(i)+"-"+t.end(i)},ff=function(t,i){var r=t.toString(16);return"00".substring(0,2-r.length)+r+(i%2?" ":"")},mf=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Kl=function(t){var i={};return Object.keys(t).forEach(function(r){var e=t[r];pt(e)?i[r]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:i[r]=e}),i},ya=function(t){var i=t.byterange||{length:1/0,offset:0};return[i.length,i.offset,t.resolvedUri].join(",")},Ql=function(t){return t.resolvedUri},Yl=function(t){for(var i=Array.prototype.slice.call(t),r=16,e="",n=0;n<i.length/r;n++)e+=i.slice(n*r,n*r+r).map(ff).join("")+" "+i.slice(n*r,n*r+r).map(mf).join("")+` `;return e},gf=function(t){var i=t.bytes;return Yl(i)},vf=function(t){var i,r="";for(i=0;i<t.length;i++)r+=pf(t,i)+" ";return r},yf=Object.freeze({__proto__:null,createTransferableMessage:Kl,initSegmentId:ya,segmentKeyId:Ql,hexDump:Yl,tagDump:gf,textRanges:vf}),$l=.25,_f=function(t,i){if(!i.dateTimeObject)return null;var r=i.videoTimingInfo.transmuxerPrependedSeconds,e=t-(i.videoTimingInfo.transmuxedPresentationStart+r);return new Date(i.dateTimeObject.getTime()+1e3*e)},bf=function(t){return t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds},Tf=function(t,i){var r;try{r=new Date(t)}catch{return null}if(!i||!i.segments||i.segments.length===0)return null;var e=i.segments[0];if(r<e.dateTimeObject)return null;for(var n=0;n<i.segments.length-1&&(e=i.segments[n],!(r<i.segments[n+1].dateTimeObject));n++);var a=i.segments[i.segments.length-1],s=a.dateTimeObject,o=a.videoTimingInfo?bf(a.videoTimingInfo):a.duration+a.duration*$l;return r>new Date(s.getTime()+1e3*o)?null:(r>s&&(e=a),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:sn.duration(i,i.mediaSequence+i.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},Sf=function(t,i){if(!i||!i.segments||i.segments.length===0)return null;for(var r,e=0,n=0;n<i.segments.length&&!(t<=(e=(r=i.segments[n]).videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:e+r.duration));n++);var a=i.segments[i.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<t)return null;if(t>e){if(t>e+a.duration*$l)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:e-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},Ef=function(t,i){var r,e;try{r=new Date(t),e=new Date(i)}catch{}var n=r.getTime();return(e.getTime()-n)/1e3},wf=function(t){if(!t.segments||t.segments.length===0)return!1;for(var i=0;i<t.segments.length;i++)if(!t.segments[i].dateTimeObject)return!1;return!0},kf=function(t){var i=t.playlist,r=t.time,e=r===void 0?void 0:r,n=t.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=Sf(e,i);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:e},o=_f(e,a.segment);return o&&(s.programDateTime=o.toISOString()),n(null,s)},Cf=function t(i){var r=i.programTime,e=i.playlist,n=i.retryCount,a=n===void 0?2:n,s=i.seekTo,o=i.pauseAfterSeek,l=o===void 0||o,h=i.tech,g=i.callback;if(!g)throw new Error("seekToProgramTime: callback must be provided");if(r===void 0||!e||!s)return g({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!h.hasStarted_)return g({message:"player must be playing a live stream to start buffering"});if(!wf(e))return g({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});var b=Tf(r,e);if(!b)return g({message:r+" was not found in the stream"});var _=b.segment,G=Ef(_.dateTimeObject,r);if(b.type==="estimate")return a===0?g({message:r+" is not buffered yet. Try again"}):(s(b.estimatedStart+G),void h.one("seeked",function(){t({programTime:r,playlist:e,retryCount:a-1,seekTo:s,pauseAfterSeek:l,tech:h,callback:g})}));var ne=_.start+G,ye=function(){return g(null,h.currentTime())};h.one("seeked",ye),l&&h.pause(),s(ne)},Jl=function(t,i){if(t.readyState===4)return i()},xf=function(t,i,r){var e,n=[],a=!1,s=function(h,g,b,_){return g.abort(),a=!0,r(h,g,b,_)},o=function(h,g){if(!a){if(h)return s(h,g,"",n);var b=g.responseText.substring(n&&n.byteLength||0,g.responseText.length);if(n=rr(n,jn(b,!0)),e=e||ii(n),n.length<10||e&&n.length<e+2)return Jl(g,function(){return s(h,g,"",n)});var _=ts(n);return _==="ts"&&n.length<188||!_&&n.length<376?Jl(g,function(){return s(h,g,"",n)}):s(null,g,_,n)}},l=i({uri:t,beforeSend:function(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function(g){return g.total,g.loaded,co(h,null,{statusCode:h.status},o)})}},function(h,g){return co(l,h,g,o)});return l},If=he.EventTarget,Zl=he.mergeOptions,ec=function(t,i){if(!zl(t,i)||t.sidx&&i.sidx&&(t.sidx.offset!==i.sidx.offset||t.sidx.length!==i.sidx.length)||!t.sidx&&i.sidx||t.sidx&&!i.sidx||t.segments&&!i.segments||!t.segments&&i.segments)return!1;if(!t.segments&&!i.segments)return!0;for(var r=0;r<t.segments.length;r++){var e=t.segments[r],n=i.segments[r];if(e.uri!==n.uri)return!1;if(e.byterange||n.byterange){var a=e.byterange,s=n.byterange;if(a&&!s||!a&&s||a.offset!==s.offset||a.length!==s.length)return!1}}return!0},Af=function(t){var i=t.masterXml,r=t.srcUrl,e=t.clientOffset,n=t.sidxMapping,a=t.previousManifest,s=$d(i,{manifestUri:r,clientOffset:e,sidxMapping:n,previousManifest:a});return Vl(s,r),s},Pf=function(t,i,r){for(var e=!0,n=Zl(t,{duration:i.duration,minimumUpdatePeriod:i.minimumUpdatePeriod,timelineStarts:i.timelineStarts}),a=0;a<i.playlists.length;a++){var s=i.playlists[a];if(s.sidx){var o=Pn(s.sidx);r&&r[o]&&r[o].sidx&&Mt(s,r[o].sidx,s.sidx.resolvedUri)}var l=uo(n,s,ec);l&&(n=l,e=!1)}return Ti(i,function(h,g,b,_){if(h.playlists&&h.playlists.length){var G=h.playlists[0].id,ne=uo(n,h.playlists[0],ec);ne&&((n=ne).mediaGroups[g][b][_].playlists[0]=n.playlists[G],e=!1)}}),i.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(e=!1),e?null:n},Of=function(t,i){return(!t.map&&!i.map||!!(t.map&&i.map&&t.map.byterange.offset===i.map.byterange.offset&&t.map.byterange.length===i.map.byterange.length))&&t.uri===i.uri&&t.byterange.offset===i.byterange.offset&&t.byterange.length===i.byterange.length},tc=function(t,i){var r={};for(var e in t){var n=t[e].sidx;if(n){var a=Pn(n);if(!i[a])break;var s=i[a].sidxInfo;Of(s,n)&&(r[a]=i[a])}}return r},Df=function(t,i){var r=tc(t.playlists,i);return Ti(t,function(e,n,a,s){if(e.playlists&&e.playlists.length){var o=e.playlists;r=Zl(r,tc(o,i))}}),r},po=function(t){function i(e,n,a,s){var o;a===void 0&&(a={}),(o=t.call(this)||this).masterPlaylistLoader_=s||w(o),s||(o.isMaster_=!0);var l=a,h=l.withCredentials,g=h!==void 0&&h,b=l.handleManifestRedirects,_=b!==void 0&&b;if(o.vhs_=n,o.withCredentials=g,o.handleManifestRedirects=_,!e)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=kn("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=e,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=e,o}y(i,t);var r=i.prototype;return r.requestErrored_=function(e,n,a){return!this.request||(this.request=null,e?(this.error=typeof e!="object"||e instanceof Error?{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2}:e,a&&(this.state=a),this.trigger("error"),!0):void 0)},r.addSidxSegments_=function(e,n,a){var s=this,o=e.sidx&&Pn(e.sidx);if(e.sidx&&o&&!this.masterPlaylistLoader_.sidxMapping_[o]){var l=fa(this.handleManifestRedirects,e.sidx.resolvedUri),h=function(g,b){if(!s.requestErrored_(g,b,n)){var _,G=s.masterPlaylistLoader_.sidxMapping_;try{_=eh()(Xe(b.response).subarray(8))}catch(ne){return void s.requestErrored_(ne,b,n)}return G[o]={sidxInfo:e.sidx,sidx:_},Mt(e,_,e.sidx.resolvedUri),a(!0)}};this.request=xf(l,this.vhs_.xhr,function(g,b,_,G){if(g)return h(g,b);if(!_||_!=="mp4")return h({status:b.status,message:"Unsupported "+(_||"unknown")+" container type for sidx segment at URL: "+l,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},b);var ne=e.sidx.byterange,ye=ne.offset,re=ne.length;if(G.length>=re+ye)return h(g,{response:G.subarray(ye,ye+re),status:b.status,uri:b.uri});s.request=s.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:ho({byterange:e.sidx.byterange})},h)})}else this.mediaRequest_=O().setTimeout(function(){return a(!1)},0)},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},O().clearTimeout(this.minimumUpdatePeriodTimeout_),O().clearTimeout(this.mediaRequest_),O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e){var n=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof e=="string"){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),this.trigger("mediachange")));!s||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(o){n.haveMetadata({startingState:a,playlist:e})}))},r.haveMetadata=function(e){var n=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},r.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(O().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(e){var n=this;O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var s=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=O().setTimeout(function(){return n.load()},s)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},r.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(n,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=O().setTimeout(function(){return e.haveMaster_()},0)},r.requestMaster_=function(e){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,s){if(!n.requestErrored_(a,s)){var o=s.responseText!==n.masterPlaylistLoader_.masterXml_;return n.masterPlaylistLoader_.masterXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?n.masterLoaded_=Date.parse(s.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=fa(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,s),o?(n.handleMaster_(),void n.syncClientServerClock_(function(){return e(s,o)})):e(s,o)}n.state==="HAVE_NOTHING"&&(n.started=!1)})},r.syncClientServerClock_=function(e){var n=this,a=Jd(this.masterPlaylistLoader_.masterXml_);return a===null?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):a.method==="DIRECT"?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:wn(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(s,o){if(n.request){if(s)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),e();var l;l=a.method==="HEAD"?o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):n.masterLoaded_:Date.parse(o.responseText),n.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}}))},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,n=Af({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(n=Pf(e,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||e;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},r.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(O().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var n=e.master&&e.master.minimumUpdatePeriod;n===0&&(e.media()?n=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof n!="number"||n<=0?n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout"):this.createMUPTimeout_(n)},r.createMUPTimeout_=function(e){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=O().setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(e)},e)},r.refreshXml_=function(){var e=this;this.requestMaster_(function(n,a){!a||(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=Df(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(s){e.refreshMedia_(e.media().id)}))})},r.refreshMedia_=function(e){var n=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,s=!this.media_||this.media_!==a[e];s?this.media_=a[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function o(){n.media().endList||(n.mediaUpdateTimeout=O().setTimeout(function(){n.trigger("mediaupdatetimeout"),o()},lo(n.media(),!!s)))}(),this.trigger("loadedplaylist")},i}(If),qt={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},Lf=function(t){for(var i=new Uint8Array(new ArrayBuffer(t.length)),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i.buffer},nc=function(t){return t.on=t.addEventListener,t.off=t.removeEventListener,t},Mf=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch{var i=new BlobBuilder;return i.append(t),URL.createObjectURL(i.getBlob())}},rc=function(t){return function(){var i=Mf(t),r=nc(new Worker(i));r.objURL=i;var e=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(i),e.call(this)},r}},ic=function(t){return"var browserWorkerPolyFill = "+nc.toString()+`; browserWorkerPolyFill(self); `+t},ac=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},Rf=ic(ac(function(){var t=function(){this.init=function(){var u={};this.on=function(c,f){u[c]||(u[c]=[]),u[c]=u[c].concat(f)},this.off=function(c,f){var d;return!!u[c]&&(d=u[c].indexOf(f),u[c]=u[c].slice(),u[c].splice(d,1),d>-1)},this.trigger=function(c){var f,d,m,T;if(f=u[c])if(arguments.length===2)for(m=f.length,d=0;d<m;++d)f[d].call(this,arguments[1]);else{for(T=[],d=arguments.length,d=1;d<arguments.length;++d)T.push(arguments[d]);for(m=f.length,d=0;d<m;++d)f[d].apply(this,T)}},this.dispose=function(){u={}}}};t.prototype.pipe=function(u){return this.on("data",function(c){u.push(c)}),this.on("done",function(c){u.flush(c)}),this.on("partialdone",function(c){u.partialFlush(c)}),this.on("endedtimeline",function(c){u.endTimeline(c)}),this.on("reset",function(c){u.reset(c)}),u},t.prototype.push=function(u){this.trigger("data",u)},t.prototype.flush=function(u){this.trigger("done",u)},t.prototype.partialFlush=function(u){this.trigger("partialdone",u)},t.prototype.endTimeline=function(u){this.trigger("endedtimeline",u)},t.prototype.reset=function(u){this.trigger("reset",u)};var i,r,e,n,a,s,o,l,h,g,b,_,G,ne,ye,re,Ue,Ge,be,De,Se,Me,Ce,ze,Ne,Ye,tt,Dt,St,ot,Rt,Nt,Ut,It,Ca,er,lr,Tr,At=t,Sr=Math.pow(2,32),Jr=function(u){var c,f=new DataView(u.buffer,u.byteOffset,u.byteLength);return f.getBigUint64?(c=f.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(c):c:f.getUint32(0)*Sr+f.getUint32(4)},cr={getUint64:Jr,MAX_UINT32:Sr},Bc=cr.MAX_UINT32;(function(){var u;if(Ce={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array<"u"){for(u in Ce)Ce.hasOwnProperty(u)&&(Ce[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);ze=new Uint8Array([105,115,111,109]),Ye=new Uint8Array([97,118,99,49]),Ne=new Uint8Array([0,0,0,1]),tt=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Dt=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]),St={video:tt,audio:Dt},Nt=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Rt=new Uint8Array([0,0,0,0,0,0,0,0]),Ut=new Uint8Array([0,0,0,0,0,0,0,0]),It=Ut,Ca=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),er=Ut,ot=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),i=function(u){var c,f,d=[],m=0;for(c=1;c<arguments.length;c++)d.push(arguments[c]);for(c=d.length;c--;)m+=d[c].byteLength;for(f=new Uint8Array(m+8),new DataView(f.buffer,f.byteOffset,f.byteLength).setUint32(0,f.byteLength),f.set(u,4),c=0,m=8;c<d.length;c++)f.set(d[c],m),m+=d[c].byteLength;return f},r=function(){return i(Ce.dinf,i(Ce.dref,Nt))},e=function(u){return i(Ce.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,u.audioobjecttype<<3|u.samplingfrequencyindex>>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},n=function(){return i(Ce.ftyp,ze,Ne,ze,Ye)},re=function(u){return i(Ce.hdlr,St[u])},a=function(u){return i(Ce.mdat,u)},ye=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,255&u.duration,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=255&u.samplerate),i(Ce.mdhd,c)},ne=function(u){return i(Ce.mdia,ye(u),re(u.type),o(u))},s=function(u){return i(Ce.mfhd,new Uint8Array([0,0,0,0,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u]))},o=function(u){return i(Ce.minf,u.type==="video"?i(Ce.vmhd,ot):i(Ce.smhd,Rt),r(),Ge(u))},l=function(u,c){for(var f=[],d=c.length;d--;)f[d]=De(c[d]);return i.apply(null,[Ce.moof,s(u)].concat(f))},h=function(u){for(var c=u.length,f=[];c--;)f[c]=_(u[c]);return i.apply(null,[Ce.moov,b(4294967295)].concat(f).concat(g(u)))},g=function(u){for(var c=u.length,f=[];c--;)f[c]=Se(u[c]);return i.apply(null,[Ce.mvex].concat(f))},b=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,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(Ce.mvhd,c)},Ue=function(u){var c,f,d=u.samples||[],m=new Uint8Array(4+d.length);for(f=0;f<d.length;f++)c=d[f].flags,m[f+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return i(Ce.sdtp,m)},Ge=function(u){return i(Ce.stbl,be(u),i(Ce.stts,er),i(Ce.stsc,It),i(Ce.stsz,Ca),i(Ce.stco,Ut))},be=function(u){return i(Ce.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),u.type==="video"?lr(u):Tr(u))},lr=function(u){var c,f,d=u.sps||[],m=u.pps||[],T=[],x=[];for(c=0;c<d.length;c++)T.push((65280&d[c].byteLength)>>>8),T.push(255&d[c].byteLength),T=T.concat(Array.prototype.slice.call(d[c]));for(c=0;c<m.length;c++)x.push((65280&m[c].byteLength)>>>8),x.push(255&m[c].byteLength),x=x.concat(Array.prototype.slice.call(m[c]));if(f=[Ce.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&u.width)>>8,255&u.width,(65280&u.height)>>8,255&u.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(Ce.avcC,new Uint8Array([1,u.profileIdc,u.profileCompatibility,u.levelIdc,255].concat([d.length],T,[m.length],x))),i(Ce.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],u.sarRatio){var q=u.sarRatio[0],j=u.sarRatio[1];f.push(i(Ce.pasp,new Uint8Array([(4278190080&q)>>24,(16711680&q)>>16,(65280&q)>>8,255&q,(4278190080&j)>>24,(16711680&j)>>16,(65280&j)>>8,255&j])))}return i.apply(null,f)},Tr=function(u){return i(Ce.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&u.channelcount)>>8,255&u.channelcount,(65280&u.samplesize)>>8,255&u.samplesize,0,0,0,0,(65280&u.samplerate)>>8,255&u.samplerate,0,0]),e(u))},G=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,0,(4278190080&u.duration)>>24,(16711680&u.duration)>>16,(65280&u.duration)>>8,255&u.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&u.width)>>8,255&u.width,0,0,(65280&u.height)>>8,255&u.height,0,0]);return i(Ce.tkhd,c)},De=function(u){var c,f,d,m,T,x,q;return c=i(Ce.tfhd,new Uint8Array([0,0,0,58,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),x=Math.floor(u.baseMediaDecodeTime/Bc),q=Math.floor(u.baseMediaDecodeTime%Bc),f=i(Ce.tfdt,new Uint8Array([1,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,255&x,q>>>24&255,q>>>16&255,q>>>8&255,255&q])),T=92,u.type==="audio"?(d=Me(u,T),i(Ce.traf,c,f,d)):(m=Ue(u),d=Me(u,m.length+T),i(Ce.traf,c,f,d,m))},_=function(u){return u.duration=u.duration||4294967295,i(Ce.trak,G(u),ne(u))},Se=function(u){var c=new Uint8Array([0,0,0,0,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),i(Ce.trex,c)},function(){var u,c,f;f=function(d,m){var T=0,x=0,q=0,j=0;return d.length&&(d[0].duration!==void 0&&(T=1),d[0].size!==void 0&&(x=2),d[0].flags!==void 0&&(q=4),d[0].compositionTimeOffset!==void 0&&(j=8)),[0,0,T|x|q|j,1,(4278190080&d.length)>>>24,(16711680&d.length)>>>16,(65280&d.length)>>>8,255&d.length,(4278190080&m)>>>24,(16711680&m)>>>16,(65280&m)>>>8,255&m]},c=function(d,m){var T,x,q,j,W,_e;for(m+=20+16*(j=d.samples||[]).length,q=f(j,m),(x=new Uint8Array(q.length+16*j.length)).set(q),T=q.length,_e=0;_e<j.length;_e++)W=j[_e],x[T++]=(4278190080&W.duration)>>>24,x[T++]=(16711680&W.duration)>>>16,x[T++]=(65280&W.duration)>>>8,x[T++]=255&W.duration,x[T++]=(4278190080&W.size)>>>24,x[T++]=(16711680&W.size)>>>16,x[T++]=(65280&W.size)>>>8,x[T++]=255&W.size,x[T++]=W.flags.isLeading<<2|W.flags.dependsOn,x[T++]=W.flags.isDependedOn<<6|W.flags.hasRedundancy<<4|W.flags.paddingValue<<1|W.flags.isNonSyncSample,x[T++]=61440&W.flags.degradationPriority,x[T++]=15&W.flags.degradationPriority,x[T++]=(4278190080&W.compositionTimeOffset)>>>24,x[T++]=(16711680&W.compositionTimeOffset)>>>16,x[T++]=(65280&W.compositionTimeOffset)>>>8,x[T++]=255&W.compositionTimeOffset;return i(Ce.trun,x)},u=function(d,m){var T,x,q,j,W,_e;for(m+=20+8*(j=d.samples||[]).length,q=f(j,m),(T=new Uint8Array(q.length+8*j.length)).set(q),x=q.length,_e=0;_e<j.length;_e++)W=j[_e],T[x++]=(4278190080&W.duration)>>>24,T[x++]=(16711680&W.duration)>>>16,T[x++]=(65280&W.duration)>>>8,T[x++]=255&W.duration,T[x++]=(4278190080&W.size)>>>24,T[x++]=(16711680&W.size)>>>16,T[x++]=(65280&W.size)>>>8,T[x++]=255&W.size;return i(Ce.trun,T)},Me=function(d,m){return d.type==="audio"?u(d,m):c(d,m)}}();var Eo,wo,ko,xa,Co,jc,Fc,qc,Ci={ftyp:n,mdat:a,moof:l,moov:h,initSegment:function(u){var c,f=n(),d=h(u);return(c=new Uint8Array(f.byteLength+d.byteLength)).set(f),c.set(d,f.byteLength),c}},gg=function(u){var c,f,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,c=0;c<u.length;c++)(f=u[c]).nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=f.dts-d.dts,m.byteLength+=d.byteLength,m.nalCount+=d.length,m.duration+=d.duration,m.push(d)),(d=[f]).byteLength=f.data.byteLength,d.pts=f.pts,d.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=f.dts-d.dts,d.byteLength+=f.data.byteLength,d.push(f));return m.length&&(!d.duration||d.duration<=0)&&(d.duration=m[m.length-1].duration),m.byteLength+=d.byteLength,m.nalCount+=d.length,m.duration+=d.duration,m.push(d),m},vg=function(u){var c,f,d=[],m=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=u[0].pts,d.dts=u[0].dts,m.byteLength=0,m.nalCount=0,m.duration=0,m.pts=u[0].pts,m.dts=u[0].dts,c=0;c<u.length;c++)(f=u[c]).keyFrame?(d.length&&(m.push(d),m.byteLength+=d.byteLength,m.nalCount+=d.nalCount,m.duration+=d.duration),(d=[f]).nalCount=f.length,d.byteLength=f.byteLength,d.pts=f.pts,d.dts=f.dts,d.duration=f.duration):(d.duration+=f.duration,d.nalCount+=f.length,d.byteLength+=f.byteLength,d.push(f));return m.length&&d.duration<=0&&(d.duration=m[m.length-1].duration),m.byteLength+=d.byteLength,m.nalCount+=d.nalCount,m.duration+=d.duration,m.push(d),m},yg=function(u){var c;return!u[0][0].keyFrame&&u.length>1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},_g=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Hc=function(u,c){var f=_g();return f.dataOffset=c,f.compositionTimeOffset=u.pts-u.dts,f.duration=u.duration,f.size=4*u.length,f.size+=u.byteLength,u.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},bg=function(u,c){var f,d,m,T,x,q=c||0,j=[];for(f=0;f<u.length;f++)for(T=u[f],d=0;d<T.length;d++)x=T[d],q+=(m=Hc(x,q)).size,j.push(m);return j},Tg=function(u){var c,f,d,m,T,x,q=0,j=u.byteLength,W=u.nalCount,_e=new Uint8Array(j+4*W),Oe=new DataView(_e.buffer);for(c=0;c<u.length;c++)for(m=u[c],f=0;f<m.length;f++)for(T=m[f],d=0;d<T.length;d++)x=T[d],Oe.setUint32(q,x.data.byteLength),q+=4,_e.set(x.data,q),q+=x.data.byteLength;return _e},Sg=function(u,c){var f,d=[];return f=Hc(u,c||0),d.push(f),d},Eg=function(u){var c,f,d=0,m=u.byteLength,T=u.length,x=new Uint8Array(m+4*T),q=new DataView(x.buffer);for(c=0;c<u.length;c++)f=u[c],q.setUint32(d,f.data.byteLength),d+=4,x.set(f.data,d),d+=f.data.byteLength;return x},xi={groupNalsIntoFrames:gg,groupFramesIntoGops:vg,extendFirstKeyFrame:yg,generateSampleTable:bg,concatenateNalData:Tg,generateSampleTableForFrame:Sg,concatenateNalDataForFrame:Eg},dr=[33,16,5,32,164,27],xo=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],dt=function(u){for(var c=[];u--;)c.push(0);return c},wg=function(u){return Object.keys(u).reduce(function(c,f){return c[f]=new Uint8Array(u[f].reduce(function(d,m){return d.concat(m)},[])),c},{})},kg=function(){if(!Eo){var u={96e3:[dr,[227,64],dt(154),[56]],88200:[dr,[231],dt(170),[56]],64e3:[dr,[248,192],dt(240),[56]],48e3:[dr,[255,192],dt(268),[55,148,128],dt(54),[112]],44100:[dr,[255,192],dt(268),[55,163,128],dt(84),[112]],32e3:[dr,[255,192],dt(268),[55,234],dt(226),[112]],24e3:[dr,[255,192],dt(268),[55,255,128],dt(268),[111,112],dt(126),[224]],16e3:[dr,[255,192],dt(268),[55,255,128],dt(268),[111,255],dt(269),[223,108],dt(195),[1,192]],12e3:[xo,dt(268),[3,127,248],dt(268),[6,255,240],dt(268),[13,255,224],dt(268),[27,253,128],dt(259),[56]],11025:[xo,dt(268),[3,127,248],dt(268),[6,255,240],dt(268),[13,255,224],dt(268),[27,255,192],dt(268),[55,175,128],dt(108),[112]],8e3:[xo,dt(268),[3,121,16],dt(47),[7]]};Eo=wg(u)}return Eo},Io=9e4;wo=function(u){return u*Io},ko=function(u,c){return u*c},xa=function(u){return u/Io},Co=function(u,c){return u/c},jc=function(u,c){return wo(Co(u,c))},Fc=function(u,c){return ko(xa(u),c)},qc=function(u,c,f){return xa(f?u:u-c)};var ct={ONE_SECOND_IN_TS:Io,secondsToVideoTs:wo,secondsToAudioTs:ko,videoTsToSeconds:xa,audioTsToSeconds:Co,audioTsToVideoTs:jc,videoTsToAudioTs:Fc,metadataTsToSeconds:qc},Cg=function(u){var c,f=0;for(c=0;c<u.length;c++)f+=u[c].data.byteLength;return f},xg=function(u,c,f,d){var m,T,x,q,j=0,W=0,_e=0,Oe=0;if(c.length&&(m=ct.audioTsToVideoTs(u.baseMediaDecodeTime,u.samplerate),j=Math.ceil(ct.ONE_SECOND_IN_TS/(u.samplerate/1024)),f&&d&&(W=m-Math.max(f,d),Oe=(_e=Math.floor(W/j))*j),!(_e<1||Oe>ct.ONE_SECOND_IN_TS/2))){for((T=kg()[u.samplerate])||(T=c[0].data),x=0;x<_e;x++)q=c[0],c.splice(0,0,{data:T,dts:q.dts-j,pts:q.pts-j});return u.baseMediaDecodeTime-=Math.floor(ct.videoTsToAudioTs(Oe,u.samplerate)),Oe}},Ig=function(u,c,f){return c.minSegmentDts>=f?u:(c.minSegmentDts=1/0,u.filter(function(d){return d.dts>=f&&(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0)}))},Ag=function(u){var c,f,d=[];for(c=0;c<u.length;c++)f=u[c],d.push({size:f.data.byteLength,duration:1024});return d},Pg=function(u){var c,f,d=0,m=new Uint8Array(Cg(u));for(c=0;c<u.length;c++)f=u[c],m.set(f.data,d),d+=f.data.byteLength;return m},Ia={prefixWithSilence:xg,trimAdtsFramesByEarliestDts:Ig,generateSampleTable:Ag,concatenateFrameData:Pg},Og=ct.ONE_SECOND_IN_TS,Dg=function(u,c){typeof c.pts=="number"&&(u.timelineStartInfo.pts===void 0&&(u.timelineStartInfo.pts=c.pts),u.minSegmentPts===void 0?u.minSegmentPts=c.pts:u.minSegmentPts=Math.min(u.minSegmentPts,c.pts),u.maxSegmentPts===void 0?u.maxSegmentPts=c.pts:u.maxSegmentPts=Math.max(u.maxSegmentPts,c.pts)),typeof c.dts=="number"&&(u.timelineStartInfo.dts===void 0&&(u.timelineStartInfo.dts=c.dts),u.minSegmentDts===void 0?u.minSegmentDts=c.dts:u.minSegmentDts=Math.min(u.minSegmentDts,c.dts),u.maxSegmentDts===void 0?u.maxSegmentDts=c.dts:u.maxSegmentDts=Math.max(u.maxSegmentDts,c.dts))},Lg=function(u){delete u.minSegmentDts,delete u.maxSegmentDts,delete u.minSegmentPts,delete u.maxSegmentPts},Mg=function(u,c){var f,d=u.minSegmentDts;return c||(d-=u.timelineStartInfo.dts),f=u.timelineStartInfo.baseMediaDecodeTime,f+=d,f=Math.max(0,f),u.type==="audio"&&(f*=u.samplerate/Og,f=Math.floor(f)),f},Cn={clearDtsInfo:Lg,calculateTrackBaseMediaDecodeTime:Mg,collectDtsInfo:Dg},Vc=4,Rg=128,Ng=function(u){for(var c=0,f={payloadType:-1,payloadSize:0},d=0,m=0;c<u.byteLength&&u[c]!==Rg;){for(;u[c]===255;)d+=255,c++;for(d+=u[c++];u[c]===255;)m+=255,c++;if(m+=u[c++],!f.payload&&d===Vc){if(String.fromCharCode(u[c+3],u[c+4],u[c+5],u[c+6])==="GA94"){f.payloadType=d,f.payloadSize=m,f.payload=u.subarray(c,c+m);break}f.payload=void 0}c+=m,d=0,m=0}return f},Ug=function(u){return u.payload[0]!==181||(u.payload[1]<<8|u.payload[2])!=49||String.fromCharCode(u.payload[3],u.payload[4],u.payload[5],u.payload[6])!=="GA94"||u.payload[7]!==3?null:u.payload.subarray(8,u.payload.length-1)},Bg=function(u,c){var f,d,m,T,x=[];if(!(64&c[0]))return x;for(d=31&c[0],f=0;f<d;f++)T={type:3&c[2+(m=3*f)],pts:u},4&c[m+2]&&(T.ccData=c[m+3]<<8|c[m+4],x.push(T));return x},jg=function(u){for(var c,f,d=u.byteLength,m=[],T=1;T<d-2;)u[T]===0&&u[T+1]===0&&u[T+2]===3?(m.push(T+2),T+=2):T++;if(m.length===0)return u;c=d-m.length,f=new Uint8Array(c);var x=0;for(T=0;T<c;x++,T++)x===m[0]&&(x++,m.shift()),f[T]=u[x];return f},Ii={parseSei:Ng,parseUserData:Ug,parseCaptionPackets:Bg,discardEmulationPreventionBytes:jg,USER_DATA_REGISTERED_ITU_T_T35:Vc},mn=function u(c){c=c||{},u.prototype.init.call(this),this.parse708captions_=typeof c.parse708captions!="boolean"||c.parse708captions,this.captionPackets_=[],this.ccStreams_=[new bt(0,0),new bt(0,1),new bt(1,0),new bt(1,1)],this.parse708captions_&&(this.cc708Stream_=new mt({captionServices:c.captionServices})),this.reset(),this.ccStreams_.forEach(function(f){f.on("data",this.trigger.bind(this,"data")),f.on("partialdone",this.trigger.bind(this,"partialdone")),f.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")))};mn.prototype=new At,mn.prototype.push=function(u){var c,f,d;if(u.nalUnitType==="sei_rbsp"&&(c=Ii.parseSei(u.escapedRBSP)).payload&&c.payloadType===Ii.USER_DATA_REGISTERED_ITU_T_T35&&(f=Ii.parseUserData(c))){if(u.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(u.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));d=Ii.parseCaptionPackets(u.pts,f),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==u.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=u.dts}},mn.prototype.flushCCStreams=function(u){this.ccStreams_.forEach(function(c){return u==="flush"?c.flush():c.partialFlush()},this)},mn.prototype.flushStream=function(u){this.captionPackets_.length?(this.captionPackets_.forEach(function(c,f){c.presortIndex=f}),this.captionPackets_.sort(function(c,f){return c.pts===f.pts?c.presortIndex-f.presortIndex:c.pts-f.pts}),this.captionPackets_.forEach(function(c){c.type<2?this.dispatchCea608Packet(c):this.dispatchCea708Packet(c)},this),this.captionPackets_.length=0,this.flushCCStreams(u)):this.flushCCStreams(u)},mn.prototype.flush=function(){return this.flushStream("flush")},mn.prototype.partialFlush=function(){return this.flushStream("partialFlush")},mn.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(u){u.reset()})},mn.prototype.dispatchCea608Packet=function(u){this.setsTextOrXDSActive(u)?this.activeCea608Channel_[u.type]=null:this.setsChannel1Active(u)?this.activeCea608Channel_[u.type]=0:this.setsChannel2Active(u)&&(this.activeCea608Channel_[u.type]=1),this.activeCea608Channel_[u.type]!==null&&this.ccStreams_[(u.type<<1)+this.activeCea608Channel_[u.type]].push(u)},mn.prototype.setsChannel1Active=function(u){return(30720&u.ccData)==4096},mn.prototype.setsChannel2Active=function(u){return(30720&u.ccData)==6144},mn.prototype.setsTextOrXDSActive=function(u){return(28928&u.ccData)==256||(30974&u.ccData)==4138||(30974&u.ccData)==6186},mn.prototype.dispatchCea708Packet=function(u){this.parse708captions_&&this.cc708Stream_.push(u)};var Fg={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},qg=function(u){var c=Fg[u]||u;return 4096&u&&u===c?"":String.fromCharCode(c)},Aa=function(u){return 32<=u&&u<=127||160<=u&&u<=255},tr=function(u){this.windowNum=u,this.reset()};tr.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},tr.prototype.getText=function(){return this.rows.join(` `)},tr.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},tr.prototype.newLine=function(u){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},tr.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},tr.prototype.addText=function(u){this.rows[this.rowIdx]+=u},tr.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var Pa=function(u,c,f){this.serviceNum=u,this.text="",this.currentWindow=new tr(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Pa.prototype.init=function(u,c){this.startPts=u;for(var f=0;f<8;f++)this.windows[f]=new tr(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Pa.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},Pa.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var mt=function u(c){c=c||{},u.prototype.init.call(this);var f,d=this,m=c.captionServices||{},T={};Object.keys(m).forEach(function(x){f=m[x],/^SERVICE/.test(x)&&(T[x]=f.encoding)}),this.serviceEncodings=T,this.current708Packet=null,this.services={},this.push=function(x){x.type===3?(d.new708Packet(),d.add708Bytes(x)):(d.current708Packet===null&&d.new708Packet(),d.add708Bytes(x))}};mt.prototype=new At,mt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},mt.prototype.add708Bytes=function(u){var c=u.ccData,f=c>>>8,d=255&c;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(d)},mt.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,f=null,d=null,m=0,T=c[m++];for(u.seq=T>>6,u.sizeCode=63&T;m<c.length;m++)d=31&(T=c[m++]),(f=T>>5)==7&&d>0&&(f=T=c[m++]),this.pushServiceBlock(f,m,d),d>0&&(m+=d-1)},mt.prototype.pushServiceBlock=function(u,c,f){var d,m=c,T=this.current708Packet.data,x=this.services[u];for(x||(x=this.initService(u,m));m<c+f&&m<T.length;m++)d=T[m],Aa(d)?m=this.handleText(m,x):d===24?m=this.multiByteCharacter(m,x):d===16?m=this.extendedCommands(m,x):128<=d&&d<=135?m=this.setCurrentWindow(m,x):152<=d&&d<=159?m=this.defineWindow(m,x):d===136?m=this.clearWindows(m,x):d===140?m=this.deleteWindows(m,x):d===137?m=this.displayWindows(m,x):d===138?m=this.hideWindows(m,x):d===139?m=this.toggleWindows(m,x):d===151?m=this.setWindowAttributes(m,x):d===144?m=this.setPenAttributes(m,x):d===145?m=this.setPenColor(m,x):d===146?m=this.setPenLocation(m,x):d===143?x=this.reset(m,x):d===8?x.currentWindow.backspace():d===12?x.currentWindow.clearText():d===13?x.currentWindow.pendingNewLine=!0:d===14?x.currentWindow.clearText():d===141&&m++},mt.prototype.extendedCommands=function(u,c){var f=this.current708Packet.data[++u];return Aa(f)&&(u=this.handleText(u,c,{isExtended:!0})),u},mt.prototype.getPts=function(u){return this.current708Packet.ptsVals[Math.floor(u/2)]},mt.prototype.initService=function(u,c){var f,d,m=this;return(f="SERVICE"+u)in this.serviceEncodings&&(d=this.serviceEncodings[f]),this.services[u]=new Pa(u,d,m),this.services[u].init(this.getPts(c),function(T){m.flushDisplayed(T,m.services[u])}),this.services[u]},mt.prototype.handleText=function(u,c,f){var d,m,T=f&&f.isExtended,x=f&&f.isMultiByte,q=this.current708Packet.data,j=T?4096:0,W=q[u],_e=q[u+1],Oe=c.currentWindow;return c.textDecoder_&&!T?(x?(m=[W,_e],u++):m=[W],d=c.textDecoder_.decode(new Uint8Array(m))):d=qg(j|W),Oe.pendingNewLine&&!Oe.isEmpty()&&Oe.newLine(this.getPts(u)),Oe.pendingNewLine=!1,Oe.addText(d),u},mt.prototype.multiByteCharacter=function(u,c){var f=this.current708Packet.data,d=f[u+1],m=f[u+2];return Aa(d)&&Aa(m)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},mt.prototype.setCurrentWindow=function(u,c){var f=7&this.current708Packet.data[u];return c.setCurrentWindow(f),u},mt.prototype.defineWindow=function(u,c){var f=this.current708Packet.data,d=f[u],m=7&d;c.setCurrentWindow(m);var T=c.currentWindow;return d=f[++u],T.visible=(32&d)>>5,T.rowLock=(16&d)>>4,T.columnLock=(8&d)>>3,T.priority=7&d,d=f[++u],T.relativePositioning=(128&d)>>7,T.anchorVertical=127&d,d=f[++u],T.anchorHorizontal=d,d=f[++u],T.anchorPoint=(240&d)>>4,T.rowCount=15&d,d=f[++u],T.columnCount=63&d,d=f[++u],T.windowStyle=(56&d)>>3,T.penStyle=7&d,T.virtualRowCount=T.rowCount+1,u},mt.prototype.setWindowAttributes=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.winAttr;return d=f[++u],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=f[++u],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=f[++u],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=f[++u],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,u},mt.prototype.flushDisplayed=function(u,c){for(var f=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&f.push(c.windows[d].getText());c.endPts=u,c.text=f.join(` `),this.pushCaption(c),c.startPts=u},mt.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},mt.prototype.displayWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<<m&&(c.windows[m].visible=1);return u},mt.prototype.hideWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<<m&&(c.windows[m].visible=0);return u},mt.prototype.toggleWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<<m&&(c.windows[m].visible^=1);return u},mt.prototype.clearWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<<m&&c.windows[m].clearText();return u},mt.prototype.deleteWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<<m&&c.windows[m].reset();return u},mt.prototype.setPenAttributes=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.penAttr;return d=f[++u],m.textTag=(240&d)>>4,m.offset=(12&d)>>2,m.penSize=3&d,d=f[++u],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,u},mt.prototype.setPenColor=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.penColor;return d=f[++u],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=f[++u],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=f[++u],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,u},mt.prototype.setPenLocation=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=f[++u],m.row=15&d,d=f[++u],m.column=63&d,u},mt.prototype.reset=function(u,c){var f=this.getPts(u);return this.flushDisplayed(f,c),this.initService(c.serviceNum,u)};var Hg={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},Oa=function(u){return u===null?"":(u=Hg[u]||u,String.fromCharCode(u))},Da=14,Vg=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Er=function(){for(var u=[],c=Da+1;c--;)u.push("");return u},bt=function u(c,f){u.prototype.init.call(this),this.field_=c||0,this.dataChannel_=f||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(d){var m,T,x,q,j;if((m=32639&d.ccData)!==this.lastControlCode_){if((61440&m)==4096?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),x=m>>>8,q=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(d.pts),this.flushDisplayed(d.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=d.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(d.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(d.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(d.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(d.pts),this.flushDisplayed(d.pts),this.shiftRowsUp_(),this.startPts_=d.pts;else if(m===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(d.pts),this.displayed_=Er();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Er();else if(m===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(d.pts),this.displayed_=Er()),this.mode_="paintOn",this.startPts_=d.pts;else if(this.isSpecialCharacter(x,q))j=Oa((x=(3&x)<<8)|q),this[this.mode_](d.pts,j),this.column_++;else if(this.isExtCharacter(x,q))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),j=Oa((x=(3&x)<<8)|q),this[this.mode_](d.pts,j),this.column_++;else if(this.isMidRowCode(x,q))this.clearFormatting(d.pts),this[this.mode_](d.pts," "),this.column_++,!(14&~q)&&this.addFormatting(d.pts,["i"]),!(1&~q)&&this.addFormatting(d.pts,["u"]);else if(this.isOffsetControlCode(x,q))this.column_+=3&q;else if(this.isPAC(x,q)){var W=Vg.indexOf(7968&m);this.mode_==="rollUp"&&(W-this.rollUpRows_+1<0&&(W=this.rollUpRows_-1),this.setRollUp(d.pts,W)),W!==this.row_&&(this.clearFormatting(d.pts),this.row_=W),1&q&&this.formatting_.indexOf("u")===-1&&this.addFormatting(d.pts,["u"]),!(16&~m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(q)&&!(14&~q)&&this.addFormatting(d.pts,["i"])}else this.isNormalChar(x)&&(q===0&&(q=null),j=Oa(x),j+=Oa(q),this[this.mode_](d.pts,j),this.column_+=j.length)}else this.lastControlCode_=null}};bt.prototype=new At,bt.prototype.flushDisplayed=function(u){var c=this.displayed_.map(function(f,d){try{return f.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."}),""}},this).join(` `).replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,text:c,stream:this.name_})},bt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Er(),this.nonDisplayed_=Er(),this.lastControlCode_=null,this.column_=0,this.row_=Da,this.rollUpRows_=2,this.formatting_=[]},bt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},bt.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},bt.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},bt.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},bt.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},bt.prototype.isPAC=function(u,c){return u>=this.BASE_&&u<this.BASE_+8&&c>=64&&c<=127},bt.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},bt.prototype.isNormalChar=function(u){return u>=32&&u<=127},bt.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=Da,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=Er(),this.displayed_=Er()),c!==void 0&&c!==this.row_)for(var f=0;f<this.rollUpRows_;f++)this.displayed_[c-f]=this.displayed_[this.row_-f],this.displayed_[this.row_-f]="";c===void 0&&(c=this.row_),this.topRow_=c-this.rollUpRows_+1},bt.prototype.addFormatting=function(u,c){this.formatting_=this.formatting_.concat(c);var f=c.reduce(function(d,m){return d+"<"+m+">"},"");this[this.mode_](u,f)},bt.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,d){return f+"</"+d+">"},"");this.formatting_=[],this[this.mode_](u,c)}},bt.prototype.popOn=function(u,c){var f=this.nonDisplayed_[this.row_];f+=c,this.nonDisplayed_[this.row_]=f},bt.prototype.rollUp=function(u,c){var f=this.displayed_[this.row_];f+=c,this.displayed_[this.row_]=f},bt.prototype.shiftRowsUp_=function(){var u;for(u=0;u<this.topRow_;u++)this.displayed_[u]="";for(u=this.row_+1;u<Da+1;u++)this.displayed_[u]="";for(u=this.topRow_;u<this.row_;u++)this.displayed_[u]=this.displayed_[u+1];this.displayed_[this.row_]=""},bt.prototype.paintOn=function(u,c){var f=this.displayed_[this.row_];f+=c,this.displayed_[this.row_]=f};var La={CaptionStream:mn,Cea608Stream:bt,Cea708Stream:mt},Wt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Wg=8589934592,Gg=4294967296,Wc="shared",Ao=function(u,c){var f=1;for(u>c&&(f=-1);Math.abs(c-u)>Gg;)u+=f*Wg;return u},Gc=function u(c){var f,d;u.prototype.init.call(this),this.type_=c||Wc,this.push=function(m){this.type_!==Wc&&m.type!==this.type_||(d===void 0&&(d=m.dts),m.dts=Ao(m.dts,d),m.pts=Ao(m.pts,d),f=m.dts,this.trigger("data",m))},this.flush=function(){d=f,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){d=void 0,f=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Gc.prototype=new At;var Ma,zc={TimestampRolloverStream:Gc,handleRollover:Ao},Xc=function(u,c,f){var d,m="";for(d=c;d<f;d++)m+="%"+("00"+u[d].toString(16)).slice(-2);return m},Ra=function(u,c,f){return decodeURIComponent(Xc(u,c,f))},zg=function(u,c,f){return unescape(Xc(u,c,f))},Na=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},Kc={TXXX:function(u){var c;if(u.data[0]===3){for(c=1;c<u.data.length;c++)if(u.data[c]===0){u.description=Ra(u.data,1,c),u.value=Ra(u.data,c+1,u.data.length).replace(/\0*$/,"");break}u.data=u.value}},WXXX:function(u){var c;if(u.data[0]===3){for(c=1;c<u.data.length;c++)if(u.data[c]===0){u.description=Ra(u.data,1,c),u.url=Ra(u.data,c+1,u.data.length);break}}},PRIV:function(u){var c;for(c=0;c<u.data.length;c++)if(u.data[c]===0){u.owner=zg(u.data,0,c);break}u.privateData=u.data.subarray(c+1),u.data=u.privateData}};Ma=function(u){var c,f={descriptor:u&&u.descriptor},d=0,m=[],T=0;if(Ma.prototype.init.call(this),this.dispatchType=Wt.METADATA_STREAM_TYPE.toString(16),f.descriptor)for(c=0;c<f.descriptor.length;c++)this.dispatchType+=("00"+f.descriptor[c].toString(16)).slice(-2);this.push=function(x){var q,j,W,_e,Oe;if(x.type==="timed-metadata"){if(x.dataAlignmentIndicator&&(T=0,m.length=0),m.length===0&&(x.data.length<10||x.data[0]!==73||x.data[1]!==68||x.data[2]!==51))return void this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});if(m.push(x),T+=x.data.byteLength,m.length===1&&(d=Na(x.data.subarray(6,10)),d+=10),!(T<d)){for(q={data:new Uint8Array(d),frames:[],pts:m[0].pts,dts:m[0].dts},Oe=0;Oe<d;)q.data.set(m[0].data.subarray(0,d-Oe),Oe),Oe+=m[0].data.byteLength,T-=m[0].data.byteLength,m.shift();j=10,64&q.data[5]&&(j+=4,j+=Na(q.data.subarray(10,14)),d-=Na(q.data.subarray(16,20)));do{if((W=Na(q.data.subarray(j+4,j+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if((_e={id:String.fromCharCode(q.data[j],q.data[j+1],q.data[j+2],q.data[j+3]),data:q.data.subarray(j+10,j+W+10)}).key=_e.id,Kc[_e.id]&&(Kc[_e.id](_e),_e.owner==="com.apple.streaming.transportStreamTimestamp")){var Ve=_e.data,Qe=(1&Ve[3])<<30|Ve[4]<<22|Ve[5]<<14|Ve[6]<<6|Ve[7]>>>2;Qe*=4,Qe+=3&Ve[7],_e.timeStamp=Qe,q.pts===void 0&&q.dts===void 0&&(q.pts=_e.timeStamp,q.dts=_e.timeStamp),this.trigger("timestamp",_e)}q.frames.push(_e),j+=10,j+=W}while(j<d);this.trigger("data",q)}}}},Ma.prototype=new At;var Ua,Ai,Ba,Xg=Ma,Kg=zc.TimestampRolloverStream,Zr=188,Po=71;Ua=function(){var u=new Uint8Array(Zr),c=0;Ua.prototype.init.call(this),this.push=function(f){var d,m=0,T=Zr;for(c?((d=new Uint8Array(f.byteLength+c)).set(u.subarray(0,c)),d.set(f,c),c=0):d=f;T<d.byteLength;)d[m]!==Po||d[T]!==Po?(m++,T++):(this.trigger("data",d.subarray(m,T)),m+=Zr,T+=Zr);m<d.byteLength&&(u.set(d.subarray(m),0),c=d.byteLength-m)},this.flush=function(){c===Zr&&u[0]===Po&&(this.trigger("data",u),c=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){c=0,this.trigger("reset")}},Ua.prototype=new At,Ai=function(){var u,c,f,d;Ai.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,u=function(m,T){var x=0;T.payloadUnitStartIndicator&&(x+=m[x]+1),T.type==="pat"?c(m.subarray(x),T):f(m.subarray(x),T)},c=function(m,T){T.section_number=m[7],T.last_section_number=m[8],d.pmtPid=(31&m[10])<<8|m[11],T.pmtPid=d.pmtPid},f=function(m,T){var x,q;if(1&m[5]){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},x=3+((15&m[1])<<8|m[2])-4,q=12+((15&m[10])<<8|m[11]);q<x;){var j=m[q],W=(31&m[q+1])<<8|m[q+2];j===Wt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=W:j===Wt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=W:j===Wt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][W]=j),q+=5+((15&m[q+3])<<8|m[q+4])}T.programMapTable=d.programMapTable}},this.push=function(m){var T={},x=4;if(T.payloadUnitStartIndicator=!!(64&m[1]),T.pid=31&m[1],T.pid<<=8,T.pid|=m[2],(48&m[3])>>>4>1&&(x+=m[x]+1),T.pid===0)T.type="pat",u(m.subarray(x),T),this.trigger("data",T);else if(T.pid===this.pmtPid)for(T.type="pmt",u(m.subarray(x),T),this.trigger("data",T);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,x,T]):this.processPes_(m,x,T)},this.processPes_=function(m,T,x){x.pid===this.programMapTable.video?x.streamType=Wt.H264_STREAM_TYPE:x.pid===this.programMapTable.audio?x.streamType=Wt.ADTS_STREAM_TYPE:x.streamType=this.programMapTable["timed-metadata"][x.pid],x.type="pes",x.data=m.subarray(T),this.trigger("data",x)}},Ai.prototype=new At,Ai.STREAM_TYPES={h264:27,adts:15},Ba=function(){var u,c=this,f=!1,d={data:[],size:0},m={data:[],size:0},T={data:[],size:0},x=function(j,W){var _e,Oe=j[0]<<16|j[1]<<8|j[2];W.data=new Uint8Array,Oe===1&&(W.packetLength=6+(j[4]<<8|j[5]),W.dataAlignmentIndicator=!!(4&j[6]),192&(_e=j[7])&&(W.pts=(14&j[9])<<27|(255&j[10])<<20|(254&j[11])<<12|(255&j[12])<<5|(254&j[13])>>>3,W.pts*=4,W.pts+=(6&j[13])>>>1,W.dts=W.pts,64&_e&&(W.dts=(14&j[14])<<27|(255&j[15])<<20|(254&j[16])<<12|(255&j[17])<<5|(254&j[18])>>>3,W.dts*=4,W.dts+=(6&j[18])>>>1)),W.data=j.subarray(9+j[8]))},q=function(j,W,_e){var Oe,Ve=new Uint8Array(j.size),Qe={type:W},rt=0,lt=0,Kt=!1;if(j.data.length&&!(j.size<9)){for(Qe.trackId=j.data[0].pid,rt=0;rt<j.data.length;rt++)Oe=j.data[rt],Ve.set(Oe.data,lt),lt+=Oe.data.byteLength;x(Ve,Qe),Kt=W==="video"||Qe.packetLength<=j.size,(_e||Kt)&&(j.size=0,j.data.length=0),Kt&&c.trigger("data",Qe)}};Ba.prototype.init.call(this),this.push=function(j){({pat:function(){},pes:function(){var W,_e;switch(j.streamType){case Wt.H264_STREAM_TYPE:W=d,_e="video";break;case Wt.ADTS_STREAM_TYPE:W=m,_e="audio";break;case Wt.METADATA_STREAM_TYPE:W=T,_e="timed-metadata";break;default:return}j.payloadUnitStartIndicator&&q(W,_e,!0),W.data.push(j),W.size+=j.data.byteLength},pmt:function(){var W={type:"metadata",tracks:[]};(u=j.programMapTable).video!==null&&W.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+u.video,codec:"avc",type:"video"}),u.audio!==null&&W.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+u.audio,codec:"adts",type:"audio"}),f=!0,c.trigger("data",W)}})[j.type]()},this.reset=function(){d.size=0,d.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){q(d,"video"),q(m,"audio"),q(T,"timed-metadata")},this.flush=function(){if(!f&&u){var j={type:"metadata",tracks:[]};u.video!==null&&j.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+u.video,codec:"avc",type:"video"}),u.audio!==null&&j.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+u.audio,codec:"adts",type:"audio"}),c.trigger("data",j)}f=!1,this.flushStreams_(),this.trigger("done")}},Ba.prototype=new At;var Qc={PAT_PID:0,MP2T_PACKET_LENGTH:Zr,TransportPacketStream:Ua,TransportParseStream:Ai,ElementaryStream:Ba,TimestampRolloverStream:Kg,CaptionStream:La.CaptionStream,Cea608Stream:La.Cea608Stream,Cea708Stream:La.Cea708Stream,MetadataStream:Xg};for(var Oo in Wt)Wt.hasOwnProperty(Oo)&&(Qc[Oo]=Wt[Oo]);var ja,nr=Qc,Qg=ct.ONE_SECOND_IN_TS,Yc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ja=function(u){var c,f=0;ja.prototype.init.call(this),this.skipWarn_=function(d,m){this.trigger("log",{level:"warn",message:"adts skiping bytes "+d+" to "+m+" in frame "+f+" outside syncword"})},this.push=function(d){var m,T,x,q,j,W=0;if(u||(f=0),d.type==="audio"){c&&c.length?(x=c,(c=new Uint8Array(x.byteLength+d.data.byteLength)).set(x),c.set(d.data,x.byteLength)):c=d.data;for(var _e;W+7<c.length;)if(c[W]===255&&(246&c[W+1])==240){if(typeof _e=="number"&&(this.skipWarn_(_e,W),_e=null),T=2*(1&~c[W+1]),m=(3&c[W+3])<<11|c[W+4]<<3|(224&c[W+5])>>5,j=(q=1024*(1+(3&c[W+6])))*Qg/Yc[(60&c[W+2])>>>2],c.byteLength-W<m)break;this.trigger("data",{pts:d.pts+f*j,dts:d.dts+f*j,sampleCount:q,audioobjecttype:1+(c[W+2]>>>6&3),channelcount:(1&c[W+2])<<2|(192&c[W+3])>>>6,samplerate:Yc[(60&c[W+2])>>>2],samplingfrequencyindex:(60&c[W+2])>>>2,samplesize:16,data:c.subarray(W+7+T,W+m)}),f++,W+=m}else typeof _e!="number"&&(_e=W),W++;typeof _e=="number"&&(this.skipWarn_(_e,W),_e=null),c=c.subarray(W)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},ja.prototype=new At;var $c,Jc=ja;$c=function(u){var c=u.byteLength,f=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var m=u.byteLength-c,T=new Uint8Array(4),x=Math.min(4,c);if(x===0)throw new Error("no bytes available");T.set(u.subarray(m,m+x)),f=new DataView(T.buffer).getUint32(0),d=8*x,c-=x},this.skipBits=function(m){var T;d>m?(f<<=m,d-=m):(m-=d,m-=8*(T=Math.floor(m/8)),c-=T,this.loadWord(),f<<=m,d-=m)},this.readBits=function(m){var T=Math.min(d,m),x=f>>>32-T;return(d-=T)>0?f<<=T:c>0&&this.loadWord(),(T=m-T)>0?x<<T|this.readBits(T):x},this.skipLeadingZeros=function(){var m;for(m=0;m<d;++m)if(f&2147483648>>>m)return f<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Fa,qa,Zc,Yg=$c;qa=function(){var u,c,f=0;qa.prototype.init.call(this),this.push=function(d){var m;c?((m=new Uint8Array(c.byteLength+d.data.byteLength)).set(c),m.set(d.data,c.byteLength),c=m):c=d.data;for(var T=c.byteLength;f<T-3;f++)if(c[f+2]===1){u=f+5;break}for(;u<T;)switch(c[u]){case 0:if(c[u-1]!==0){u+=2;break}if(c[u-2]!==0){u++;break}f+3!==u-2&&this.trigger("data",c.subarray(f+3,u-2));do u++;while(c[u]!==1&&u<T);f=u-2,u+=3;break;case 1:if(c[u-1]!==0||c[u-2]!==0){u+=3;break}this.trigger("data",c.subarray(f+3,u-2)),f=u-2,u+=3;break;default:u+=3}c=c.subarray(f),u-=f,f=0},this.reset=function(){c=null,f=0,this.trigger("reset")},this.flush=function(){c&&c.byteLength>3&&this.trigger("data",c.subarray(f+3)),c=null,f=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},qa.prototype=new At,Zc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Fa=function(){var u,c,f,d,m,T,x,q=new qa;Fa.prototype.init.call(this),u=this,this.push=function(j){j.type==="video"&&(c=j.trackId,f=j.pts,d=j.dts,q.push(j))},q.on("data",function(j){var W={trackId:c,pts:f,dts:d,data:j,nalUnitTypeCode:31&j[0]};switch(W.nalUnitTypeCode){case 5:W.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:W.nalUnitType="sei_rbsp",W.escapedRBSP=m(j.subarray(1));break;case 7:W.nalUnitType="seq_parameter_set_rbsp",W.escapedRBSP=m(j.subarray(1)),W.config=T(W.escapedRBSP);break;case 8:W.nalUnitType="pic_parameter_set_rbsp";break;case 9:W.nalUnitType="access_unit_delimiter_rbsp"}u.trigger("data",W)}),q.on("done",function(){u.trigger("done")}),q.on("partialdone",function(){u.trigger("partialdone")}),q.on("reset",function(){u.trigger("reset")}),q.on("endedtimeline",function(){u.trigger("endedtimeline")}),this.flush=function(){q.flush()},this.partialFlush=function(){q.partialFlush()},this.reset=function(){q.reset()},this.endTimeline=function(){q.endTimeline()},x=function(j,W){var _e,Oe=8,Ve=8;for(_e=0;_e<j;_e++)Ve!==0&&(Ve=(Oe+W.readExpGolomb()+256)%256),Oe=Ve===0?Oe:Ve},m=function(j){for(var W,_e,Oe=j.byteLength,Ve=[],Qe=1;Qe<Oe-2;)j[Qe]===0&&j[Qe+1]===0&&j[Qe+2]===3?(Ve.push(Qe+2),Qe+=2):Qe++;if(Ve.length===0)return j;W=Oe-Ve.length,_e=new Uint8Array(W);var rt=0;for(Qe=0;Qe<W;rt++,Qe++)rt===Ve[0]&&(rt++,Ve.shift()),_e[Qe]=j[rt];return _e},T=function(j){var W,_e,Oe,Ve,Qe,rt,lt,Kt,xn,ti,Td,xr,Sd=0,Ed=0,wd=0,kd=0,Pt=[1,1];if(_e=(W=new Yg(j)).readUnsignedByte(),Ve=W.readUnsignedByte(),Oe=W.readUnsignedByte(),W.skipUnsignedExpGolomb(),Zc[_e]&&((Qe=W.readUnsignedExpGolomb())===3&&W.skipBits(1),W.skipUnsignedExpGolomb(),W.skipUnsignedExpGolomb(),W.skipBits(1),W.readBoolean()))for(Td=Qe!==3?8:12,xr=0;xr<Td;xr++)W.readBoolean()&&x(xr<6?16:64,W);if(W.skipUnsignedExpGolomb(),(rt=W.readUnsignedExpGolomb())===0)W.readUnsignedExpGolomb();else if(rt===1)for(W.skipBits(1),W.skipExpGolomb(),W.skipExpGolomb(),lt=W.readUnsignedExpGolomb(),xr=0;xr<lt;xr++)W.skipExpGolomb();if(W.skipUnsignedExpGolomb(),W.skipBits(1),Kt=W.readUnsignedExpGolomb(),xn=W.readUnsignedExpGolomb(),(ti=W.readBits(1))===0&&W.skipBits(1),W.skipBits(1),W.readBoolean()&&(Sd=W.readUnsignedExpGolomb(),Ed=W.readUnsignedExpGolomb(),wd=W.readUnsignedExpGolomb(),kd=W.readUnsignedExpGolomb()),W.readBoolean()&&W.readBoolean()){switch(W.readUnsignedByte()){case 1:Pt=[1,1];break;case 2:Pt=[12,11];break;case 3:Pt=[10,11];break;case 4:Pt=[16,11];break;case 5:Pt=[40,33];break;case 6:Pt=[24,11];break;case 7:Pt=[20,11];break;case 8:Pt=[32,11];break;case 9:Pt=[80,33];break;case 10:Pt=[18,11];break;case 11:Pt=[15,11];break;case 12:Pt=[64,33];break;case 13:Pt=[160,99];break;case 14:Pt=[4,3];break;case 15:Pt=[3,2];break;case 16:Pt=[2,1];break;case 255:Pt=[W.readUnsignedByte()<<8|W.readUnsignedByte(),W.readUnsignedByte()<<8|W.readUnsignedByte()]}Pt&&(Pt[0],Pt[1])}return{profileIdc:_e,levelIdc:Oe,profileCompatibility:Ve,width:16*(Kt+1)-2*Sd-2*Ed,height:(2-ti)*(xn+1)*16-2*wd-2*kd,sarRatio:Pt}}},Fa.prototype=new At;var Ha,$g={H264Stream:Fa},Jg=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ed=function(u,c){var f=u[c+6]<<21|u[c+7]<<14|u[c+8]<<7|u[c+9];return f=f>=0?f:0,(16&u[c+5])>>4?f+20:f+10},Zg=function u(c,f){return c.length-f<10||c[f]!==73||c[f+1]!==68||c[f+2]!==51?f:u(c,f+=ed(c,f))},ev=function(u){var c=Zg(u,0);return u.length>=c+2&&!(255&~u[c])&&!(240&~u[c+1])&&(22&u[c+1])==16},td=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},tv=function(u,c,f){var d,m="";for(d=c;d<f;d++)m+="%"+("00"+u[d].toString(16)).slice(-2);return m},nv=function(u,c,f){return unescape(tv(u,c,f))},rv=function(u,c){var f=(224&u[c+5])>>5,d=u[c+4]<<3;return 6144&u[c+3]|d|f},iv=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":!0&u[c]&&!(240&~u[c+1])?"audio":null},av=function(u){for(var c=0;c+5<u.length;){if(u[c]===255&&(246&u[c+1])==240)return Jg[(60&u[c+2])>>>2];c++}return null},sv=function(u){var c,f,d;c=10,64&u[5]&&(c+=4,c+=td(u.subarray(10,14)));do{if((f=td(u.subarray(c+4,c+8)))<1)return null;if(String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3])==="PRIV"){d=u.subarray(c+10,c+f+10);for(var m=0;m<d.byteLength;m++)if(d[m]===0){if(nv(d,0,m)==="com.apple.streaming.transportStreamTimestamp"){var T=d.subarray(m+1),x=(1&T[3])<<30|T[4]<<22|T[5]<<14|T[6]<<6|T[7]>>>2;return x*=4,x+=3&T[7]}break}}c+=10,c+=f}while(c<u.byteLength);return null},Va={isLikelyAacData:ev,parseId3TagSize:ed,parseAdtsSize:rv,parseType:iv,parseSampleRate:av,parseAacTimestamp:sv};Ha=function(){var u=new Uint8Array,c=0;Ha.prototype.init.call(this),this.setTimestamp=function(f){c=f},this.push=function(f){var d,m,T,x,q=0,j=0;for(u.length?(x=u.length,(u=new Uint8Array(f.byteLength+x)).set(u.subarray(0,x)),u.set(f,x)):u=f;u.length-j>=3;)if(u[j]!==73||u[j+1]!==68||u[j+2]!==51)if(255&~u[j]||240&~u[j+1])j++;else{if(u.length-j<7||j+(q=Va.parseAdtsSize(u,j))>u.length)break;T={type:"audio",data:u.subarray(j,j+q),pts:c,dts:c},this.trigger("data",T),j+=q}else{if(u.length-j<10||j+(q=Va.parseId3TagSize(u,j))>u.length)break;m={type:"timed-metadata",data:u.subarray(j,j+q)},this.trigger("data",m),j+=q}d=u.length-j,u=d>0?u.subarray(j):new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Ha.prototype=new At;var Wa,Pi,Ga,wr,ov=Ha,nd=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],rd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],uv=$g.H264Stream,lv=Va.isLikelyAacData,cv=ct.ONE_SECOND_IN_TS,dv=function(u,c){c.stream=u,this.trigger("log",c)},id=function(u,c){for(var f=Object.keys(c),d=0;d<f.length;d++){var m=f[d];m==="headOfPipeline"||!c[m].on||c[m].on("log",dv.bind(u,m))}},ad=function(u,c){var f;if(u.length!==c.length)return!1;for(f=0;f<u.length;f++)if(u[f]!==c[f])return!1;return!0},sd=function(u,c,f,d,m,T){return{start:{dts:u,pts:u+(f-c)},end:{dts:u+(d-c),pts:u+(m-f)},prependedContentDuration:T,baseMediaDecodeTime:u}};Pi=function(u,c){var f,d=[],m=0,T=0,x=1/0;f=(c=c||{}).firstSequenceNumber||0,Pi.prototype.init.call(this),this.push=function(q){Cn.collectDtsInfo(u,q),u&&nd.forEach(function(j){u[j]=q[j]}),d.push(q)},this.setEarliestDts=function(q){m=q},this.setVideoBaseMediaDecodeTime=function(q){x=q},this.setAudioAppendStart=function(q){T=q},this.flush=function(){var q,j,W,_e,Oe,Ve,Qe;d.length!==0?(q=Ia.trimAdtsFramesByEarliestDts(d,u,m),u.baseMediaDecodeTime=Cn.calculateTrackBaseMediaDecodeTime(u,c.keepOriginalTimestamps),Qe=Ia.prefixWithSilence(u,q,T,x),u.samples=Ia.generateSampleTable(q),W=Ci.mdat(Ia.concatenateFrameData(q)),d=[],j=Ci.moof(f,[u]),_e=new Uint8Array(j.byteLength+W.byteLength),f++,_e.set(j),_e.set(W,j.byteLength),Cn.clearDtsInfo(u),Oe=Math.ceil(1024*cv/u.samplerate),q.length&&(Ve=q.length*Oe,this.trigger("segmentTimingInfo",sd(ct.audioTsToVideoTs(u.baseMediaDecodeTime,u.samplerate),q[0].dts,q[0].pts,q[0].dts+Ve,q[0].pts+Ve,Qe||0)),this.trigger("timingInfo",{start:q[0].pts,end:q[0].pts+Ve})),this.trigger("data",{track:u,boxes:_e}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Cn.clearDtsInfo(u),d=[],this.trigger("reset")}},Pi.prototype=new At,Wa=function(u,c){var f,d,m,T=[],x=[];f=(c=c||{}).firstSequenceNumber||0,Wa.prototype.init.call(this),delete u.minPTS,this.gopCache_=[],this.push=function(q){Cn.collectDtsInfo(u,q),q.nalUnitType==="seq_parameter_set_rbsp"&&!d&&(d=q.config,u.sps=[q.data],rd.forEach(function(j){u[j]=d[j]},this)),q.nalUnitType==="pic_parameter_set_rbsp"&&!m&&(m=q.data,u.pps=[q.data]),T.push(q)},this.flush=function(){for(var q,j,W,_e,Oe,Ve,Qe,rt,lt=0;T.length&&T[0].nalUnitType!=="access_unit_delimiter_rbsp";)T.shift();if(T.length===0)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(q=xi.groupNalsIntoFrames(T),(W=xi.groupFramesIntoGops(q))[0][0].keyFrame||((j=this.getGopForFusion_(T[0],u))?(lt=j.duration,W.unshift(j),W.byteLength+=j.byteLength,W.nalCount+=j.nalCount,W.pts=j.pts,W.dts=j.dts,W.duration+=j.duration):W=xi.extendFirstKeyFrame(W)),x.length){var Kt;if(!(Kt=c.alignGopsAtEnd?this.alignGopsAtEnd_(W):this.alignGopsAtStart_(W)))return this.gopCache_.unshift({gop:W.pop(),pps:u.pps,sps:u.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Cn.clearDtsInfo(u),W=Kt}Cn.collectDtsInfo(u,W),u.samples=xi.generateSampleTable(W),Oe=Ci.mdat(xi.concatenateNalData(W)),u.baseMediaDecodeTime=Cn.calculateTrackBaseMediaDecodeTime(u,c.keepOriginalTimestamps),this.trigger("processedGopsInfo",W.map(function(xn){return{pts:xn.pts,dts:xn.dts,byteLength:xn.byteLength}})),Qe=W[0],rt=W[W.length-1],this.trigger("segmentTimingInfo",sd(u.baseMediaDecodeTime,Qe.dts,Qe.pts,rt.dts+rt.duration,rt.pts+rt.duration,lt)),this.trigger("timingInfo",{start:W[0].pts,end:W[W.length-1].pts+W[W.length-1].duration}),this.gopCache_.unshift({gop:W.pop(),pps:u.pps,sps:u.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.trigger("baseMediaDecodeTime",u.baseMediaDecodeTime),this.trigger("timelineStartInfo",u.timelineStartInfo),_e=Ci.moof(f,[u]),Ve=new Uint8Array(_e.byteLength+Oe.byteLength),f++,Ve.set(_e),Ve.set(Oe,_e.byteLength),this.trigger("data",{track:u,boxes:Ve}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),T=[],this.gopCache_.length=0,x.length=0,this.trigger("reset")},this.resetStream_=function(){Cn.clearDtsInfo(u),d=void 0,m=void 0},this.getGopForFusion_=function(q){var j,W,_e,Oe,Ve,Qe=45e3,rt=1e4,lt=1/0;for(Ve=0;Ve<this.gopCache_.length;Ve++)_e=(Oe=this.gopCache_[Ve]).gop,u.pps&&ad(u.pps[0],Oe.pps[0])&&u.sps&&ad(u.sps[0],Oe.sps[0])&&(_e.dts<u.timelineStartInfo.dts||(j=q.dts-_e.dts-_e.duration)>=-rt&&j<=Qe&&(!W||lt>j)&&(W=Oe,lt=j));return W?W.gop:null},this.alignGopsAtStart_=function(q){var j,W,_e,Oe,Ve,Qe,rt,lt;for(Ve=q.byteLength,Qe=q.nalCount,rt=q.duration,j=W=0;j<x.length&&W<q.length&&(_e=x[j],Oe=q[W],_e.pts!==Oe.pts);)Oe.pts>_e.pts?j++:(W++,Ve-=Oe.byteLength,Qe-=Oe.nalCount,rt-=Oe.duration);return W===0?q:W===q.length?null:((lt=q.slice(W)).byteLength=Ve,lt.duration=rt,lt.nalCount=Qe,lt.pts=lt[0].pts,lt.dts=lt[0].dts,lt)},this.alignGopsAtEnd_=function(q){var j,W,_e,Oe,Ve,Qe,rt;for(j=x.length-1,W=q.length-1,Ve=null,Qe=!1;j>=0&&W>=0;){if(_e=x[j],Oe=q[W],_e.pts===Oe.pts){Qe=!0;break}_e.pts>Oe.pts?j--:(j===x.length-1&&(Ve=W),W--)}if(!Qe&&Ve===null)return null;if((rt=Qe?W:Ve)===0)return q;var lt=q.slice(rt),Kt=lt.reduce(function(xn,ti){return xn.byteLength+=ti.byteLength,xn.duration+=ti.duration,xn.nalCount+=ti.nalCount,xn},{byteLength:0,duration:0,nalCount:0});return lt.byteLength=Kt.byteLength,lt.duration=Kt.duration,lt.nalCount=Kt.nalCount,lt.pts=lt[0].pts,lt.dts=lt[0].dts,lt},this.alignGopsWith=function(q){x=q}},Wa.prototype=new At,wr=function(u,c){this.numberOfTracks=0,this.metadataStream=c,(u=u||{}).remux!==void 0?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,wr.prototype.init.call(this),this.push=function(f){return f.text?this.pendingCaptions.push(f):f.frames?this.pendingMetadata.push(f):(this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),void(f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))))}},wr.prototype=new At,wr.prototype.flush=function(u){var c,f,d,m,T=0,x={captions:[],captionStreams:{},metadata:[],info:{}},q=0;if(this.pendingTracks.length<this.numberOfTracks){if(u!=="VideoSegmentStream"&&u!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(q=this.videoTrack.timelineStartInfo.pts,rd.forEach(function(j){x.info[j]=this.videoTrack[j]},this)):this.audioTrack&&(q=this.audioTrack.timelineStartInfo.pts,nd.forEach(function(j){x.info[j]=this.audioTrack[j]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?x.type=this.pendingTracks[0].type:x.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Ci.initSegment(this.pendingTracks),x.initSegment=new Uint8Array(d.byteLength),x.initSegment.set(d),x.data=new Uint8Array(this.pendingBytes),m=0;m<this.pendingBoxes.length;m++)x.data.set(this.pendingBoxes[m],T),T+=this.pendingBoxes[m].byteLength;for(m=0;m<this.pendingCaptions.length;m++)(c=this.pendingCaptions[m]).startTime=ct.metadataTsToSeconds(c.startPts,q,this.keepOriginalTimestamps),c.endTime=ct.metadataTsToSeconds(c.endPts,q,this.keepOriginalTimestamps),x.captionStreams[c.stream]=!0,x.captions.push(c);for(m=0;m<this.pendingMetadata.length;m++)(f=this.pendingMetadata[m]).cueTime=ct.metadataTsToSeconds(f.pts,q,this.keepOriginalTimestamps),x.metadata.push(f);for(x.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",x),m=0;m<x.captions.length;m++)c=x.captions[m],this.trigger("caption",c);for(m=0;m<x.metadata.length;m++)f=x.metadata[m],this.trigger("id3Frame",f)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},wr.prototype.setRemux=function(u){this.remuxTracks=u},Ga=function(u){var c,f,d=this,m=!0;Ga.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="aac",T.metadataStream=new nr.MetadataStream,T.aacStream=new ov,T.audioTimestampRolloverStream=new nr.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new nr.TimestampRolloverStream("timed-metadata"),T.adtsStream=new Jc,T.coalesceStream=new wr(u,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(x){T.aacStream.setTimestamp(x.timeStamp)}),T.aacStream.on("data",function(x){x.type!=="timed-metadata"&&x.type!=="audio"||T.audioSegmentStream||(f=f||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Pi(f,u),T.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream),d.trigger("trackinfo",{hasAudio:!!f,hasVideo:!!c}))}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),id(this,T)},this.setupTsPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="ts",T.metadataStream=new nr.MetadataStream,T.packetStream=new nr.TransportPacketStream,T.parseStream=new nr.TransportParseStream,T.elementaryStream=new nr.ElementaryStream,T.timestampRolloverStream=new nr.TimestampRolloverStream,T.adtsStream=new Jc,T.h264Stream=new uv,T.captionStream=new nr.CaptionStream(u),T.coalesceStream=new wr(u,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(x){var q;if(x.type==="metadata"){for(q=x.tracks.length;q--;)c||x.tracks[q].type!=="video"?!f&&x.tracks[q].type==="audio"&&((f=x.tracks[q]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(c=x.tracks[q]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;c&&!T.videoSegmentStream&&(T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new Wa(c,u),T.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),T.videoSegmentStream.on("timelineStartInfo",function(j){f&&!u.keepOriginalTimestamps&&(f.timelineStartInfo=j,T.audioSegmentStream.setEarliestDts(j.dts-d.baseMediaDecodeTime))}),T.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(j){f&&T.audioSegmentStream.setVideoBaseMediaDecodeTime(j)}),T.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream)),f&&!T.audioSegmentStream&&(T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Pi(f,u),T.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),T.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!f,hasVideo:!!c})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(x){x.dispatchType=T.metadataStream.dispatchType,d.trigger("id3Frame",x)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),id(this,T)},this.setBaseMediaDecodeTime=function(T){var x=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=T),f&&(f.timelineStartInfo.dts=void 0,f.timelineStartInfo.pts=void 0,Cn.clearDtsInfo(f),x.audioTimestampRolloverStream&&x.audioTimestampRolloverStream.discontinuity()),c&&(x.videoSegmentStream&&(x.videoSegmentStream.gopCache_=[]),c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Cn.clearDtsInfo(c),x.captionStream.reset()),x.timestampRolloverStream&&x.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){f&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var x=this.transmuxPipeline_;u.remux=T,x&&x.coalesceStream&&x.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){c&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.getLogTrigger_=function(T){var x=this;return function(q){q.stream=T,x.trigger("log",q)}},this.push=function(T){if(m){var x=lv(T);x&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!x&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){m=!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()}},Ga.prototype=new At;var od,ud,ld,cd,dd,Do,hv={Transmuxer:Ga},pv=function(u){return u>>>0},fv=function(u){return("00"+u.toString(16)).slice(-2)},za={toUnsigned:pv,toHexString:fv},mv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3])},kr=mv,gv=za.toUnsigned,vv=function u(c,f){var d,m,T,x,q,j=[];if(!f.length)return null;for(d=0;d<c.byteLength;)m=gv(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3]),T=kr(c.subarray(d+4,d+8)),x=m>1?d+m:c.byteLength,T===f[0]&&(f.length===1?j.push(c.subarray(d+8,x)):(q=u(c.subarray(d+8,x),f.slice(1))).length&&(j=j.concat(q))),d=x;return j},yt=vv,yv=za.toUnsigned,_v=cr.getUint64,bv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=_v(u.subarray(4)):c.baseMediaDecodeTime=yv(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},hd=bv,Tv=function(u){return{isLeading:(12&u[0])>>>2,dependsOn:3&u[0],isDependedOn:(192&u[1])>>>6,hasRedundancy:(48&u[1])>>>4,paddingValue:(14&u[1])>>>1,isNonSyncSample:1&u[1],degradationPriority:u[2]<<8|u[3]}},pd=Tv,Sv=function(u){var c,f={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},d=new DataView(u.buffer,u.byteOffset,u.byteLength),m=1&f.flags[2],T=4&f.flags[2],x=1&f.flags[1],q=2&f.flags[1],j=4&f.flags[1],W=8&f.flags[1],_e=d.getUint32(4),Oe=8;for(m&&(f.dataOffset=d.getInt32(Oe),Oe+=4),T&&_e&&(c={flags:pd(u.subarray(Oe,Oe+4))},Oe+=4,x&&(c.duration=d.getUint32(Oe),Oe+=4),q&&(c.size=d.getUint32(Oe),Oe+=4),W&&(f.version===1?c.compositionTimeOffset=d.getInt32(Oe):c.compositionTimeOffset=d.getUint32(Oe),Oe+=4),f.samples.push(c),_e--);_e--;)c={},x&&(c.duration=d.getUint32(Oe),Oe+=4),q&&(c.size=d.getUint32(Oe),Oe+=4),j&&(c.flags=pd(u.subarray(Oe,Oe+4)),Oe+=4),W&&(f.version===1?c.compositionTimeOffset=d.getInt32(Oe):c.compositionTimeOffset=d.getUint32(Oe),Oe+=4),f.samples.push(c);return f},fd=Sv,Ev=function(u){var c,f=new DataView(u.buffer,u.byteOffset,u.byteLength),d={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:f.getUint32(4)},m=1&d.flags[2],T=2&d.flags[2],x=8&d.flags[2],q=16&d.flags[2],j=32&d.flags[2],W=65536&d.flags[0],_e=131072&d.flags[0];return c=8,m&&(c+=4,d.baseDataOffset=f.getUint32(12),c+=4),T&&(d.sampleDescriptionIndex=f.getUint32(c),c+=4),x&&(d.defaultSampleDuration=f.getUint32(c),c+=4),q&&(d.defaultSampleSize=f.getUint32(c),c+=4),j&&(d.defaultSampleFlags=f.getUint32(c)),W&&(d.durationIsEmpty=!0),!m&&_e&&(d.baseDataOffsetIsMoof=!0),d},md=Ev,gd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:Ae.g!==void 0?Ae.g:typeof self<"u"?self:{},Oi=typeof window<"u"?window:gd!==void 0?gd:typeof self<"u"?self:{},wv=Ii.discardEmulationPreventionBytes,kv=La.CaptionStream,Cv=function(u,c){for(var f=u,d=0;d<c.length;d++){var m=c[d];if(f<m.size)return m;f-=m.size}return null},xv=function(u,c,f){var d,m,T,x,q=new DataView(u.buffer,u.byteOffset,u.byteLength),j={logs:[],seiNals:[]};for(m=0;m+4<u.length;m+=T)if(T=q.getUint32(m),m+=4,!(T<=0))switch(31&u[m]){case 6:var W=u.subarray(m+1,m+1+T),_e=Cv(m,c);if(d={nalUnitType:"sei_rbsp",size:T,data:W,escapedRBSP:wv(W),trackId:f},_e)d.pts=_e.pts,d.dts=_e.dts,x=_e;else{if(!x){j.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+m+" for trackId "+f+". See mux.js#223."});break}d.pts=x.pts,d.dts=x.dts}j.seiNals.push(d)}return j},Iv=function(u,c,f){var d=c,m=f.defaultSampleDuration||0,T=f.defaultSampleSize||0,x=f.trackId,q=[];return u.forEach(function(j){var W=fd(j).samples;W.forEach(function(_e){_e.duration===void 0&&(_e.duration=m),_e.size===void 0&&(_e.size=T),_e.trackId=x,_e.dts=d,_e.compositionTimeOffset===void 0&&(_e.compositionTimeOffset=0),typeof d=="bigint"?(_e.pts=d+Oi.BigInt(_e.compositionTimeOffset),d+=Oi.BigInt(_e.duration)):(_e.pts=d+_e.compositionTimeOffset,d+=_e.duration)}),q=q.concat(W)}),q},Av=function(u,c){var f=yt(u,["moof","traf"]),d=yt(u,["mdat"]),m={},T=[];return d.forEach(function(x,q){var j=f[q];T.push({mdat:x,traf:j})}),T.forEach(function(x){var q,j,W=x.mdat,_e=x.traf,Oe=yt(_e,["tfhd"]),Ve=md(Oe[0]),Qe=Ve.trackId,rt=yt(_e,["tfdt"]),lt=rt.length>0?hd(rt[0]).baseMediaDecodeTime:0,Kt=yt(_e,["trun"]);c===Qe&&Kt.length>0&&(q=Iv(Kt,lt,Ve),j=xv(W,q,Qe),m[Qe]||(m[Qe]={seiNals:[],logs:[]}),m[Qe].seiNals=m[Qe].seiNals.concat(j.seiNals),m[Qe].logs=m[Qe].logs.concat(j.logs))}),m},Pv=function(u,c,f){if(c===null)return null;var d=Av(u,c)[c]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:f}},Ov=function(){var u,c,f,d,m,T,x=!1;this.isInitialized=function(){return x},this.init=function(q){u=new kv,x=!0,T=!!q&&q.isPartial,u.on("data",function(j){j.startTime=j.startPts/d,j.endTime=j.endPts/d,m.captions.push(j),m.captionStreams[j.stream]=!0}),u.on("log",function(j){m.logs.push(j)})},this.isNewInit=function(q,j){return!(q&&q.length===0||j&&typeof j=="object"&&Object.keys(j).length===0||f===q[0]&&d===j[f])},this.parse=function(q,j,W){var _e;if(!this.isInitialized()||!j||!W)return null;if(this.isNewInit(j,W))f=j[0],d=W[f];else if(f===null||!d)return c.push(q),null;for(;c.length>0;){var Oe=c.shift();this.parse(Oe,j,W)}return(_e=Pv(q,f,d))&&_e.logs&&(m.logs=m.logs.concat(_e.logs)),_e!==null&&_e.seiNals?(this.pushNals(_e.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(q){if(!this.isInitialized()||!q||q.length===0)return null;q.forEach(function(j){u.push(j)})},this.flushStream=function(){if(!this.isInitialized())return null;T?u.partialFlush():u.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;u.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){c=[],f=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Dv=Ov,Xa=za.toUnsigned,Di=za.toHexString,Lv=cr.getUint64;od=function(u){var c={};return yt(u,["moov","trak"]).reduce(function(f,d){var m,T,x,q,j;return(m=yt(d,["tkhd"])[0])&&(T=m[0],q=Xa(m[x=T===0?12:20]<<24|m[x+1]<<16|m[x+2]<<8|m[x+3]),j=yt(d,["mdia","mdhd"])[0])?(x=(T=j[0])===0?12:20,f[q]=Xa(j[x]<<24|j[x+1]<<16|j[x+2]<<8|j[x+3]),f):null},c)},ud=function(u,c){var f=yt(c,["moof","traf"]).reduce(function(d,m){var T,x,q=yt(m,["tfhd"])[0],j=Xa(q[4]<<24|q[5]<<16|q[6]<<8|q[7]),W=u[j]||9e4,_e=yt(m,["tfdt"])[0],Oe=new DataView(_e.buffer,_e.byteOffset,_e.byteLength);return typeof(T=_e[0]===1?Lv(_e.subarray(4,12)):Oe.getUint32(4))=="bigint"?x=T/Oi.BigInt(W):typeof T=="number"&&!isNaN(T)&&(x=T/W),x<Number.MAX_SAFE_INTEGER&&(x=Number(x)),x<d&&(d=x),d},1/0);return typeof f=="bigint"||isFinite(f)?f:0},ld=function(u,c){var f,d=yt(c,["moof","traf"]),m=0,T=0;if(d&&d.length){var x=yt(d[0],["tfhd"])[0],q=yt(d[0],["trun"])[0],j=yt(d[0],["tfdt"])[0];if(x&&(f=md(x).trackId),j&&(m=hd(j).baseMediaDecodeTime),q){var W=fd(q);W.samples&&W.samples.length&&(T=W.samples[0].compositionTimeOffset||0)}}var _e=u[f]||9e4;typeof m=="bigint"&&(T=Oi.BigInt(T),_e=Oi.BigInt(_e));var Oe=(m+T)/_e;return typeof Oe=="bigint"&&Oe<Number.MAX_SAFE_INTEGER&&(Oe=Number(Oe)),Oe},cd=function(u){var c=yt(u,["moov","trak"]),f=[];return c.forEach(function(d){var m=yt(d,["mdia","hdlr"]),T=yt(d,["tkhd"]);m.forEach(function(x,q){var j,W,_e=kr(x.subarray(8,12)),Oe=T[q];_e==="vide"&&(W=(j=new DataView(Oe.buffer,Oe.byteOffset,Oe.byteLength)).getUint8(0)===0?j.getUint32(12):j.getUint32(20),f.push(W))})}),f},Do=function(u){var c=u[0]===0?12:20;return Xa(u[c]<<24|u[c+1]<<16|u[c+2]<<8|u[c+3])},dd=function(u){var c=yt(u,["moov","trak"]),f=[];return c.forEach(function(d){var m,T,x={},q=yt(d,["tkhd"])[0];q&&(T=(m=new DataView(q.buffer,q.byteOffset,q.byteLength)).getUint8(0),x.id=T===0?m.getUint32(12):m.getUint32(20));var j=yt(d,["mdia","hdlr"])[0];if(j){var W=kr(j.subarray(8,12));x.type=W==="vide"?"video":W==="soun"?"audio":W}var _e=yt(d,["mdia","minf","stbl","stsd"])[0];if(_e){var Oe=_e.subarray(8);x.codec=kr(Oe.subarray(4,8));var Ve,Qe=yt(Oe,[x.codec])[0];Qe&&(/^[asm]vc[1-9]$/i.test(x.codec)?(Ve=Qe.subarray(78),kr(Ve.subarray(4,8))==="avcC"&&Ve.length>11?(x.codec+=".",x.codec+=Di(Ve[9]),x.codec+=Di(Ve[10]),x.codec+=Di(Ve[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(Ve=Qe.subarray(28),kr(Ve.subarray(4,8))==="esds"&&Ve.length>20&&Ve[19]!==0?(x.codec+="."+Di(Ve[19]),x.codec+="."+Di(Ve[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var rt=yt(d,["mdia","mdhd"])[0];rt&&(x.timescale=Do(rt)),f.push(x)}),f};var vd={findBox:yt,parseType:kr,timescale:od,startTime:ud,compositionStartTime:ld,videoTrackIds:cd,tracks:dd,getTimescaleFromMediaHeader:Do},yd=function(u){var c=31&u[1];return c<<=8,c|=u[2]},Ka=function(u){return!!(64&u[1])},Qa=function(u){var c=0;return(48&u[3])>>>4>1&&(c+=u[4]+1),c},Mv=function(u,c){var f=yd(u);return f===0?"pat":f===c?"pmt":c?"pes":null},Rv=function(u){var c=Ka(u),f=4+Qa(u);return c&&(f+=u[f]+1),(31&u[f+10])<<8|u[f+11]},Nv=function(u){var c={},f=Ka(u),d=4+Qa(u);if(f&&(d+=u[d]+1),1&u[d+5]){var m;m=3+((15&u[d+1])<<8|u[d+2])-4;for(var T=12+((15&u[d+10])<<8|u[d+11]);T<m;){var x=d+T;c[(31&u[x+1])<<8|u[x+2]]=u[x],T+=5+((15&u[x+3])<<8|u[x+4])}return c}},Uv=function(u,c){switch(c[yd(u)]){case Wt.H264_STREAM_TYPE:return"video";case Wt.ADTS_STREAM_TYPE:return"audio";case Wt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Bv=function(u){if(!Ka(u))return null;var c=4+Qa(u);if(c>=u.byteLength)return null;var f,d=null;return 192&(f=u[c+7])&&((d={}).pts=(14&u[c+9])<<27|(255&u[c+10])<<20|(254&u[c+11])<<12|(255&u[c+12])<<5|(254&u[c+13])>>>3,d.pts*=4,d.pts+=(6&u[c+13])>>>1,d.dts=d.pts,64&f&&(d.dts=(14&u[c+14])<<27|(255&u[c+15])<<20|(254&u[c+16])<<12|(255&u[c+17])<<5|(254&u[c+18])>>>3,d.dts*=4,d.dts+=(6&u[c+18])>>>1)),d},Lo=function(u){switch(u){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}},jv=function(u){for(var c=4+Qa(u),f=u.subarray(c),d=0,m=0,T=!1;m<f.byteLength-3;m++)if(f[m+2]===1){d=m+5;break}for(;d<f.byteLength;)switch(f[d]){case 0:if(f[d-1]!==0){d+=2;break}if(f[d-2]!==0){d++;break}m+3!==d-2&&Lo(31&f[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0);do d++;while(f[d]!==1&&d<f.length);m=d-2,d+=3;break;case 1:if(f[d-1]!==0||f[d-2]!==0){d+=3;break}Lo(31&f[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),m=d-2,d+=3;break;default:d+=3}return f=f.subarray(m),d-=m,m=0,f&&f.byteLength>3&&Lo(31&f[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),T},Fv={parseType:Mv,parsePat:Rv,parsePmt:Nv,parsePayloadUnitStartIndicator:Ka,parsePesType:Uv,parsePesTime:Bv,videoPacketContainsKeyFrame:jv},ei=zc.handleRollover,ht={};ht.ts=Fv,ht.aac=Va;var Cr=ct.ONE_SECOND_IN_TS,tn=188,Un=71,qv=function(u,c){for(var f,d=0,m=tn;m<u.byteLength;)if(u[d]!==Un||u[m]!==Un)d++,m++;else{switch(f=u.subarray(d,m),ht.ts.parseType(f,c.pid)){case"pat":c.pid=ht.ts.parsePat(f);break;case"pmt":var T=ht.ts.parsePmt(f);c.table=c.table||{},Object.keys(T).forEach(function(x){c.table[x]=T[x]})}d+=tn,m+=tn}},_d=function(u,c,f){for(var d,m,T,x,q=0,j=tn,W=!1;j<=u.byteLength;)if(u[q]!==Un||u[j]!==Un&&j!==u.byteLength)q++,j++;else{if(d=u.subarray(q,j),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&T&&(x=ht.ts.parsePesTime(d))&&(x.type="audio",f.audio.push(x),W=!0)),W)break;q+=tn,j+=tn}for(q=(j=u.byteLength)-tn,W=!1;q>=0;)if(u[q]!==Un||u[j]!==Un&&j!==u.byteLength)q--,j--;else{if(d=u.subarray(q,j),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&T&&(x=ht.ts.parsePesTime(d))&&(x.type="audio",f.audio.push(x),W=!0)),W)break;q-=tn,j-=tn}},Hv=function(u,c,f){for(var d,m,T,x,q,j,W,_e=0,Oe=tn,Ve=!1,Qe={data:[],size:0};Oe<u.byteLength;)if(u[_e]!==Un||u[Oe]!==Un)_e++,Oe++;else{if(d=u.subarray(_e,Oe),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="video"&&(T&&!Ve&&(x=ht.ts.parsePesTime(d))&&(x.type="video",f.video.push(x),Ve=!0),!f.firstKeyFrame))){if(T&&Qe.size!==0){for(q=new Uint8Array(Qe.size),j=0;Qe.data.length;)W=Qe.data.shift(),q.set(W,j),j+=W.byteLength;if(ht.ts.videoPacketContainsKeyFrame(q)){var rt=ht.ts.parsePesTime(q);rt?(f.firstKeyFrame=rt,f.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.")}Qe.size=0}Qe.data.push(d),Qe.size+=d.byteLength}if(Ve&&f.firstKeyFrame)break;_e+=tn,Oe+=tn}for(_e=(Oe=u.byteLength)-tn,Ve=!1;_e>=0;)if(u[_e]!==Un||u[Oe]!==Un)_e--,Oe--;else{if(d=u.subarray(_e,Oe),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="video"&&T&&(x=ht.ts.parsePesTime(d))&&(x.type="video",f.video.push(x),Ve=!0)),Ve)break;_e-=tn,Oe-=tn}},Vv=function(u,c){if(u.audio&&u.audio.length){var f=c;(f===void 0||isNaN(f))&&(f=u.audio[0].dts),u.audio.forEach(function(T){T.dts=ei(T.dts,f),T.pts=ei(T.pts,f),T.dtsTime=T.dts/Cr,T.ptsTime=T.pts/Cr})}if(u.video&&u.video.length){var d=c;if((d===void 0||isNaN(d))&&(d=u.video[0].dts),u.video.forEach(function(T){T.dts=ei(T.dts,d),T.pts=ei(T.pts,d),T.dtsTime=T.dts/Cr,T.ptsTime=T.pts/Cr}),u.firstKeyFrame){var m=u.firstKeyFrame;m.dts=ei(m.dts,d),m.pts=ei(m.pts,d),m.dtsTime=m.dts/Cr,m.ptsTime=m.pts/Cr}}},Wv=function(u){for(var c,f=!1,d=0,m=null,T=null,x=0,q=0;u.length-q>=3;){switch(ht.aac.parseType(u,q)){case"timed-metadata":if(u.length-q<10){f=!0;break}if((x=ht.aac.parseId3TagSize(u,q))>u.length){f=!0;break}T===null&&(c=u.subarray(q,q+x),T=ht.aac.parseAacTimestamp(c)),q+=x;break;case"audio":if(u.length-q<7){f=!0;break}if((x=ht.aac.parseAdtsSize(u,q))>u.length){f=!0;break}m===null&&(c=u.subarray(q,q+x),m=ht.aac.parseSampleRate(c)),d++,q+=x;break;default:q++}if(f)return null}if(m===null||T===null)return null;var j=Cr/m;return{audio:[{type:"audio",dts:T,pts:T},{type:"audio",dts:T+1024*d*j,pts:T+1024*d*j}]}},Gv=function(u){var c={pid:null,table:null},f={};for(var d in qv(u,c),c.table)if(c.table.hasOwnProperty(d))switch(c.table[d]){case Wt.H264_STREAM_TYPE:f.video=[],Hv(u,c,f),f.video.length===0&&delete f.video;break;case Wt.ADTS_STREAM_TYPE:f.audio=[],_d(u,c,f),f.audio.length===0&&delete f.audio}return f},zv=function(u,c){var f;return(f=ht.aac.isLikelyAacData(u)?Wv(u):Gv(u))&&(f.audio||f.video)?(Vv(f,c),f):null},Xv={inspect:zv,parseAudioPes_:_d},Kv=function(u,c){c.on("data",function(f){var d=f.initSegment;f.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};var m=f.data;f.data=m.buffer,u.postMessage({action:"data",segment:f,byteOffset:m.byteOffset,byteLength:m.byteLength},[f.data])}),c.on("done",function(f){u.postMessage({action:"done"})}),c.on("gopInfo",function(f){u.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){var d={start:{decode:ct.videoTsToSeconds(f.start.dts),presentation:ct.videoTsToSeconds(f.start.pts)},end:{decode:ct.videoTsToSeconds(f.end.dts),presentation:ct.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:ct.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=ct.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(f){var d={start:{decode:ct.videoTsToSeconds(f.start.dts),presentation:ct.videoTsToSeconds(f.start.pts)},end:{decode:ct.videoTsToSeconds(f.end.dts),presentation:ct.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:ct.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=ct.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(f){u.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){u.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){u.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ct.videoTsToSeconds(f.start),end:ct.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ct.videoTsToSeconds(f.start),end:ct.videoTsToSeconds(f.end)}})}),c.on("log",function(f){u.postMessage({action:"log",log:f})})},bd=function(){function u(f,d){this.options=d||{},this.self=f,this.init()}var c=u.prototype;return c.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new hv.Transmuxer(this.options),Kv(this.self,this.transmuxer)},c.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Dv,this.captionParser.init());var d=new Uint8Array(f.data,f.byteOffset,f.byteLength),m=this.captionParser.parse(d,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:m&&m.captions||[],logs:m&&m.logs||[],data:d.buffer},[d.buffer])},c.probeMp4StartTime=function(f){var d=f.timescales,m=f.data,T=vd.startTime(d,m);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:m},[m.buffer])},c.probeMp4Tracks=function(f){var d=f.data,m=vd.tracks(d);this.self.postMessage({action:"probeMp4Tracks",tracks:m,data:d},[d.buffer])},c.probeTs=function(f){var d=f.data,m=f.baseStartTime,T=typeof m!="number"||isNaN(m)?void 0:m*ct.ONE_SECOND_IN_TS,x=Xv.inspect(d,T),q=null;x&&((q={hasVideo:x.video&&x.video.length===2||!1,hasAudio:x.audio&&x.audio.length===2||!1}).hasVideo&&(q.videoStart=x.video[0].ptsTime),q.hasAudio&&(q.audioStart=x.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:q,data:d},[d.buffer])},c.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},c.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},c.push=function(f){var d=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(d)},c.reset=function(){this.transmuxer.reset()},c.setTimestampOffset=function(f){var d=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ct.secondsToVideoTs(d)))},c.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(ct.secondsToVideoTs(f.appendStart)))},c.setRemux=function(f){this.transmuxer.setRemux(f.remux)},c.flush=function(f){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},c.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},c.alignGopsWith=function(f){this.transmuxer.alignGopsWith(f.gopsToAlignWith.slice())},u}();self.onmessage=function(u){u.data.action==="init"&&u.data.options?this.messageHandlers=new bd(self,u.data.options):(this.messageHandlers||(this.messageHandlers=new bd(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data))}})),Nf=rc(Rf),Uf=function(t,i,r){var e=t.data.segment,n=e.type,a=e.initSegment,s=e.captions,o=e.captionStreams,l=e.metadata,h=e.videoFrameDtsTime,g=e.videoFramePtsTime;i.buffer.push({captions:s,captionStreams:o,metadata:l});var b=t.data.segment.boxes||{data:t.data.segment.data},_={type:n,data:new Uint8Array(b.data,b.data.byteOffset,b.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};h!==void 0&&(_.videoFrameDtsTime=h),g!==void 0&&(_.videoFramePtsTime=g),r(_)},Bf=function(t){var i=t.transmuxedData,r=t.callback;i.buffer=[],r(i)},jf=function(t,i){i.gopInfo=t.data.gopInfo},sc=function(t){var i=t.transmuxer,r=t.bytes,e=t.audioAppendStart,n=t.gopsToAlignWith,a=t.remux,s=t.onData,o=t.onTrackInfo,l=t.onAudioTimingInfo,h=t.onVideoTimingInfo,g=t.onVideoSegmentTimingInfo,b=t.onAudioSegmentTimingInfo,_=t.onId3,G=t.onCaptions,ne=t.onDone,ye=t.onEndedTimeline,re=t.onTransmuxerLog,Ue=t.isEndOfTimeline,Ge={buffer:[]},be=Ue,De=function(Ce){i.currentTransmux===t&&(Ce.data.action==="data"&&Uf(Ce,Ge,s),Ce.data.action==="trackinfo"&&o(Ce.data.trackInfo),Ce.data.action==="gopInfo"&&jf(Ce,Ge),Ce.data.action==="audioTimingInfo"&&l(Ce.data.audioTimingInfo),Ce.data.action==="videoTimingInfo"&&h(Ce.data.videoTimingInfo),Ce.data.action==="videoSegmentTimingInfo"&&g(Ce.data.videoSegmentTimingInfo),Ce.data.action==="audioSegmentTimingInfo"&&b(Ce.data.audioSegmentTimingInfo),Ce.data.action==="id3Frame"&&_([Ce.data.id3Frame],Ce.data.id3Frame.dispatchType),Ce.data.action==="caption"&&G(Ce.data.caption),Ce.data.action==="endedtimeline"&&(be=!1,ye()),Ce.data.action==="log"&&re(Ce.data.log),Ce.data.type==="transmuxed"&&(be||(i.onmessage=null,Bf({transmuxedData:Ge,callback:ne}),oc(i))))};if(i.onmessage=De,e&&i.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(n)&&i.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),a!==void 0&&i.postMessage({action:"setRemux",remux:a}),r.byteLength){var Se=r instanceof ArrayBuffer?r:r.buffer,Me=r instanceof ArrayBuffer?0:r.byteOffset;i.postMessage({action:"push",data:Se,byteOffset:Me,byteLength:r.byteLength},[Se])}Ue&&i.postMessage({action:"endTimeline"}),i.postMessage({action:"flush"})},oc=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():sc(t.currentTransmux))},uc=function(t,i){t.postMessage({action:i}),oc(t)},lc=function(t,i){if(!i.currentTransmux)return i.currentTransmux=t,void uc(i,t);i.transmuxQueue.push(uc.bind(null,i,t))},Ff=function(t){lc("reset",t)},qf=function(t){lc("endTimeline",t)},cc=function(t){if(!t.transmuxer.currentTransmux)return t.transmuxer.currentTransmux=t,void sc(t);t.transmuxer.transmuxQueue.push(t)},Hf=function(t){var i=new Nf;i.currentTransmux=null,i.transmuxQueue=[];var r=i.terminate;return i.terminate=function(){return i.currentTransmux=null,i.transmuxQueue.length=0,r.call(i)},i.postMessage({action:"init",options:t}),i},fo={reset:Ff,endTimeline:qf,transmux:cc,createTransmuxer:Hf},_a=function(t){var i=t.transmuxer,r=t.endAction||t.action,e=t.callback,n=we({},t,{endAction:null,transmuxer:null,callback:null}),a=function l(h){h.data.action===r&&(i.removeEventListener("message",l),h.data.data&&(h.data.data=new Uint8Array(h.data.data,t.byteOffset||0,t.byteLength||h.data.data.byteLength),t.data&&(t.data=h.data.data)),e(h.data))};if(i.addEventListener("message",a),t.data){var s=t.data instanceof ArrayBuffer;n.byteOffset=s?0:t.data.byteOffset,n.byteLength=t.data.byteLength;var o=[s?t.data:t.data.buffer];i.postMessage(n,o)}else i.postMessage(n)},Rn={FAILURE:2,TIMEOUT:-101,ABORTED:-102},mo=function(t){t.forEach(function(i){i.abort()})},Vf=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},Wf=function(t){var i=t.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0};return r.bytesReceived=t.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},go=function(t,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:Rn.TIMEOUT,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:Rn.ABORTED,xhr:i}:t?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Rn.FAILURE,xhr:i}:i.responseType==="arraybuffer"&&i.response.byteLength===0?{status:i.status,message:"Empty HLS response at URL: "+i.uri,code:Rn.FAILURE,xhr:i}:null},dc=function(t,i,r){return function(e,n){var a=n.response,s=go(e,n);if(s)return r(s,t);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Rn.FAILURE,xhr:n},t);for(var o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),h=0;h<i.length;h++)i[h].bytes=l;return r(null,t)}},hc=function(t,i){var r=ts(t.map.bytes);if(r!=="mp4"){var e=t.map.resolvedUri||t.map.uri;return i({internal:!0,message:"Found unsupported "+(r||"unknown")+" container for initialization segment at URL: "+e,code:Rn.FAILURE})}_a({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:function(n){var a=n.tracks,s=n.data;return t.map.bytes=s,a.forEach(function(o){t.map.tracks=t.map.tracks||{},!t.map.tracks[o.type]&&(t.map.tracks[o.type]=o,typeof o.id=="number"&&o.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[o.id]=o.timescale))}),i(null)}})},Gf=function(t){var i=t.segment,r=t.finishProcessingFn;return function(e,n){var a=go(e,n);if(a)return r(a,i);var s=new Uint8Array(n.response);if(i.map.key)return i.map.encryptedBytes=s,r(null,i);i.map.bytes=s,hc(i,function(o){if(o)return o.xhr=n,o.status=n.status,r(o,i);r(null,i)})}},zf=function(t){var i=t.segment,r=t.finishProcessingFn,e=t.responseType;return function(n,a){var s=go(n,a);if(s)return r(s,i);var o=e!=="arraybuffer"&&a.responseText?Lf(a.responseText.substring(i.lastReachedChar||0)):a.response;return i.stats=Vf(a),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),r(null,i)}},Xf=function(t){var i=t.segment,r=t.bytes,e=t.trackInfoFn,n=t.timingInfoFn,a=t.videoSegmentTimingInfoFn,s=t.audioSegmentTimingInfoFn,o=t.id3Fn,l=t.captionsFn,h=t.isEndOfTimeline,g=t.endedTimelineFn,b=t.dataFn,_=t.doneFn,G=t.onTransmuxerLog,ne=i.map&&i.map.tracks||{},ye=!!(ne.audio&&ne.video),re=n.bind(null,i,"audio","start"),Ue=n.bind(null,i,"audio","end"),Ge=n.bind(null,i,"video","start"),be=n.bind(null,i,"video","end"),De=function(){return cc({bytes:r,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:ye,onData:function(Se){Se.type=Se.type==="combined"?"video":Se.type,b(i,Se)},onTrackInfo:function(Se){e&&(ye&&(Se.isMuxed=!0),e(i,Se))},onAudioTimingInfo:function(Se){re&&Se.start!==void 0&&(re(Se.start),re=null),Ue&&Se.end!==void 0&&Ue(Se.end)},onVideoTimingInfo:function(Se){Ge&&Se.start!==void 0&&(Ge(Se.start),Ge=null),be&&Se.end!==void 0&&be(Se.end)},onVideoSegmentTimingInfo:function(Se){a(Se)},onAudioSegmentTimingInfo:function(Se){s(Se)},onId3:function(Se,Me){o(i,Se,Me)},onCaptions:function(Se){l(i,[Se])},isEndOfTimeline:h,onEndedTimeline:function(){g()},onTransmuxerLog:G,onDone:function(Se){!_||(Se.type=Se.type==="combined"?"video":Se.type,_(null,i,Se))}})};_a({action:"probeTs",transmuxer:i.transmuxer,data:r,baseStartTime:i.baseStartTime,callback:function(Se){i.bytes=r=Se.data;var Me=Se.result;Me&&(e(i,{hasAudio:Me.hasAudio,hasVideo:Me.hasVideo,isMuxed:ye}),e=null,Me.hasAudio&&!ye&&re(Me.audioStart),Me.hasVideo&&Ge(Me.videoStart),re=null,Ge=null),De()}})},pc=function(t){var i=t.segment,r=t.bytes,e=t.trackInfoFn,n=t.timingInfoFn,a=t.videoSegmentTimingInfoFn,s=t.audioSegmentTimingInfoFn,o=t.id3Fn,l=t.captionsFn,h=t.isEndOfTimeline,g=t.endedTimelineFn,b=t.dataFn,_=t.doneFn,G=t.onTransmuxerLog,ne=new Uint8Array(r);if(mh(ne)){i.isFmp4=!0;var ye=i.map.tracks,re={isFmp4:!0,hasVideo:!!ye.video,hasAudio:!!ye.audio};ye.audio&&ye.audio.codec&&ye.audio.codec!=="enca"&&(re.audioCodec=ye.audio.codec),ye.video&&ye.video.codec&&ye.video.codec!=="encv"&&(re.videoCodec=ye.video.codec),ye.video&&ye.audio&&(re.isMuxed=!0),e(i,re);var Ue=function(Ge){b(i,{data:ne,type:re.hasAudio&&!re.isMuxed?"audio":"video"}),Ge&&Ge.length&&l(i,Ge),_(null,i,{})};_a({action:"probeMp4StartTime",timescales:i.map.timescales,data:ne,transmuxer:i.transmuxer,callback:function(Ge){var be=Ge.data,De=Ge.startTime;r=be.buffer,i.bytes=ne=be,re.hasAudio&&!re.isMuxed&&n(i,"audio","start",De),re.hasVideo&&n(i,"video","start",De),ye.video&&be.byteLength&&i.transmuxer?_a({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:ne,timescales:i.map.timescales,trackIds:[ye.video.id],callback:function(Se){r=Se.data.buffer,i.bytes=ne=Se.data,Se.logs.forEach(function(Me){G(he.mergeOptions(Me,{stream:"mp4CaptionParser"}))}),Ue(Se.captions)}}):Ue()}})}else{if(i.transmuxer)return i.container===void 0&&(i.container=ts(ne)),i.container!=="ts"&&i.container!=="aac"?(e(i,{hasAudio:!1,hasVideo:!1}),void _(null,i,{})):void Xf({segment:i,bytes:r,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:g,dataFn:b,doneFn:_,onTransmuxerLog:G});_(null,i,{})}},fc=function(t,i){var r,e=t.id,n=t.key,a=t.encryptedBytes,s=t.decryptionWorker,o=function l(h){if(h.data.source===e){s.removeEventListener("message",l);var g=h.data.decrypted;i(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};s.addEventListener("message",o),r=n.bytes.slice?n.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.bytes)),s.postMessage(Kl({source:e,encrypted:a,key:r,iv:n.iv}),[a.buffer,r.buffer])},Kf=function(t){var i=t.decryptionWorker,r=t.segment,e=t.trackInfoFn,n=t.timingInfoFn,a=t.videoSegmentTimingInfoFn,s=t.audioSegmentTimingInfoFn,o=t.id3Fn,l=t.captionsFn,h=t.isEndOfTimeline,g=t.endedTimelineFn,b=t.dataFn,_=t.doneFn,G=t.onTransmuxerLog;fc({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:i},function(ne){r.bytes=ne,pc({segment:r,bytes:r.bytes,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:g,dataFn:b,doneFn:_,onTransmuxerLog:G})})},Qf=function(t){var i=t.activeXhrs,r=t.decryptionWorker,e=t.trackInfoFn,n=t.timingInfoFn,a=t.videoSegmentTimingInfoFn,s=t.audioSegmentTimingInfoFn,o=t.id3Fn,l=t.captionsFn,h=t.isEndOfTimeline,g=t.endedTimelineFn,b=t.dataFn,_=t.doneFn,G=t.onTransmuxerLog,ne=0,ye=!1;return function(re,Ue){if(!ye){if(re)return ye=!0,mo(i),_(re,Ue);if((ne+=1)===i.length){var Ge=function(){if(Ue.encryptedBytes)return Kf({decryptionWorker:r,segment:Ue,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:g,dataFn:b,doneFn:_,onTransmuxerLog:G});pc({segment:Ue,bytes:Ue.bytes,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:g,dataFn:b,doneFn:_,onTransmuxerLog:G})};if(Ue.endOfAllRequests=Date.now(),Ue.map&&Ue.map.encryptedBytes&&!Ue.map.bytes)return fc({decryptionWorker:r,id:Ue.requestId+"-init",encryptedBytes:Ue.map.encryptedBytes,key:Ue.map.key},function(be){Ue.map.bytes=be,hc(Ue,function(De){if(De)return mo(i),_(De,Ue);Ge()})});Ge()}}}},Yf=function(t){var i=t.loadendState,r=t.abortFn;return function(e){e.target.aborted&&r&&!i.calledAbortFn&&(r(),i.calledAbortFn=!0)}},$f=function(t){var i=t.segment,r=t.progressFn;return function(e){if(!e.target.aborted)return i.stats=he.mergeOptions(i.stats,Wf(e)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),r(e,i)}},Jf=function(t){var i=t.xhr,r=t.xhrOptions,e=t.decryptionWorker,n=t.segment,a=t.abortFn,s=t.progressFn,o=t.trackInfoFn,l=t.timingInfoFn,h=t.videoSegmentTimingInfoFn,g=t.audioSegmentTimingInfoFn,b=t.id3Fn,_=t.captionsFn,G=t.isEndOfTimeline,ne=t.endedTimelineFn,ye=t.dataFn,re=t.doneFn,Ue=t.onTransmuxerLog,Ge=[],be=Qf({activeXhrs:Ge,decryptionWorker:e,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:g,id3Fn:b,captionsFn:_,isEndOfTimeline:G,endedTimelineFn:ne,dataFn:ye,doneFn:re,onTransmuxerLog:Ue});if(n.key&&!n.key.bytes){var De=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&De.push(n.map.key);var Se=i(he.mergeOptions(r,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),dc(n,De,be));Ge.push(Se)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){var Me=i(he.mergeOptions(r,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),dc(n,[n.map.key],be));Ge.push(Me)}var Ce=i(he.mergeOptions(r,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:ho(n.map)}),Gf({segment:n,finishProcessingFn:be}));Ge.push(Ce)}var ze=he.mergeOptions(r,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:ho(n)}),Ne=i(ze,zf({segment:n,finishProcessingFn:be,responseType:ze.responseType}));Ne.addEventListener("progress",$f({segment:n,progressFn:s})),Ge.push(Ne);var Ye={};return Ge.forEach(function(tt){tt.addEventListener("loadend",Yf({loadendState:Ye,abortFn:a}))}),function(){return mo(Ge)}},Zf=kn("CodecUtils"),em=function(t){var i=t.attributes||{};if(i.CODECS)return Z(i.CODECS)},mc=function(t,i){var r=i.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&r.AUDIO&&t.mediaGroups.AUDIO[r.AUDIO]},tm=function(t,i){if(!mc(t,i))return!0;var r=i.attributes||{},e=t.mediaGroups.AUDIO[r.AUDIO];for(var n in e)if(!e[n].uri&&!e[n].playlists)return!0;return!1},ba=function(t){var i={};return t.forEach(function(r){var e=r.mediaType,n=r.type,a=r.details;i[e]=i[e]||[],i[e].push($(""+n+a))}),Object.keys(i).forEach(function(r){if(i[r].length>1)return Zf("multiple "+r+" codecs found as attributes: "+i[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(i[r]=null);i[r]=i[r][0]}),i},gc=function(t){var i=0;return t.audio&&i++,t.video&&i++,i},Si=function(t,i){var r=i.attributes||{},e=ba(em(i)||[]);if(mc(t,i)&&!e.audio&&!tm(t,i)){var n=ba(fe(t,r.AUDIO)||[]);n.audio&&(e.audio=n.audio)}return e},Ta=kn("PlaylistSelector"),vc=function(t){if(t&&t.playlist){var i=t.playlist;return JSON.stringify({id:i.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:i.attributes&&i.attributes.CODECS||""})}},Sa=function(t,i){if(!t)return"";var r=O().getComputedStyle(t);return r?r[i]:""},Yr=function(t,i){var r=t.slice();t.sort(function(e,n){var a=i(e,n);return a===0?r.indexOf(e)-r.indexOf(n):a})},vo=function(t,i){var r,e;return t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||O().Number.MAX_VALUE,i.attributes.BANDWIDTH&&(e=i.attributes.BANDWIDTH),r-(e=e||O().Number.MAX_VALUE)},nm=function(t,i){var r,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||O().Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(e=i.attributes.RESOLUTION.width),r===(e=e||O().Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?t.attributes.BANDWIDTH-i.attributes.BANDWIDTH:r-e},yc=function(t,i,r,e,n,a){if(t){var s={bandwidth:i,width:r,height:e,limitRenditionByPlayerDimensions:n},o=t.playlists;sn.isAudioOnly(t)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var l=o.map(function(Ne){var Ye=Ne.attributes&&Ne.attributes.RESOLUTION&&Ne.attributes.RESOLUTION.width,tt=Ne.attributes&&Ne.attributes.RESOLUTION&&Ne.attributes.RESOLUTION.height;return{bandwidth:Ne.attributes&&Ne.attributes.BANDWIDTH||O().Number.MAX_VALUE,width:Ye,height:tt,playlist:Ne}});Yr(l,function(Ne,Ye){return Ne.bandwidth-Ye.bandwidth});var h=(l=l.filter(function(Ne){return!sn.isIncompatible(Ne.playlist)})).filter(function(Ne){return sn.isEnabled(Ne.playlist)});h.length||(h=l.filter(function(Ne){return!sn.isDisabled(Ne.playlist)}));var g=h.filter(function(Ne){return Ne.bandwidth*qt.BANDWIDTH_VARIANCE<i}),b=g[g.length-1],_=g.filter(function(Ne){return Ne.bandwidth===b.bandwidth})[0];if(n===!1){var G=_||h[0]||l[0];if(G&&G.playlist){var ne="sortedPlaylistReps";return _&&(ne="bandwidthBestRep"),h[0]&&(ne="enabledPlaylistReps"),Ta("choosing "+vc(G)+" using "+ne+" with options",s),G.playlist}return Ta("could not choose a playlist with options",s),null}var ye=g.filter(function(Ne){return Ne.width&&Ne.height});Yr(ye,function(Ne,Ye){return Ne.width-Ye.width});var re=ye.filter(function(Ne){return Ne.width===r&&Ne.height===e});b=re[re.length-1];var Ue,Ge,be,De,Se=re.filter(function(Ne){return Ne.bandwidth===b.bandwidth})[0];if(Se||(Ge=(Ue=ye.filter(function(Ne){return Ne.width>r||Ne.height>e})).filter(function(Ne){return Ne.width===Ue[0].width&&Ne.height===Ue[0].height}),b=Ge[Ge.length-1],be=Ge.filter(function(Ne){return Ne.bandwidth===b.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var Me=ye.map(function(Ne){return Ne.pixelDiff=Math.abs(Ne.width-r)+Math.abs(Ne.height-e),Ne});Yr(Me,function(Ne,Ye){return Ne.pixelDiff===Ye.pixelDiff?Ye.bandwidth-Ne.bandwidth:Ne.pixelDiff-Ye.pixelDiff}),De=Me[0]}var Ce=De||be||Se||_||h[0]||l[0];if(Ce&&Ce.playlist){var ze="sortedPlaylistReps";return De?ze="leastPixelDiffRep":be?ze="resolutionPlusOneRep":Se?ze="resolutionBestRep":_?ze="bandwidthBestRep":h[0]&&(ze="enabledPlaylistReps"),Ta("choosing "+vc(Ce)+" using "+ze+" with options",s),Ce.playlist}return Ta("could not choose a playlist with options",s),null}},_c=function(){var t=this.useDevicePixelRatio&&O().devicePixelRatio||1;return yc(this.playlists.master,this.systemBandwidth,parseInt(Sa(this.tech_.el(),"width"),10)*t,parseInt(Sa(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},rm=function(t){var i=-1,r=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&O().devicePixelRatio||1;return i<0&&(i=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(i=t*this.systemBandwidth+(1-t)*i,r=this.systemBandwidth),yc(this.playlists.master,i,parseInt(Sa(this.tech_.el(),"width"),10)*e,parseInt(Sa(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},im=function(t){var i=t.master,r=t.currentTime,e=t.bandwidth,n=t.duration,a=t.segmentDuration,s=t.timeUntilRebuffer,o=t.currentTimeline,l=t.syncController,h=i.playlists.filter(function(G){return!sn.isIncompatible(G)}),g=h.filter(sn.isEnabled);g.length||(g=h.filter(function(G){return!sn.isDisabled(G)}));var b=g.filter(sn.hasAttribute.bind(null,"BANDWIDTH")).map(function(G){var ne=l.getSyncPoint(G,n,o,r)?1:2;return{playlist:G,rebufferingImpact:sn.estimateSegmentRequestTime(a,e,G)*ne-s}}),_=b.filter(function(G){return G.rebufferingImpact<=0});return Yr(_,function(G,ne){return vo(ne.playlist,G.playlist)}),_.length?_[0]:(Yr(b,function(G,ne){return G.rebufferingImpact-ne.rebufferingImpact}),b[0]||null)},am=function(){var t=this,i=this.playlists.master.playlists.filter(sn.isEnabled);return Yr(i,function(r,e){return vo(r,e)}),i.filter(function(r){return!!Si(t.playlists.master,r).video})[0]||null},sm=function(t){var i,r=0;return t.bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(function(e){i.set(e,r),r+=e.byteLength})),i},om=function(t,i,r){if(!t[r]){i.trigger({type:"usage",name:"vhs-608"}),i.trigger({type:"usage",name:"hls-608"});var e=r;/^cc708_/.test(r)&&(e="SERVICE"+r.split("_")[1]);var n=i.textTracks().getTrackById(e);if(n)t[r]=n;else{var a=r,s=r,o=!1,l=(i.options_.vhs&&i.options_.vhs.captionServices||{})[e];l&&(a=l.label,s=l.language,o=l.default),t[r]=i.addRemoteTextTrack({kind:"captions",id:e,default:o,label:a,language:s},!1).track}}},um=function(t){var i=t.inbandTextTracks,r=t.captionArray,e=t.timestampOffset;if(r){var n=O().WebKitDataCue||O().VTTCue;r.forEach(function(a){var s=a.stream;i[s].addCue(new n(a.startTime+e,a.endTime+e,a.text))})}},lm=function(t){Object.defineProperties(t.frame,{id:{get:function(){return he.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return he.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return he.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},cm=function(t){var i=t.inbandTextTracks,r=t.metadataArray,e=t.timestampOffset,n=t.videoDuration;if(r){var a=O().WebKitDataCue||O().VTTCue,s=i.metadataTrack_;if(s&&(r.forEach(function(_){var G=_.cueTime+e;typeof G!="number"||O().isNaN(G)||G<0||!(G<1/0)||_.frames.forEach(function(ne){var ye=new a(G,G,ne.value||ne.url||ne.data||"");ye.frame=ne,ye.value=ne,lm(ye),s.addCue(ye)})}),s.cues&&s.cues.length)){for(var o=s.cues,l=[],h=0;h<o.length;h++)o[h]&&l.push(o[h]);var g=l.reduce(function(_,G){var ne=_[G.startTime]||[];return ne.push(G),_[G.startTime]=ne,_},{}),b=Object.keys(g).sort(function(_,G){return Number(_)-Number(G)});b.forEach(function(_,G){var ne=g[_],ye=Number(b[G+1])||n;ne.forEach(function(re){re.endTime=ye})})}}},dm=function(t,i,r){t.metadataTrack_||(t.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=i)},Ei=function(t,i,r){var e,n;if(r&&r.cues)for(e=r.cues.length;e--;)(n=r.cues[e]).startTime>=t&&n.endTime<=i&&r.removeCue(n)},hm=function(t){var i=t.cues;if(i)for(var r=0;r<i.length;r++){for(var e=[],n=0,a=0;a<i.length;a++)i[r].startTime===i[a].startTime&&i[r].endTime===i[a].endTime&&i[r].text===i[a].text&&++n>1&&e.push(i[a]);e.length&&e.forEach(function(s){return t.removeCue(s)})}},pm=function(t,i,r){if(i==null||!t.length)return[];var e,n=Math.ceil((i-r+3)*ji.ONE_SECOND_IN_TS);for(e=0;e<t.length&&!(t[e].pts>n);e++);return t.slice(e)},fm=function(t,i,r){if(!i.length)return t;if(r)return i.slice();for(var e=i[0].pts,n=0;n<t.length&&!(t[n].pts>=e);n++);return t.slice(0,n).concat(i)},mm=function(t,i,r,e){for(var n=Math.ceil((i-e)*ji.ONE_SECOND_IN_TS),a=Math.ceil((r-e)*ji.ONE_SECOND_IN_TS),s=t.slice(),o=t.length;o--&&!(t[o].pts<=a););if(o===-1)return s;for(var l=o+1;l--&&!(t[l].pts<=n););return l=Math.max(l,0),s.splice(l,o-l+1),s},gm=function(t,i){if(!t&&!i||!t&&i||t&&!i)return!1;if(t===i)return!0;var r=Object.keys(t).sort(),e=Object.keys(i).sort();if(r.length!==e.length)return!1;for(var n=0;n<r.length;n++){var a=r[n];if(a!==e[n]||t[a]!==i[a])return!1}return!0},bc=22,vm=function(t,i,r){i=i||[];for(var e=[],n=0,a=0;a<i.length;a++){var s=i[a];if(t===s.timeline&&(e.push(a),(n+=s.duration)>r))return a}return e.length===0?0:e[e.length-1]},wi=1,ym=500,Tc=function(t){return typeof t=="number"&&isFinite(t)},Ea=1/60,_m=function(t,i,r){return t==="main"&&i&&r?r.hasAudio||r.hasVideo?i.hasVideo&&!r.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.":!i.hasVideo&&r.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},bm=function(t,i,r){var e=i-qt.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var n=i-r;return Math.min(n,e)},$r=function(t){var i=t.startOfSegment,r=t.duration,e=t.segment,n=t.part,a=t.playlist,s=a.mediaSequence,o=a.id,l=a.segments,h=l===void 0?[]:l,g=t.mediaIndex,b=t.partIndex,_=t.timeline,G=h.length-1,ne="mediaIndex/partIndex increment";t.getMediaInfoForTime?ne="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(ne="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(ne+=" with independent "+t.independent);var ye=typeof b=="number",re=t.segment.uri?"segment":"pre-segment",Ue=ye?Ll({preloadSegment:e})-1:0;return re+" ["+(s+g)+"/"+(s+G)+"]"+(ye?" part ["+b+"/"+Ue+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(ye?" part start/end ["+n.start+" => "+n.end+"]":"")+" startOfSegment ["+i+"] duration ["+r+"] timeline ["+_+"] selected by ["+ne+"] playlist ["+o+"]"},Sc=function(t){return t+"TimingInfo"},Tm=function(t){var i=t.segmentTimeline,r=t.currentTimeline,e=t.startOfSegment,n=t.buffered;return t.overrideCheck||i!==r?i<r?e:n.length?n.end(n.length-1):e:null},Ec=function(t){var i=t.timelineChangeController,r=t.currentTimeline,e=t.segmentTimeline,n=t.loaderType,a=t.audioDisabled;if(r===e)return!1;if(n==="audio"){var s=i.lastTimelineChange({type:"main"});return!s||s.to!==e}if(n==="main"&&a){var o=i.pendingTimelineChange({type:"audio"});return!(o&&o.to===e)}return!1},Sm=function(t){var i=0;return["video","audio"].forEach(function(r){var e=t[r+"TimingInfo"];if(e){var n,a=e.start,s=e.end;typeof a=="bigint"||typeof s=="bigint"?n=O().BigInt(s)-O().BigInt(a):typeof a=="number"&&typeof s=="number"&&(n=s-a),n!==void 0&&n>i&&(i=n)}}),typeof i=="bigint"&&i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),i},wc=function(t){var i=t.segmentDuration,r=t.maxDuration;return!!i&&Math.round(i)>r+ur},Em=function(t,i){if(i!=="hls")return null;var r=Sm({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!r)return null;var e=t.playlist.targetDuration,n=wc({segmentDuration:r,maxDuration:2*e}),a=wc({segmentDuration:r,maxDuration:e}),s="Segment with index "+t.mediaIndex+" from playlist "+t.playlist.id+" has a duration of "+r+" when the reported duration is "+t.duration+" and the target duration is "+e+". 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 n||a?{severity:n?"warn":"info",message:s}:null},yo=function(t){function i(e,n){var a;if(a=t.call(this)||this,!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return a.bandwidth=e.bandwidth,a.throughput={rate:0,count:0},a.roundTrip=NaN,a.resetStats_(),a.mediaIndex=null,a.partIndex=null,a.hasPlayed_=e.hasPlayed,a.currentTime_=e.currentTime,a.seekable_=e.seekable,a.seeking_=e.seeking,a.duration_=e.duration,a.mediaSource_=e.mediaSource,a.vhs_=e.vhs,a.loaderType_=e.loaderType,a.currentMediaInfo_=void 0,a.startingMediaInfo_=void 0,a.segmentMetadataTrack_=e.segmentMetadataTrack,a.goalBufferLength_=e.goalBufferLength,a.sourceType_=e.sourceType,a.sourceUpdater_=e.sourceUpdater,a.inbandTextTracks_=e.inbandTextTracks,a.state_="INIT",a.timelineChangeController_=e.timelineChangeController,a.shouldSaveSegmentTimingInfo_=!0,a.parse708captions_=e.parse708captions,a.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,a.captionServices_=e.captionServices,a.experimentalExactManifestTimings=e.experimentalExactManifestTimings,a.checkBufferTimeout_=null,a.error_=void 0,a.currentTimeline_=-1,a.pendingSegment_=null,a.xhrOptions_=null,a.pendingSegments_=[],a.audioDisabled_=!1,a.isPendingTimestampOffset_=!1,a.gopBuffer_=[],a.timeMapping_=0,a.safeAppend_=he.browser.IE_VERSION>=11,a.appendInitSegment_={audio:!0,video:!0},a.playlistOfLastInitSegment_={audio:null,video:null},a.callQueue_=[],a.loadQueue_=[],a.metadataQueue_={id3:[],caption:[]},a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=null,a.activeInitSegmentId_=null,a.initSegments_={},a.cacheEncryptionKeys_=e.cacheEncryptionKeys,a.keyCache_={},a.decrypter_=e.decrypter,a.syncController_=e.syncController,a.syncPoint_={segmentIndex:0,time:0},a.transmuxer_=a.createTransmuxer_(),a.triggerSyncInfoUpdate_=function(){return a.trigger("syncinfoupdate")},a.syncController_.on("syncinfoupdate",a.triggerSyncInfoUpdate_),a.mediaSource_.addEventListener("sourceopen",function(){a.isEndOfStream_()||(a.ended_=!1)}),a.fetchAtBuffer_=!1,a.logger_=kn("SegmentLoader["+a.loaderType_+"]"),Object.defineProperty(w(a),"state",{get:function(){return this.state_},set:function(s){s!==this.state_&&(this.logger_(this.state_+" -> "+s),this.state_=s,this.trigger("statechange"))}}),a.sourceUpdater_.on("ready",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="main"&&a.timelineChangeController_.on("pendingtimelinechange",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="audio"&&a.timelineChangeController_.on("timelinechange",function(){a.hasEnoughInfoToLoad_()&&a.processLoadQueue_(),a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a}y(i,t);var r=i.prototype;return r.createTransmuxer_=function(){return fo.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},r.error=function(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&fo.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return he.createTimeRanges();if(this.loaderType_==="main"){var n=e.hasAudio,a=e.hasVideo,s=e.isMuxed;if(a&&n&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(e,n){if(n===void 0&&(n=!1),!e)return null;var a=ya(e),s=this.initSegments_[a];return n&&!s&&e.bytes&&(this.initSegments_[a]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e},r.segmentKey=function(e,n){if(n===void 0&&(n=!1),!e)return null;var a=Ql(e),s=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!s&&e.bytes&&(this.keyCache_[a]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});var o={resolvedUri:(s||e).resolvedUri};return s&&(o.bytes=s.bytes),o},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(e,n){if(n===void 0&&(n={}),e){var a=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=n,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var o=null;if(a&&(a.id?o=a.id:a.uri&&(o=a.uri)),this.logger_("playlist update ["+o+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var l=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var h=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!h.parts||!h.parts.length||!h.parts[this.partIndex])){var g=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=g}}s&&(s.mediaIndex-=l,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(a,e)}},r.pause=function(){this.checkBufferTimeout_&&(O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&fo.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(e,n,a,s){if(a===void 0&&(a=function(){}),s===void 0&&(s=!1),n===1/0&&(n=this.duration_()),n<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var o=1,l=function(){--o==0&&a()};for(var h in(s||!this.audioDisabled_)&&(o++,this.sourceUpdater_.removeAudio(e,n,l)),(s||this.loaderType_==="main")&&(this.gopBuffer_=mm(this.gopBuffer_,e,n,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(e,n,l)),this.inbandTextTracks_)Ei(e,n,this.inbandTextTracks_[h]);Ei(e,n,this.segmentMetadataTrack_),l()}else this.logger_("skipping remove because no source updater or starting media info")},r.monitorBuffer_=function(){this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O().setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O().setTimeout(this.monitorBufferTick_.bind(this),ym)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();!e||(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},r.isEndOfStream_=function(e,n,a){if(e===void 0&&(e=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var s=typeof e=="number"&&n.segments[e],o=e+1===n.segments.length,l=!s||!s.parts||a+1===s.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&o&&l},r.chooseNextRequest_=function(){var e=this.buffered_(),n=Pl(e)||0,a=to(e,this.currentTime_()),s=!this.hasPlayed_()&&a>=1,o=a>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||s||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var h={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(h.isSyncRequest)h.mediaIndex=vm(this.currentTimeline_,l,n);else if(this.mediaIndex!==null){var g=l[this.mediaIndex],b=typeof this.partIndex=="number"?this.partIndex:-1;h.startOfSegment=g.end?g.end:n,g.parts&&g.parts[b+1]?(h.mediaIndex=this.mediaIndex,h.partIndex=b+1):h.mediaIndex=this.mediaIndex+1}else{var _=sn.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),G=_.segmentIndex,ne=_.startTime,ye=_.partIndex;h.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),h.mediaIndex=G,h.startOfSegment=ne,h.partIndex=ye}var re=l[h.mediaIndex],Ue=re&&typeof h.partIndex=="number"&&re.parts&&re.parts[h.partIndex];if(!re||typeof h.partIndex=="number"&&!Ue)return null;if(typeof h.partIndex!="number"&&re.parts&&(h.partIndex=0,Ue=re.parts[0]),!a&&Ue&&!Ue.independent)if(h.partIndex===0){var Ge=l[h.mediaIndex-1],be=Ge.parts&&Ge.parts.length&&Ge.parts[Ge.parts.length-1];be&&be.independent&&(h.mediaIndex-=1,h.partIndex=Ge.parts.length-1,h.independent="previous segment")}else re.parts[h.partIndex-1].independent&&(h.partIndex-=1,h.independent="previous part");var De=this.mediaSource_&&this.mediaSource_.readyState==="ended";return h.mediaIndex>=l.length-1&&De&&!this.seeking_()?null:this.generateSegmentInfo_(h)},r.generateSegmentInfo_=function(e){var n=e.independent,a=e.playlist,s=e.mediaIndex,o=e.startOfSegment,l=e.isSyncRequest,h=e.partIndex,g=e.forceTimestampOffset,b=e.getMediaInfoForTime,_=a.segments[s],G=typeof h=="number"&&_.parts[h],ne={requestId:"segment-loader-"+Math.random(),uri:G&&G.resolvedUri||_.resolvedUri,mediaIndex:s,partIndex:G?h:null,isSyncRequest:l,startOfSegment:o,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:G&&G.duration||_.duration,segment:_,part:G,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:b,independent:n},ye=g!==void 0?g:this.isPendingTimestampOffset_;ne.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:ye});var re=Pl(this.sourceUpdater_.audioBuffered());return typeof re=="number"&&(ne.audioAppendStart=re-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(ne.gopsToAlignWith=pm(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),ne},r.timestampOffsetForSegment_=function(e){return Tm(e)},r.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=e.bandwidth,s=this.pendingSegment_.duration,o=sn.estimateSegmentRequestTime(s,a,this.playlist_,e.bytesReceived),l=zp(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(o<=l)){var h=im({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(h){var g=o-l-h.rebufferingImpact,b=.5;l<=ur&&(b=1),h.playlist&&h.playlist.uri!==this.playlist_.uri&&!(g<b)&&(this.bandwidth=h.playlist.attributes.BANDWIDTH*qt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},r.handleAbort_=function(e){this.logger_("Aborting "+$r(e)),this.mediaRequestsAborted+=1},r.handleProgress_=function(e,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},r.handleTrackInfo_=function(e,n){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},gm(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},r.handleTimingInfo_=function(e,n,a,s){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var o=this.pendingSegment_,l=Sc(n);o[l]=o[l]||{},o[l][a]=s,this.logger_("timinginfo: "+n+" - "+a+" - "+s),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},r.handleCaptions_=function(e,n){var a=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(n.length===0)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,n));var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),o={};n.forEach(function(l){o[l.stream]=o[l.stream]||{startTime:1/0,captions:[],endTime:0};var h=o[l.stream];h.startTime=Math.min(h.startTime,l.startTime+s),h.endTime=Math.max(h.endTime,l.endTime+s),h.captions.push(l)}),Object.keys(o).forEach(function(l){var h=o[l],g=h.startTime,b=h.endTime,_=h.captions,G=a.inbandTextTracks_;a.logger_("adding cues from "+g+" -> "+b+" for "+l),om(G,a.vhs_.tech_,l),Ei(g,b,G[l]),um({captionArray:_,inbandTextTracks:G,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},r.handleId3_=function(e,n,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,n,a));var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();dm(this.inbandTextTracks_,a,this.vhs_.tech_),cm({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:s,videoDuration:this.duration_()})}},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(n){return n()})},r.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(n){return n()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Ec({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!e||!n)return!1;var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed;return!(s&&!e.videoTimingInfo||a&&!this.audioDisabled_&&!o&&!e.audioTimingInfo||Ec({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.handleData_=function(e,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,n));var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),a.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),a.isFmp4=e.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Sc(n.type)].start;else{var s,o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo;l&&(s=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:s,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var h=this.chooseNextRequest_();if(h.mediaIndex!==a.mediaIndex||h.partIndex!==a.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},r.updateAppendInitSegmentStatus=function(e,n){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==e.playlist&&(this.appendInitSegment_[n]=!0)},r.getInitSegmentAndUpdateState_=function(e){var n=e.type,a=e.initSegment,s=e.map,o=e.playlist;if(s){var l=ya(s);if(this.activeInitSegmentId_===l)return null;a=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=l}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=o,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},r.handleQuotaExceededError_=function(e,n){var a=this,s=e.segmentInfo,o=e.type,l=e.bytes,h=this.sourceUpdater_.audioBuffered(),g=this.sourceUpdater_.videoBuffered();h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+br(h).join(", ")),g.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+br(g).join(", "));var b=h.length?h.start(0):0,_=h.length?h.end(h.length-1):0,G=g.length?g.start(0):0,ne=g.length?g.end(g.length-1):0;if(_-b<=wi&&ne-G<=wi)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+l.byteLength+", audio buffer: "+br(h).join(", ")+", video buffer: "+br(g).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:s,type:o,bytes:l}));var ye=this.currentTime_()-wi;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+ye),this.remove(0,ye,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+wi+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=O().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3*wi)},!0)},r.handleAppendError_=function(e,n){var a=e.segmentInfo,s=e.type,o=e.bytes;if(n){if(n.code===bc)return void this.handleQuotaExceededError_({segmentInfo:a,type:s,bytes:o});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(s+" append of "+o.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},r.appendToSourceBuffer_=function(e){var n=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,l=e.bytes;if(!l){var h=[o],g=o.byteLength;s&&(h.unshift(s),g+=s.byteLength),l=sm({bytes:g,segments:h})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:l}))},r.handleSegmentTimingInfo_=function(e,n,a){if(this.pendingSegment_&&n===this.pendingSegment_.requestId){var s=this.pendingSegment_.segment,o=e+"TimingInfo";s[o]||(s[o]={}),s[o].transmuxerPrependedSeconds=a.prependedContentDuration||0,s[o].transmuxedPresentationStart=a.start.presentation,s[o].transmuxedDecodeStart=a.start.decode,s[o].transmuxedPresentationEnd=a.end.presentation,s[o].transmuxedDecodeEnd=a.end.decode,s[o].baseMediaDecodeTime=a.baseMediaDecodeTime}},r.appendData_=function(e,n){var a=n.type,s=n.data;if(s&&s.byteLength&&(a!=="audio"||!this.audioDisabled_)){var o=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:o,data:s})}},r.loadSegment_=function(e){var n=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=we({},e,{forceTimestampOffset:!0});we(e,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(e)})},r.updateTransmuxerAndRequestSegment_=function(e){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),o=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,h=s||o&&l;this.logger_("Requesting "+$r(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Jf({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:h,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var b=g.message,_=g.level,G=g.stream;n.logger_($r(e)+" logged from transmuxer stream "+G+" as a "+_+": "+b)}})},r.trimBackBuffer_=function(e){var n=bm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},r.createSimplifiedSegmentObj_=function(e){var n=e.segment,a=e.part,s={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===n.timeline&&(o.videoTimingInfo?s.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(s.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),n.key){var l=n.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(n.key),s.key.iv=l}return n.map&&(s.map=this.initSegmentForMap(n.map)),s},r.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},r.saveBandwidthRelatedStats_=function(e,n){this.pendingSegment_.byteLength=n.bytesReceived,e<Ea?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+Ea):(this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime)},r.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},r.segmentRequestFinished_=function(e,n,a){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,n,a));else if(this.saveTransferStats_(n.stats),this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===Rn.ABORTED?void 0:(this.pause(),e.code===Rn.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));var s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,n.stats),s.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=fm(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}},r.setTimeMapping_=function(e){var n=this.syncController_.mappingForTimeline(e);n!==null&&(this.timeMapping_=n)},r.updateMediaSecondsLoaded_=function(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},r.shouldUpdateTransmuxerTimestampOffset_=function(e){return e!==null&&(this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},r.trueSegmentStart_=function(e){var n=e.currentStart,a=e.playlist,s=e.mediaIndex,o=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,h=e.useVideoTimingInfo,g=e.videoTimingInfo,b=e.audioTimingInfo;if(n!==void 0)return n;if(!h)return b.start;var _=a.segments[s-1];return s!==0&&_&&_.start!==void 0&&_.end===o+l?g.start:o},r.waitForAppendsToComplete_=function(e){var n=this.getCurrentMediaInfo_(e);if(!n)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed,l=this.loaderType_==="main"&&s,h=!this.audioDisabled_&&a&&!o;if(e.waitingOnAppends=0,!e.hasAppendedData_)return!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);l&&e.waitingOnAppends++,h&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),h&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},r.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(e){var n=_m(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!n&&(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0)},r.updateSourceBufferTimestampOffset_=function(e){if(e.timestampOffset!==null&&typeof e.timingInfo.start=="number"&&!e.changedTimestampOffset&&this.loaderType_==="main"){var n=!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),n=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var n=e.videoTimingInfo,a=e.audioTimingInfo,s=e.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:s.start:s.start},r.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!a||(e.timingInfo.end=typeof a.end=="number"?a.end:a.start+e.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=Em(e,this.sourceType_);if(n&&(n.severity==="warn"?he.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+$r(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var a=e.segment,s=e.part,o=a.end&&this.currentTime_()-a.end>3*e.playlist.targetDuration,l=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(o||l)return this.logger_("bad "+(o?"segment":"part")+" "+$r(e)),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+$r(e))},r.recordThroughput_=function(e){if(e.duration<Ea)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+Ea);else{var n=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/a*8*1e3);this.throughput.rate+=(s-n)/++this.throughput.count}},r.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var n=e.segment,a=n.start,s=n.end;if(Tc(a)&&Tc(s)){Ei(a,s,this.segmentMetadataTrack_);var o=O().WebKitDataCue||O().VTTCue,l={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:a,end:s},h=new o(a,s,JSON.stringify(l));h.value=l,this.segmentMetadataTrack_.addCue(h)}}},i}(he.EventTarget);function Jn(){}var Zn,kc=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toUpperCase()})},wm=["video","audio"],_o=function(t,i){var r=i[t+"Buffer"];return r&&r.updating||i.queuePending[t]},km=function(t,i){for(var r=0;r<i.length;r++){var e=i[r];if(e.type==="mediaSource")return null;if(e.type===t)return r}return null},bo=function t(i,r){if(r.queue.length!==0){var e=0,n=r.queue[e];if(n.type==="mediaSource")return void(!r.updating()&&r.mediaSource.readyState!=="closed"&&(r.queue.shift(),n.action(r),n.doneFn&&n.doneFn(),t("audio",r),t("video",r)));if(i!=="mediaSource"&&r.ready()&&r.mediaSource.readyState!=="closed"&&!_o(i,r)){if(n.type!==i){if((e=km(i,r.queue))===null)return;n=r.queue[e]}if(r.queue.splice(e,1),r.queuePending[i]=n,n.action(i,r),!n.doneFn)return r.queuePending[i]=null,void t(i,r)}}},Cc=function(t,i){var r=i[t+"Buffer"],e=kc(t);!r||(r.removeEventListener("updateend",i["on"+e+"UpdateEnd_"]),r.removeEventListener("error",i["on"+e+"Error_"]),i.codecs[t]=null,i[t+"Buffer"]=null)},Nn=function(t,i){return t&&i&&Array.prototype.indexOf.call(t.sourceBuffers,i)!==-1},pn={appendBuffer:function(t,i,r){return function(e,n){var a=n[e+"Buffer"];if(Nn(n.mediaSource,a)){n.logger_("Appending segment "+i.mediaIndex+"'s "+t.length+" bytes to "+e+"Buffer");try{a.appendBuffer(t)}catch(s){n.logger_("Error with code "+s.code+" "+(s.code===bc?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+i.mediaIndex+" to "+e+"Buffer"),n.queuePending[e]=null,r(s)}}}},remove:function(t,i){return function(r,e){var n=e[r+"Buffer"];if(Nn(e.mediaSource,n)){e.logger_("Removing "+t+" to "+i+" from "+r+"Buffer");try{n.remove(t,i)}catch{e.logger_("Remove "+t+" to "+i+" from "+r+"Buffer failed")}}}},timestampOffset:function(t){return function(i,r){var e=r[i+"Buffer"];!Nn(r.mediaSource,e)||(r.logger_("Setting "+i+"timestampOffset to "+t),e.timestampOffset=t)}},callback:function(t){return function(i,r){t()}},endOfStream:function(t){return function(i){if(i.mediaSource.readyState==="open"){i.logger_("Calling mediaSource endOfStream("+(t||"")+")");try{i.mediaSource.endOfStream(t)}catch(r){he.log.warn("Failed to call media source endOfStream",r)}}}},duration:function(t){return function(i){i.logger_("Setting mediaSource duration to "+t);try{i.mediaSource.duration=t}catch(r){he.log.warn("Failed to set media source duration",r)}}},abort:function(){return function(t,i){if(i.mediaSource.readyState==="open"){var r=i[t+"Buffer"];if(Nn(i.mediaSource,r)){i.logger_("calling abort on "+t+"Buffer");try{r.abort()}catch(e){he.log.warn("Failed to abort on "+t+"Buffer",e)}}}}},addSourceBuffer:function(t,i){return function(r){var e=kc(t),n=Fe(i);r.logger_("Adding "+t+"Buffer with codec "+i+" to mediaSource");var a=r.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",r["on"+e+"UpdateEnd_"]),a.addEventListener("error",r["on"+e+"Error_"]),r.codecs[t]=i,r[t+"Buffer"]=a}},removeSourceBuffer:function(t){return function(i){var r=i[t+"Buffer"];if(Cc(t,i),Nn(i.mediaSource,r)){i.logger_("Removing "+t+"Buffer with codec "+i.codecs[t]+" from mediaSource");try{i.mediaSource.removeSourceBuffer(r)}catch(e){he.log.warn("Failed to removeSourceBuffer "+t+"Buffer",e)}}}},changeType:function(t){return function(i,r){var e=r[i+"Buffer"],n=Fe(t);!Nn(r.mediaSource,e)||r.codecs[i]!==t&&(r.logger_("changing "+i+"Buffer codec from "+r.codecs[i]+" to "+t),e.changeType(n),r.codecs[i]=t)}}},fn=function(t){var i=t.type,r=t.sourceUpdater,e=t.action,n=t.doneFn,a=t.name;r.queue.push({type:i,action:e,doneFn:n,name:a}),bo(i,r)},xc=function(t,i){return function(r){if(i.queuePending[t]){var e=i.queuePending[t].doneFn;i.queuePending[t]=null,e&&e(i[t+"Error_"])}bo(t,i)}},Ic=function(t){function i(e){var n;return(n=t.call(this)||this).mediaSource=e,n.sourceopenListener_=function(){return bo("mediaSource",w(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=kn("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=xc("video",w(n)),n.onAudioUpdateEnd_=xc("audio",w(n)),n.onVideoError_=function(a){n.videoError_=a},n.onAudioError_=function(a){n.audioError_=a},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}y(i,t);var r=i.prototype;return r.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},r.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},r.hasInitializedAnyEme=function(){return this.initializedEme_},r.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},r.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},r.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},r.addSourceBuffer=function(e,n){fn({type:"mediaSource",sourceUpdater:this,action:pn.addSourceBuffer(e,n),name:"addSourceBuffer"})},r.abort=function(e){fn({type:e,sourceUpdater:this,action:pn.abort(e),name:"abort"})},r.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?fn({type:"mediaSource",sourceUpdater:this,action:pn.removeSourceBuffer(e),name:"removeSourceBuffer"}):he.log.error("removeSourceBuffer is not supported!")},r.canRemoveSourceBuffer=function(){return!he.browser.IE_VERSION&&!he.browser.IS_FIREFOX&&O().MediaSource&&O().MediaSource.prototype&&typeof O().MediaSource.prototype.removeSourceBuffer=="function"},i.canChangeType=function(){return O().SourceBuffer&&O().SourceBuffer.prototype&&typeof O().SourceBuffer.prototype.changeType=="function"},r.canChangeType=function(){return this.constructor.canChangeType()},r.changeType=function(e,n){this.canChangeType()?fn({type:e,sourceUpdater:this,action:pn.changeType(n),name:"changeType"}):he.log.error("changeType is not supported!")},r.addOrChangeSourceBuffers=function(e){var n=this;if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(a){var s=e[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,s);n.canChangeType()&&n.changeType(a,s)})},r.appendBuffer=function(e,n){var a=this,s=e.segmentInfo,o=e.type,l=e.bytes;if(this.processedAppend_=!0,o==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,n]),void this.logger_("delayed audio append of "+l.length+" until video append");var h=n;if(fn({type:o,sourceUpdater:this,action:pn.appendBuffer(l,s||{mediaIndex:-1},h),doneFn:n,name:"appendBuffer"}),o==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var g=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+g.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,g.forEach(function(b){a.appendBuffer.apply(a,b)})}},r.audioBuffered=function(){return Nn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:he.createTimeRange()},r.videoBuffered=function(){return Nn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:he.createTimeRange()},r.buffered=function(){var e=Nn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Nn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!e?this.audioBuffered():e&&!n?this.videoBuffered():Gp(this.audioBuffered(),this.videoBuffered())},r.setDuration=function(e,n){n===void 0&&(n=Jn),fn({type:"mediaSource",sourceUpdater:this,action:pn.duration(e),name:"duration",doneFn:n})},r.endOfStream=function(e,n){e===void 0&&(e=null),n===void 0&&(n=Jn),typeof e!="string"&&(e=void 0),fn({type:"mediaSource",sourceUpdater:this,action:pn.endOfStream(e),name:"endOfStream",doneFn:n})},r.removeAudio=function(e,n,a){a===void 0&&(a=Jn),this.audioBuffered().length&&this.audioBuffered().end(0)!==0?fn({type:"audio",sourceUpdater:this,action:pn.remove(e,n),doneFn:a,name:"remove"}):a()},r.removeVideo=function(e,n,a){a===void 0&&(a=Jn),this.videoBuffered().length&&this.videoBuffered().end(0)!==0?fn({type:"video",sourceUpdater:this,action:pn.remove(e,n),doneFn:a,name:"remove"}):a()},r.updating=function(){return!(!_o("audio",this)&&!_o("video",this))},r.audioTimestampOffset=function(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(fn({type:"audio",sourceUpdater:this,action:pn.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},r.videoTimestampOffset=function(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset!==e&&(fn({type:"video",sourceUpdater:this,action:pn.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},r.audioQueueCallback=function(e){!this.audioBuffer||fn({type:"audio",sourceUpdater:this,action:pn.callback(e),name:"callback"})},r.videoQueueCallback=function(e){!this.videoBuffer||fn({type:"video",sourceUpdater:this,action:pn.callback(e),name:"callback"})},r.dispose=function(){var e=this;this.trigger("dispose"),wm.forEach(function(n){e.abort(n),e.canRemoveSourceBuffer()?e.removeSourceBuffer(n):e[n+"QueueCallback"](function(){return Cc(n,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},i}(he.EventTarget),Ac=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},Pc=new Uint8Array(` `.split("").map(function(t){return t.charCodeAt(0)})),Cm=function(t){function i(){return t.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return y(i,t),i}(ns(Error)),xm=function(t){function i(e,n){var a;return n===void 0&&(n={}),(a=t.call(this,e,n)||this).mediaSource_=null,a.subtitlesTrack_=null,a.loaderType_="subtitle",a.featuresNativeTextTracks_=e.featuresNativeTextTracks,a.loadVttJs=e.loadVttJs,a.shouldSaveSegmentTimingInfo_=!1,a}y(i,t);var r=i.prototype;return r.createTransmuxer_=function(){return null},r.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return he.createTimeRanges();var e=this.subtitlesTrack_.cues,n=e[0].startTime,a=e[e.length-1].startTime;return he.createTimeRanges([[n,a]])},r.initSegmentForMap=function(e,n){if(n===void 0&&(n=!1),!e)return null;var a=ya(e),s=this.initSegments_[a];if(n&&!s&&e.bytes){var o=Pc.byteLength+e.bytes.byteLength,l=new Uint8Array(o);l.set(e.bytes),l.set(Pc,e.bytes.byteLength),this.initSegments_[a]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:l}}return s||e},r.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.track=function(e){return e===void 0||(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},r.remove=function(e,n){Ei(e,n,this.subtitlesTrack_)},r.fillBuffer_=function(){var e=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var a=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",a),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(n)}},r.timestampOffsetForSegment_=function(){return null},r.chooseNextRequest_=function(){return this.skipEmptySegments_(t.prototype.chooseNextRequest_.call(this))},r.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},r.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(e,n,a){var s=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(n.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Rn.TIMEOUT&&this.handleTimeout_(),e.code===Rn.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var l=o.segment;if(l.map&&(l.map.bytes=n.map.bytes),o.bytes=n.bytes,typeof O().WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(function(){return s.segmentRequestFinished_(e,n,a)},function(){return s.stopForError({message:"Error loading vtt.js"})});l.requested=!0;try{this.parseVTTCues_(o)}catch(h){return void this.stopForError({message:h.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=l.duration,o.cues.forEach(function(h){s.subtitlesTrack_.addCue(s.featuresNativeTextTracks_?new(O()).VTTCue(h.startTime,h.endTime,h.text):h)}),hm(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(e){var n,a=!1;if(typeof O().WebVTT!="function")throw new Cm;typeof O().TextDecoder=="function"?n=new(O()).TextDecoder("utf8"):(n=O().WebVTT.StringDecoder(),a=!0);var s=new(O()).WebVTT.Parser(O(),O().vttjs,n);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=function(h){e.timestampmap=h},s.onparsingerror=function(h){he.log.warn("Error encountered when parsing cues: "+h.message)},e.segment.map){var o=e.segment.map.bytes;a&&(o=Ac(o)),s.parse(o)}var l=e.bytes;a&&(l=Ac(l)),s.parse(l),s.flush()},r.updateTimeMapping_=function(e,n,a){var s=e.segment;if(n){if(!e.cues.length)return void(s.empty=!0);var o=e.timestampmap,l=o.MPEGTS/ji.ONE_SECOND_IN_TS-o.LOCAL+n.mapping;if(e.cues.forEach(function(b){b.startTime+=l,b.endTime+=l}),!a.syncInfo){var h=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(h,g-s.duration)}}}},i}(yo),Im=function(t,i){for(var r=t.cues,e=0;e<r.length;e++){var n=r[e];if(i>=n.adStartTime&&i<=n.adEndTime)return n}return null},Am=function(t,i,r){if(r===void 0&&(r=0),t.segments)for(var e,n=r,a=0;a<t.segments.length;a++){var s=t.segments[a];if(e||(e=Im(i,n+s.duration/2)),e){if("cueIn"in s){e.endTime=n,e.adEndTime=n,n+=s.duration,e=null;continue}if(n<e.endTime){n+=s.duration;continue}e.endTime+=s.duration}else if("cueOut"in s&&((e=new(O()).VTTCue(n,n+s.duration,s.cueOut)).adStartTime=n,e.adEndTime=n+parseFloat(s.cueOut),i.addCue(e)),"cueOutCont"in s){var o=s.cueOutCont.split("/").map(parseFloat),l=o[0],h=o[1];(e=new(O()).VTTCue(n,n+s.duration,"")).adStartTime=n-l,e.adEndTime=e.adStartTime+h,i.addCue(e)}n+=s.duration}},Pm=86400,Oc=[{name:"VOD",run:function(t,i,r,e,n){return r!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(t,i,r,e,n){if(!Object.keys(t.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=ro(i);n=n||0;for(var l=0;l<o.length;l++){var h=o[i.endList||n===0?l:o.length-(l+1)],g=h.segment,b=t.timelineToDatetimeMappings[g.timeline];if(b&&g.dateTimeObject){var _=g.dateTimeObject.getTime()/1e3+b;if(g.parts&&typeof h.partIndex=="number")for(var G=0;G<h.partIndex;G++)_+=g.parts[G].duration;var ne=Math.abs(n-_);if(s!==null&&(ne===0||s<ne))break;s=ne,a={time:_,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}return a}},{name:"Segment",run:function(t,i,r,e,n){var a=null,s=null;n=n||0;for(var o=ro(i),l=0;l<o.length;l++){var h=o[i.endList||n===0?l:o.length-(l+1)],g=h.segment,b=h.part&&h.part.start||g&&g.start;if(g.timeline===e&&b!==void 0){var _=Math.abs(n-b);if(s!==null&&s<_)break;(!a||s===null||s>=_)&&(s=_,a={time:b,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return a}},{name:"Discontinuity",run:function(t,i,r,e,n){var a=null;if(n=n||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var s=null,o=0;o<i.discontinuityStarts.length;o++){var l=i.discontinuityStarts[o],h=i.discontinuitySequence+o+1,g=t.discontinuities[h];if(g){var b=Math.abs(n-g.time);if(s!==null&&s<b)break;(!a||s===null||s>=b)&&(s=b,a={time:g.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(t,i,r,e,n){return i.syncInfo?{time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence,partIndex:null}:null}}],Om=function(t){function i(e){var n;return(n=t.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=kn("SyncController"),n}y(i,t);var r=i.prototype;return r.getSyncPoint=function(e,n,a,s){var o=this.runStrategies_(e,n,a,s);return o.length?this.selectSyncPoint_(o,{key:"time",value:s}):null},r.getExpiredTime=function(e,n){if(!e||!e.segments)return null;var a=this.runStrategies_(e,n,e.discontinuitySequence,0);if(!a.length)return null;var s=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+_i({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))},r.runStrategies_=function(e,n,a,s){for(var o=[],l=0;l<Oc.length;l++){var h=Oc[l],g=h.run(this,e,n,a,s);g&&(g.strategy=h.name,o.push({strategy:h.name,syncPoint:g}))}return o},r.selectSyncPoint_=function(e,n){for(var a=e[0].syncPoint,s=Math.abs(e[0].syncPoint[n.key]-n.value),o=e[0].strategy,l=1;l<e.length;l++){var h=Math.abs(e[l].syncPoint[n.key]-n.value);h<s&&(s=h,a=e[l].syncPoint,o=e[l].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy ["+o+"]: [time:"+a.time+", segmentIndex:"+a.segmentIndex+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},r.saveExpiredSegmentInfo=function(e,n){var a=n.mediaSequence-e.mediaSequence;if(a>Pm)he.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var s=a-1;s>=0;s--){var o=e.segments[s];if(o&&o.start!==void 0){n.syncInfo={mediaSequence:e.mediaSequence+s,time:o.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+", mediaSequence: "+n.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var n=e.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},r.saveSegmentTimingInfo=function(e){var n=e.segmentInfo,a=e.shouldSaveTimelineMapping,s=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),o=n.segment;s&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:o.start}));var l=o.dateTimeObject;o.discontinuity&&a&&l&&(this.timelineToDatetimeMappings[o.timeline]=-l.getTime()/1e3)},r.timestampOffsetForTimeline=function(e){return this.timelines[e]===void 0?null:this.timelines[e].time},r.mappingForTimeline=function(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,n,a){var s,o,l=e.segment,h=e.part,g=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")g={time:e.startOfSegment,mapping:e.startOfSegment-n.start},a&&(this.timelines[e.timeline]=g,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+g.time+"] [mapping: "+g.mapping+"]")),s=e.startOfSegment,o=n.end+g.mapping;else{if(!g)return!1;s=n.start+g.mapping,o=n.end+g.mapping}return h&&(h.start=s,h.end=o),(!l.start||s<l.start)&&(l.start=s),l.end=o,!0},r.saveDiscontinuitySyncInfo_=function(e){var n=e.playlist,a=e.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var s=0;s<n.discontinuityStarts.length;s++){var o=n.discontinuityStarts[s],l=n.discontinuitySequence+s+1,h=o-e.mediaIndex,g=Math.abs(h);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>g){var b=void 0;b=h<0?a.start-_i({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex,endIndex:o}):a.end+_i({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex+1,endIndex:o}),this.discontinuities[l]={time:b,accuracy:g}}}},r.dispose=function(){this.trigger("dispose"),this.off()},i}(he.EventTarget),Dm=function(t){function i(){var e;return(e=t.call(this)||this).pendingTimelineChanges_={},e.lastTimelineChanges_={},e}y(i,t);var r=i.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var n=e.type,a=e.from,s=e.to;return typeof a=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},r.lastTimelineChange=function(e){var n=e.type,a=e.from,s=e.to;return typeof a=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:s},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},i}(he.EventTarget),Lm=ic(ac(function(){var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:Ae.g!==void 0?Ae.g:typeof self<"u"?self:{};function i(be,De,Se){return be(Se={path:De,exports:{},require:function(Me,Ce){return r(Me,Ce??Se.path)}},Se.exports),Se.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var e=i(function(be){function De(Me,Ce){for(var ze=0;ze<Ce.length;ze++){var Ne=Ce[ze];Ne.enumerable=Ne.enumerable||!1,Ne.configurable=!0,"value"in Ne&&(Ne.writable=!0),Object.defineProperty(Me,Ne.key,Ne)}}function Se(Me,Ce,ze){return Ce&&De(Me.prototype,Ce),ze&&De(Me,ze),Me}be.exports=Se,be.exports.default=be.exports,be.exports.__esModule=!0}),n=i(function(be){function De(Se,Me){return be.exports=De=Object.setPrototypeOf||function(Ce,ze){return Ce.__proto__=ze,Ce},be.exports.default=be.exports,be.exports.__esModule=!0,De(Se,Me)}be.exports=De,be.exports.default=be.exports,be.exports.__esModule=!0}),a=i(function(be){function De(Se,Me){Se.prototype=Object.create(Me.prototype),Se.prototype.constructor=Se,n(Se,Me)}be.exports=De,be.exports.default=be.exports,be.exports.__esModule=!0}),s=function(){function be(){this.listeners={}}var De=be.prototype;return De.on=function(Se,Me){this.listeners[Se]||(this.listeners[Se]=[]),this.listeners[Se].push(Me)},De.off=function(Se,Me){if(!this.listeners[Se])return!1;var Ce=this.listeners[Se].indexOf(Me);return this.listeners[Se]=this.listeners[Se].slice(0),this.listeners[Se].splice(Ce,1),Ce>-1},De.trigger=function(Se){var Me=this.listeners[Se];if(Me)if(arguments.length===2)for(var Ce=Me.length,ze=0;ze<Ce;++ze)Me[ze].call(this,arguments[1]);else for(var Ne=Array.prototype.slice.call(arguments,1),Ye=Me.length,tt=0;tt<Ye;++tt)Me[tt].apply(this,Ne)},De.dispose=function(){this.listeners={}},De.pipe=function(Se){this.on("data",function(Me){Se.push(Me)})},be}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(be){return be.subarray(0,be.byteLength-be[be.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var l,h=function(){var be,De,Se,Me,Ce,ze,Ne,Ye,tt=[[[],[],[],[],[]],[[],[],[],[],[]]],Dt=tt[0],St=tt[1],ot=Dt[4],Rt=St[4],Nt=[],Ut=[];for(be=0;be<256;be++)Ut[(Nt[be]=be<<1^283*(be>>7))^be]=be;for(De=Se=0;!ot[De];De^=Me||1,Se=Ut[Se]||1)for(ze=(ze=Se^Se<<1^Se<<2^Se<<3^Se<<4)>>8^255&ze^99,ot[De]=ze,Rt[ze]=De,Ye=16843009*Nt[Ce=Nt[Me=Nt[De]]]^65537*Ce^257*Me^16843008*De,Ne=257*Nt[ze]^16843008*ze,be=0;be<4;be++)Dt[be][De]=Ne=Ne<<24^Ne>>>8,St[be][ze]=Ye=Ye<<24^Ye>>>8;for(be=0;be<5;be++)Dt[be]=Dt[be].slice(0),St[be]=St[be].slice(0);return tt},g=null,b=function(){function be(De){g||(g=h()),this._tables=[[g[0][0].slice(),g[0][1].slice(),g[0][2].slice(),g[0][3].slice(),g[0][4].slice()],[g[1][0].slice(),g[1][1].slice(),g[1][2].slice(),g[1][3].slice(),g[1][4].slice()]];var Se,Me,Ce,ze=this._tables[0][4],Ne=this._tables[1],Ye=De.length,tt=1;if(Ye!==4&&Ye!==6&&Ye!==8)throw new Error("Invalid aes key size");var Dt=De.slice(0),St=[];for(this._key=[Dt,St],Se=Ye;Se<4*Ye+28;Se++)Ce=Dt[Se-1],(Se%Ye==0||Ye===8&&Se%Ye==4)&&(Ce=ze[Ce>>>24]<<24^ze[Ce>>16&255]<<16^ze[Ce>>8&255]<<8^ze[255&Ce],Se%Ye==0&&(Ce=Ce<<8^Ce>>>24^tt<<24,tt=tt<<1^283*(tt>>7))),Dt[Se]=Dt[Se-Ye]^Ce;for(Me=0;Se;Me++,Se--)Ce=Dt[3&Me?Se:Se-4],St[Me]=Se<=4||Me<4?Ce:Ne[0][ze[Ce>>>24]]^Ne[1][ze[Ce>>16&255]]^Ne[2][ze[Ce>>8&255]]^Ne[3][ze[255&Ce]]}return be.prototype.decrypt=function(De,Se,Me,Ce,ze,Ne){var Ye,tt,Dt,St,ot=this._key[1],Rt=De^ot[0],Nt=Ce^ot[1],Ut=Me^ot[2],It=Se^ot[3],Ca=ot.length/4-2,er=4,lr=this._tables[1],Tr=lr[0],At=lr[1],Sr=lr[2],Jr=lr[3],cr=lr[4];for(St=0;St<Ca;St++)Ye=Tr[Rt>>>24]^At[Nt>>16&255]^Sr[Ut>>8&255]^Jr[255&It]^ot[er],tt=Tr[Nt>>>24]^At[Ut>>16&255]^Sr[It>>8&255]^Jr[255&Rt]^ot[er+1],Dt=Tr[Ut>>>24]^At[It>>16&255]^Sr[Rt>>8&255]^Jr[255&Nt]^ot[er+2],It=Tr[It>>>24]^At[Rt>>16&255]^Sr[Nt>>8&255]^Jr[255&Ut]^ot[er+3],er+=4,Rt=Ye,Nt=tt,Ut=Dt;for(St=0;St<4;St++)ze[(3&-St)+Ne]=cr[Rt>>>24]<<24^cr[Nt>>16&255]<<16^cr[Ut>>8&255]<<8^cr[255&It]^ot[er++],Ye=Rt,Rt=Nt,Nt=Ut,Ut=It,It=Ye},be}(),_=function(be){function De(){var Me;return(Me=be.call(this,s)||this).jobs=[],Me.delay=1,Me.timeout_=null,Me}a(De,be);var Se=De.prototype;return Se.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},Se.push=function(Me){this.jobs.push(Me),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},De}(s),G=function(be){return be<<24|(65280&be)<<8|(16711680&be)>>8|be>>>24},ne=function(be,De,Se){var Me,Ce,ze,Ne,Ye,tt,Dt,St,ot,Rt=new Int32Array(be.buffer,be.byteOffset,be.byteLength>>2),Nt=new b(Array.prototype.slice.call(De)),Ut=new Uint8Array(be.byteLength),It=new Int32Array(Ut.buffer);for(Me=Se[0],Ce=Se[1],ze=Se[2],Ne=Se[3],ot=0;ot<Rt.length;ot+=4)Ye=G(Rt[ot]),tt=G(Rt[ot+1]),Dt=G(Rt[ot+2]),St=G(Rt[ot+3]),Nt.decrypt(Ye,tt,Dt,St,It,ot),It[ot]=G(It[ot]^Me),It[ot+1]=G(It[ot+1]^Ce),It[ot+2]=G(It[ot+2]^ze),It[ot+3]=G(It[ot+3]^Ne),Me=Ye,Ce=tt,ze=Dt,Ne=St;return Ut},ye=function(){function be(De,Se,Me,Ce){var ze=be.STEP,Ne=new Int32Array(De.buffer),Ye=new Uint8Array(De.byteLength),tt=0;for(this.asyncStream_=new _,this.asyncStream_.push(this.decryptChunk_(Ne.subarray(tt,tt+ze),Se,Me,Ye)),tt=ze;tt<Ne.length;tt+=ze)Me=new Uint32Array([G(Ne[tt-4]),G(Ne[tt-3]),G(Ne[tt-2]),G(Ne[tt-1])]),this.asyncStream_.push(this.decryptChunk_(Ne.subarray(tt,tt+ze),Se,Me,Ye));this.asyncStream_.push(function(){Ce(null,o(Ye))})}return be.prototype.decryptChunk_=function(De,Se,Me,Ce){return function(){var ze=ne(De,Se,Me);Ce.set(ze,De.byteOffset)}},e(be,null,[{key:"STEP",get:function(){return 32e3}}]),be}();l=typeof window<"u"?window:t!==void 0?t:typeof self<"u"?self:{};var re=function(be){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(be):be&&be.buffer instanceof ArrayBuffer},Ue=l.BigInt||Number;Ue("0x1"),Ue("0x100"),Ue("0x10000"),Ue("0x1000000"),Ue("0x100000000"),Ue("0x10000000000"),Ue("0x1000000000000"),Ue("0x100000000000000"),Ue("0x10000000000000000");var Ge=function(be){var De={};return Object.keys(be).forEach(function(Se){var Me=be[Se];re(Me)?De[Se]={bytes:Me.buffer,byteOffset:Me.byteOffset,byteLength:Me.byteLength}:De[Se]=Me}),De};self.onmessage=function(be){var De=be.data,Se=new Uint8Array(De.encrypted.bytes,De.encrypted.byteOffset,De.encrypted.byteLength),Me=new Uint32Array(De.key.bytes,De.key.byteOffset,De.key.byteLength/4),Ce=new Uint32Array(De.iv.bytes,De.iv.byteOffset,De.iv.byteLength/4);new ye(Se,Me,Ce,function(ze,Ne){self.postMessage(Ge({source:De.source,decrypted:Ne}),[Ne.buffer])})}})),Mm=rc(Lm),Rm=function(t){var i=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(i="main-desc"),i},wa=function(t,i){t.abort(),t.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)},To=function(t,i){i.activePlaylistLoader=t,t.load()},Nm=function(t,i){return function(){var r=i.segmentLoaders,e=r[t],n=r.main,a=i.mediaTypes[t],s=a.activeTrack(),o=a.getActiveGroup(),l=a.activePlaylistLoader,h=a.lastGroup_;if((!o||!h||o.id!==h.id)&&(a.lastGroup_=o,a.lastTrack_=s,wa(e,a),o&&!o.isMasterPlaylist)){if(!o.playlistLoader)return void(l&&n.resetEverything());e.resyncLoader(),To(o.playlistLoader,a)}}},Um=function(t,i){return function(){var r=i.segmentLoaders[t];i.mediaTypes[t].lastGroup_=null,r.abort(),r.pause()}},Bm=function(t,i){return function(){var r=i.masterPlaylistLoader,e=i.segmentLoaders,n=e[t],a=e.main,s=i.mediaTypes[t],o=s.activeTrack(),l=s.getActiveGroup(),h=s.activePlaylistLoader,g=s.lastTrack_;if((!g||!o||g.id!==o.id)&&(s.lastGroup_=l,s.lastTrack_=o,wa(n,s),l)){if(l.isMasterPlaylist){if(!o||!g||o.id===g.id)return;var b=i.vhs.masterPlaylistController_,_=b.selectPlaylist();return b.media()===_?void 0:(s.logger_("track change. Switching master audio from "+g.id+" to "+o.id),r.pause(),a.resetEverything(),void b.fastQualityChange_(_))}if(t==="AUDIO"){if(!l.playlistLoader)return a.setAudio(!0),void a.resetEverything();n.setAudio(!0),a.setAudio(!1)}if(h===l.playlistLoader)return void To(l.playlistLoader,s);n.track&&n.track(o),n.resetEverything(),To(l.playlistLoader,s)}}},ka={AUDIO:function(t,i){return function(){var r=i.segmentLoaders[t],e=i.mediaTypes[t],n=i.blacklistCurrentPlaylist;wa(r,e);var a=e.activeTrack(),s=e.activeGroup(),o=(s.filter(function(g){return g.default})[0]||s[0]).id,l=e.tracks[o];if(a!==l){for(var h in he.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[h].enabled=e.tracks[h]===l;e.onTrackChanged()}else n({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(t,i){return function(){var r=i.segmentLoaders[t],e=i.mediaTypes[t];he.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),wa(r,e);var n=e.activeTrack();n&&(n.mode="disabled"),e.onTrackChanged()}}},Dc={AUDIO:function(t,i,r){if(i){var e=r.tech,n=r.requestOptions,a=r.segmentLoaders[t];i.on("loadedmetadata",function(){var s=i.media();a.playlist(s,n),(!e.paused()||s.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),e.paused()||a.load()}),i.on("error",ka[t](t,r))}},SUBTITLES:function(t,i,r){var e=r.tech,n=r.requestOptions,a=r.segmentLoaders[t],s=r.mediaTypes[t];i.on("loadedmetadata",function(){var o=i.media();a.playlist(o,n),a.track(s.activeTrack()),(!e.paused()||o.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),e.paused()||a.load()}),i.on("error",ka[t](t,r))}},jm={AUDIO:function(t,i){var r=i.vhs,e=i.sourceType,n=i.segmentLoaders[t],a=i.requestOptions,s=i.master.mediaGroups,o=i.mediaTypes[t],l=o.groups,h=o.tracks,g=o.logger_,b=i.masterPlaylistLoader,_=bi(b.master);for(var G in(!s[t]||Object.keys(s[t]).length===0)&&(s[t]={main:{default:{default:!0}}},_&&(s[t].main.default.playlists=b.master.playlists)),s[t])for(var ne in l[G]||(l[G]=[]),s[t][G]){var ye=s[t][G][ne],re=void 0;if(_?(g("AUDIO group '"+G+"' label '"+ne+"' is a master playlist"),ye.isMasterPlaylist=!0,re=null):re=e==="vhs-json"&&ye.playlists?new Qr(ye.playlists[0],r,a):ye.resolvedUri?new Qr(ye.resolvedUri,r,a):ye.playlists&&e==="dash"?new po(ye.playlists[0],r,a,b):null,ye=he.mergeOptions({id:ne,playlistLoader:re},ye),Dc[t](t,ye.playlistLoader,i),l[G].push(ye),h[ne]===void 0){var Ue=new he.AudioTrack({id:ne,kind:Rm(ye),enabled:!1,language:ye.language,default:ye.default,label:ne});h[ne]=Ue}}n.on("error",ka[t](t,i))},SUBTITLES:function(t,i){var r=i.tech,e=i.vhs,n=i.sourceType,a=i.segmentLoaders[t],s=i.requestOptions,o=i.master.mediaGroups,l=i.mediaTypes[t],h=l.groups,g=l.tracks,b=i.masterPlaylistLoader;for(var _ in o[t])for(var G in h[_]||(h[_]=[]),o[t][_])if(!o[t][_][G].forced){var ne=o[t][_][G],ye=void 0;if(n==="hls")ye=new Qr(ne.resolvedUri,e,s);else if(n==="dash"){if(!ne.playlists.filter(function(Ue){return Ue.excludeUntil!==1/0}).length)return;ye=new po(ne.playlists[0],e,s,b)}else n==="vhs-json"&&(ye=new Qr(ne.playlists?ne.playlists[0]:ne.resolvedUri,e,s));if(ne=he.mergeOptions({id:G,playlistLoader:ye},ne),Dc[t](t,ne.playlistLoader,i),h[_].push(ne),g[G]===void 0){var re=r.addRemoteTextTrack({id:G,kind:"subtitles",default:ne.default&&ne.autoselect,language:ne.language,label:G},!1).track;g[G]=re}}a.on("error",ka[t](t,i))},"CLOSED-CAPTIONS":function(t,i){var r=i.tech,e=i.master.mediaGroups,n=i.mediaTypes[t],a=n.groups,s=n.tracks;for(var o in e[t])for(var l in a[o]||(a[o]=[]),e[t][o]){var h=e[t][o][l];if(/^(?:CC|SERVICE)/.test(h.instreamId)){var g=r.options_.vhs&&r.options_.vhs.captionServices||{},b={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(g[b.instreamId]&&(b=he.mergeOptions(b,g[b.instreamId])),b.default===void 0&&delete b.default,a[o].push(he.mergeOptions({id:l},h)),s[l]===void 0){var _=r.addRemoteTextTrack({id:b.instreamId,kind:"captions",default:b.default,language:b.language,label:b.label},!1).track;s[l]=_}}}}},Fm=function t(i,r){for(var e=0;e<i.length;e++)if(so(r,i[e])||i[e].playlists&&t(i[e].playlists,r))return!0;return!1},qm=function(t,i){return function(r){var e=i.masterPlaylistLoader,n=i.mediaTypes[t].groups,a=e.media();if(!a)return null;var s=null;a.attributes[t]&&(s=n[a.attributes[t]]);var o=Object.keys(n);if(!s)if(t==="AUDIO"&&o.length>1&&bi(i.master))for(var l=0;l<o.length;l++){var h=n[o[l]];if(Fm(h,a)){s=h;break}}else n.main?s=n.main:o.length===1&&(s=n[o[0]]);return r===void 0?s:r!==null&&s&&s.filter(function(g){return g.id===r.id})[0]||null}},Hm={AUDIO:function(t,i){return function(){var r=i.mediaTypes[t].tracks;for(var e in r)if(r[e].enabled)return r[e];return null}},SUBTITLES:function(t,i){return function(){var r=i.mediaTypes[t].tracks;for(var e in r)if(r[e].mode==="showing"||r[e].mode==="hidden")return r[e];return null}}},Vm=function(t,i){var r=i.mediaTypes;return function(){var e=r[t].activeTrack();return e?r[t].activeGroup(e):null}},Wm=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(_){jm[_](_,t)});var i=t.mediaTypes,r=t.masterPlaylistLoader,e=t.tech,n=t.vhs,a=t.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach(function(_){i[_].activeGroup=qm(_,t),i[_].activeTrack=Hm[_](_,t),i[_].onGroupChanged=Nm(_,t),i[_].onGroupChanging=Um(_,t),i[_].onTrackChanged=Bm(_,t),i[_].getActiveGroup=Vm(_,t)});var l=i.AUDIO.activeGroup();if(l){var h=(l.filter(function(_){return _.default})[0]||l[0]).id;i.AUDIO.tracks[h].enabled=!0,i.AUDIO.onGroupChanged(),i.AUDIO.onTrackChanged(),i.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(_){return i[_].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(_){return i[_].onGroupChanging()})});var g=function(){i.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};for(var b in e.audioTracks().addEventListener("change",g),e.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged),n.on("dispose",function(){e.audioTracks().removeEventListener("change",g),e.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)}),e.clearTracks("audio"),i.AUDIO.tracks)e.audioTracks().addTrack(i.AUDIO.tracks[b])},Gm=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(i){t[i]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Jn,activeTrack:Jn,getActiveGroup:Jn,onGroupChanged:Jn,onTrackChanged:Jn,lastTrack_:null,logger_:kn("MediaGroups["+i+"]")}}),t},zm=120,Xm=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Km=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},Qm=function(t){var i=t.currentPlaylist,r=t.buffered,e=t.currentTime,n=t.nextPlaylist,a=t.bufferLowWaterLine,s=t.bufferHighWaterLine,o=t.duration,l=t.experimentalBufferBasedABR,h=t.log;if(!n)return he.log.warn("We received no playlist to switch to. Please check your stream."),!1;var g="allowing switch "+(i&&i.id||"null")+" -> "+n.id;if(!i)return h(g+" as current playlist is not set"),!0;if(n.id===i.id)return!1;var b=!!Kr(r,e).length;if(!i.endList)return b||typeof i.partTargetDuration!="number"?(h(g+" as current playlist is live"),!0):(h("not "+g+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var _=to(r,e),G=l?qt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:qt.MAX_BUFFER_LOW_WATER_LINE;if(o<G)return h(g+" as duration < max low water line ("+o+" < "+G+")"),!0;var ne=n.attributes.BANDWIDTH,ye=i.attributes.BANDWIDTH;if(ne<ye&&(!l||_<s)){var re=g+" as next bandwidth < current bandwidth ("+ne+" < "+ye+")";return l&&(re+=" and forwardBuffer < bufferHighWaterLine ("+_+" < "+s+")"),h(re),!0}if((!l||ne>ye)&&_>=a){var Ue=g+" as forwardBuffer >= bufferLowWaterLine ("+_+" >= "+a+")";return l&&(Ue+=" and next bandwidth > current bandwidth ("+ne+" > "+ye+")"),h(Ue),!0}return h("not "+g+" as no switching criteria met"),!1},Ym=function(t){function i(e){var n;n=t.call(this)||this;var a=e.src,s=e.handleManifestRedirects,o=e.withCredentials,l=e.tech,h=e.bandwidth,g=e.externVhs,b=e.useCueTags,_=e.blacklistDuration,G=e.enableLowInitialPlaylist,ne=e.sourceType,ye=e.cacheEncryptionKeys,re=e.experimentalBufferBasedABR,Ue=e.experimentalLeastPixelDiffSelector,Ge=e.captionServices;if(!a)throw new Error("A non-empty playlist URL or JSON manifest string is required");var be=e.maxPlaylistRetries;be==null&&(be=1/0),Zn=g,n.experimentalBufferBasedABR=!!re,n.experimentalLeastPixelDiffSelector=!!Ue,n.withCredentials=o,n.tech_=l,n.vhs_=l.vhs,n.sourceType_=ne,n.useCueTags_=b,n.blacklistDuration=_,n.maxPlaylistRetries=be,n.enableLowInitialPlaylist=G,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:be,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=Gm(),n.mediaSource=new(O()).MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(w(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(w(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(w(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=he.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Om(e),n.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new Mm,n.sourceUpdater_=new Ic(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Dm;var De={vhs:n.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:Ge,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:h,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:ye,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:e.experimentalExactManifestTimings};n.masterPlaylistLoader_=n.sourceType_==="dash"?new po(a,n.vhs_,n.requestOptions_):new Qr(a,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new yo(he.mergeOptions(De,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new yo(he.mergeOptions(De,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new xm(he.mergeOptions(De,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(Me,Ce){function ze(){l.off("vttjserror",Ne),Me()}function Ne(){l.off("vttjsloaded",ze),Ce()}l.one("vttjsloaded",ze),l.one("vttjserror",Ne),l.addWebVttScript_()})}}),e),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),Xm.forEach(function(Me){n[Me+"_"]=Km.bind(w(n),Me)}),n.logger_=kn("MPC"),n.triggeredFmp4Usage=!1,n.tech_.preload()==="none"?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var Se=n.tech_.preload()==="none"?"play":"loadstart";return n.tech_.one(Se,function(){var Me=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-Me,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}y(i,t);var r=i.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return e===-1||n===-1?-1:e+n},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(e){e===void 0&&(e="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,e)},r.switchMedia_=function(e,n,a){var s=this.media(),o=s&&(s.id||s.uri),l=e.id||e.uri;o&&o!==l&&(this.logger_("switch media "+o+" -> "+l+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(e,a)},r.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=O().setInterval(function(){return e.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O().clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var e=this.master(),n=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return n;var a,s=e.mediaGroups.AUDIO,o=Object.keys(s);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{var l=s.main||o.length&&s[o[0]];for(var h in l)if(l[h].default){a={label:h};break}}if(!a)return n;var g=[];for(var b in s)if(s[b][a.label]){var _=s[b][a.label];if(_.playlists&&_.playlists.length)g.push.apply(g,_.playlists);else if(_.uri)g.push(_);else if(e.playlists.length)for(var G=0;G<e.playlists.length;G++){var ne=e.playlists[G];ne.attributes&&ne.attributes.AUDIO&&ne.attributes.AUDIO===b&&g.push(ne)}}return g.length?g:n},r.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=e.masterPlaylistLoader_.media(),a=1.5*n.targetDuration*1e3;ao(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=a,n.endList&&e.tech_.preload()!=="none"&&(e.mainSegmentLoader_.playlist(n,e.requestOptions_),e.mainSegmentLoader_.load()),Wm({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),n),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var n=e.masterPlaylistLoader_.media();if(!n){var a;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(a=e.selectInitialPlaylist()),a||(a=e.selectPlaylist()),!a||!e.shouldSwitchToMedia_(a)||(e.initialMedia_=a,e.switchMedia_(e.initialMedia_,"initial"),e.sourceType_!=="vhs-json"||!e.initialMedia_.segments))return;n=e.initialMedia_}e.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=e.masterPlaylistLoader_.media(),a=1.5*n.targetDuration*1e3;ao(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=a,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(n,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=e.masterPlaylistLoader_.media();n.lastExcludeReason_!=="playlist-unchanged"&&e.stuckAtPlaylistEnd_(n)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},r.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},r.triggerPresenceUsage_=function(e,n){var a=e.mediaGroups||{},s=!0,o=Object.keys(a.AUDIO);for(var l in a.AUDIO)for(var h in a.AUDIO[l])a.AUDIO[l][h].uri||(s=!1);s&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Zn.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),o.length&&Object.keys(a.AUDIO[o[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(e){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),s=this.bufferLowWaterLine(),o=this.bufferHighWaterLine(),l=this.tech_.buffered();return Qm({buffered:l,currentTime:a,currentPlaylist:n,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:o,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},zm))});var n=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var a=e.getCodecsOrExclude_();!a||e.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},r.fastQualityChange_=function(e){var n=this;e===void 0&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){he.browser.IE_VERSION||he.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},r.setupFirstPlay=function(){var e=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(he.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(a.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},r.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();e!==void 0&&typeof e.then=="function"&&e.then(null,function(n){})}this.trigger("sourceopen")},r.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var n=this.duration();e[e.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},r.handleDurationChange_=function(){this.tech_.trigger("durationchange")},r.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!n||n.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}!e||(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},r.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;var a=Zn.Playlist.playlistEnd(e,n),s=this.tech_.currentTime(),o=this.tech_.buffered();if(!o.length)return a-s<=Mn;var l=o.end(o.length-1);return l-s<=Mn&&a-l<=Mn},r.blacklistCurrentPlaylist=function(e,n){e===void 0&&(e={});var a=e.playlist||this.masterPlaylistLoader_.media();if(n=n||e.blacklistDuration||this.blacklistDuration,!a)return this.error=e,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));a.playlistErrors_++;var s,o=this.masterPlaylistLoader_.master.playlists,l=o.filter(ga),h=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return he.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(h);if(h){var g=!1;o.forEach(function(re){if(re!==a){var Ue=re.excludeUntil;Ue!==void 0&&Ue!==1/0&&(g=!0,delete re.excludeUntil)}}),g&&(he.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}s=a.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,a.excludeUntil=s,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var b=this.selectPlaylist();if(!b)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var _=e.internal?this.logger_:he.log.warn,G=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+G+" Switching to playlist "+b.id+"."),b.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),b.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var ne=b.targetDuration/2*1e3||5e3,ye=typeof b.lastRequest=="number"&&Date.now()-b.lastRequest<=ne;return this.switchMedia_(b,"exclude",h||ye)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(e,n){var a=this,s=[],o=e==="all";(o||e==="main")&&s.push(this.masterPlaylistLoader_);var l=[];(o||e==="audio")&&l.push("AUDIO"),(o||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(h){var g=a.mediaTypes_[h]&&a.mediaTypes_[h].activePlaylistLoader;g&&s.push(g)}),["main","audio","subtitle"].forEach(function(h){var g=a[h+"SegmentLoader_"];g&&(e===h||e==="all")&&s.push(g)}),s.forEach(function(h){return n.forEach(function(g){typeof h[g]=="function"&&h[g]()})})},r.setCurrentTime=function(e){var n=Kr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?n&&n.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zn.Playlist.duration(e):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var s,o,l=this.masterPlaylistLoader_.master,h=Zn.Playlist.seekable(n,a,Zn.Playlist.liveEdgeDelay(l,n));h.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),(a=this.syncController_.getExpiredTime(n,this.duration()))===null||(e=Zn.Playlist.seekable(n,a,Zn.Playlist.liveEdgeDelay(l,n))).length===0)||(this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>h.end(0)||h.start(0)>e.end(0)?this.seekable_=h:this.seekable_=he.createTimeRanges([[e.start(0)>h.start(0)?e.start(0):h.start(0),e.end(0)<h.end(0)?e.end(0):h.end(0)]]):this.seekable_=h,(!this.seekable_||!this.seekable_.length||this.seekable_.end(0)!==s||this.seekable_.start(0)!==o)&&(this.logger_("seekable updated ["+Al(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")))}}}},r.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open")return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1))}else{var a=this.tech_.buffered(),s=Zn.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(s=Math.max(s,a.end(a.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}},r.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=e.mediaTypes_[n].groups;for(var s in a)a[s].forEach(function(o){o.playlistLoader&&o.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()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!n||!a)},r.getCodecsOrExclude_=function(){var e=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};n.video=n.main;var a=Si(this.master(),this.media()),s={},o=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(s.video=a.video||n.main.videoCodec||Et),n.main.isMuxed&&(s.video+=","+(a.audio||n.main.audioCodec||$e)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||o)&&(s.audio=a.audio||n.main.audioCodec||n.audio.audioCodec||$e,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),s.audio||s.video){var l,h=function(ne,ye){return ne?He(ye):Ze(ye)},g={};if(["video","audio"].forEach(function(ne){if(s.hasOwnProperty(ne)&&!h(n[ne].isFmp4,s[ne])){var ye=n[ne].isFmp4?"browser":"muxer";g[ye]=g[ye]||[],g[ye].push(s[ne]),ne==="audio"&&(l=ye)}}),o&&l&&this.media().attributes.AUDIO){var b=this.media().attributes.AUDIO;this.master().playlists.forEach(function(ne){(ne.attributes&&ne.attributes.AUDIO)===b&&ne!==e.media()&&(ne.excludeUntil=1/0)}),this.logger_("excluding audio group "+b+" as "+l+' does not support codec(s): "'+s.audio+'"')}if(!Object.keys(g).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var _=[];if(["video","audio"].forEach(function(ne){var ye=(Z(e.sourceUpdater_.codecs[ne]||"")[0]||{}).type,re=(Z(s[ne]||"")[0]||{}).type;ye&&re&&ye.toLowerCase()!==re.toLowerCase()&&_.push('"'+e.sourceUpdater_.codecs[ne]+'" -> "'+s[ne]+'"')}),_.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+_.join(", ")+".",blacklistDuration:1/0,internal:!0})}return s}var G=Object.keys(g).reduce(function(ne,ye){return ne&&(ne+=", "),ne+=ye+' does not support codec(s): "'+g[ye].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:G,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},r.tryToCreateSourceBuffers_=function(){if(this.mediaSource.readyState==="open"&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var n=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},r.excludeUnsupportedVariants_=function(){var e=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(s){var o=n[s];if(a.indexOf(o.id)===-1){a.push(o.id);var l=Si(e.master,o),h=[];l.audio&&!Ze(l.audio)&&!He(l.audio)&&h.push("audio codec "+l.audio),l.video&&!Ze(l.video)&&!He(l.video)&&h.push("video codec "+l.video),l.text&&l.text==="stpp.ttml.im1t"&&h.push("text codec "+l.text),h.length&&(o.excludeUntil=1/0,e.logger_("excluding "+o.id+" for unsupported: "+h.join(", ")))}})},r.excludeIncompatibleVariants_=function(e){var n=this,a=[],s=this.master().playlists,o=ba(Z(e)),l=gc(o),h=o.video&&Z(o.video)[0]||null,g=o.audio&&Z(o.audio)[0]||null;Object.keys(s).forEach(function(b){var _=s[b];if(a.indexOf(_.id)===-1&&_.excludeUntil!==1/0){a.push(_.id);var G=[],ne=Si(n.masterPlaylistLoader_.master,_),ye=gc(ne);if(ne.audio||ne.video){if(ye!==l&&G.push('codec count "'+ye+'" !== "'+l+'"'),!n.sourceUpdater_.canChangeType()){var re=ne.video&&Z(ne.video)[0]||null,Ue=ne.audio&&Z(ne.audio)[0]||null;re&&h&&re.type.toLowerCase()!==h.type.toLowerCase()&&G.push('video codec "'+re.type+'" !== "'+h.type+'"'),Ue&&g&&Ue.type.toLowerCase()!==g.type.toLowerCase()&&G.push('audio codec "'+Ue.type+'" !== "'+g.type+'"')}G.length&&(_.excludeUntil=1/0,n.logger_("blacklisting "+_.id+": "+G.join(" && ")))}}})},r.updateAdCues_=function(e){var n=0,a=this.seekable();a.length&&(n=a.start(0)),Am(e,this.cueTagsTrack_,n)},r.goalBufferLength=function(){var e=this.tech_.currentTime(),n=qt.GOAL_BUFFER_LENGTH,a=qt.GOAL_BUFFER_LENGTH_RATE,s=Math.max(n,qt.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+e*a,s)},r.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),n=qt.BUFFER_LOW_WATER_LINE,a=qt.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(n,qt.MAX_BUFFER_LOW_WATER_LINE),o=Math.max(n,qt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+e*a,this.experimentalBufferBasedABR?o:s)},r.bufferHighWaterLine=function(){return qt.BUFFER_HIGH_WATER_LINE},i}(he.EventTarget),$m=function(t,i,r){return function(e){var n=t.master.playlists[i],a=io(n),s=ga(n);return e===void 0?s:(e?delete n.disabled:n.disabled=!0,e!==s&&!a&&(r(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},Jm=function(t,i,r){var e=t.masterPlaylistController_,n=e[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(e);if(i.attributes){var a=i.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=Si(e.master(),i),this.playlist=i,this.id=r,this.enabled=$m(t.playlists,i.id,n)},Zm=function(t){t.representations=function(){var i=t.masterPlaylistController_.master(),r=bi(i)?t.masterPlaylistController_.getAudioTrackPlaylists_():i.playlists;return r?r.filter(function(e){return!io(e)}).map(function(e,n){return new Jm(t,e,e.id)}):[]}},Lc=["seeking","seeked","pause","playing","error"],eg=function(){function t(r){var e=this;this.masterPlaylistController_=r.masterPlaylistController,this.tech_=r.tech,this.seekable=r.seekable,this.allowSeeksWithinUnsafeLiveWindow=r.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=r.liveRangeSafeTimeDelta,this.media=r.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=kn("PlaybackWatcher"),this.logger_("initialize");var n=function(){return e.monitorCurrentTime_()},a=function(){return e.monitorCurrentTime_()},s=function(){return e.techWaiting_()},o=function(){return e.cancelTimer_()},l=this.masterPlaylistController_,h=["main","subtitle","audio"],g={};h.forEach(function(_){g[_]={reset:function(){return e.resetSegmentDownloads_(_)},updateend:function(){return e.checkSegmentDownloads_(_)}},l[_+"SegmentLoader_"].on("appendsdone",g[_].updateend),l[_+"SegmentLoader_"].on("playlistupdate",g[_].reset),e.tech_.on(["seeked","seeking"],g[_].reset)});var b=function(_){["main","audio"].forEach(function(G){l[G+"SegmentLoader_"][_]("appended",e.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){e.fixesBadSeeks_()&&(e.consecutiveUpdates=0,e.lastRecordedTime=e.tech_.currentTime(),b("off"))},this.clearSeekingAppendCheck_=function(){return b("off")},this.watchForBadSeeking_=function(){e.clearSeekingAppendCheck_(),b("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(Lc,o),this.tech_.on("canplay",a),this.tech_.one("play",n),this.dispose=function(){e.clearSeekingAppendCheck_(),e.logger_("dispose"),e.tech_.off("waiting",s),e.tech_.off(Lc,o),e.tech_.off("canplay",a),e.tech_.off("play",n),e.tech_.off("seeking",e.watchForBadSeeking_),e.tech_.off("seeked",e.clearSeekingAppendCheck_),h.forEach(function(_){l[_+"SegmentLoader_"].off("appendsdone",g[_].updateend),l[_+"SegmentLoader_"].off("playlistupdate",g[_].reset),e.tech_.off(["seeked","seeking"],g[_].reset)}),e.checkCurrentTimeTimeout_&&O().clearTimeout(e.checkCurrentTimeTimeout_),e.cancelTimer_()}}var i=t.prototype;return i.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O().setTimeout(this.monitorCurrentTime_.bind(this),250)},i.resetSegmentDownloads_=function(r){var e=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=e.buffered_()},i.checkSegmentDownloads_=function(r){var e=this.masterPlaylistController_,n=e[r+"SegmentLoader_"],a=n.buffered_(),s=Xp(this[r+"Buffered_"],a);this[r+"Buffered_"]=a,s?this.resetSegmentDownloads_(r):(this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:br(a)}),!(this[r+"StalledDownloads_"]<10)&&(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0)))},i.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var r=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===r&&(!e.length||r+Mn>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},i.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},i.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var r,e=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(e,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,n)){var a=e.start(0);r=a+(a===e.end(0)?0:Mn)}if(r!==void 0)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Al(e)+". Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0;for(var s=this.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=s.audioBuffer?s.audioBuffered():null,h=s.videoBuffer?s.videoBuffered():null,g=this.media(),b=g.partTargetDuration?g.partTargetDuration:2*(g.targetDuration-ur),_=[l,h],G=0;G<_.length;G++)if(_[G]&&to(_[G],n)<b)return!1;var ne=ma(o,n);return ne.length!==0&&(r=ne.start(0)+Mn,this.logger_("Buffered region starts ("+ne.start(0)+") just beyond seek point ("+n+"). Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0)},i.waiting_=function(){if(!this.techWaiting_()){var r=this.tech_.currentTime(),e=this.tech_.buffered(),n=Kr(e,r);if(n.length&&r+3<=n.end(0))return this.cancelTimer_(),this.tech_.setCurrentTime(r),this.logger_("Stopped at "+r+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},i.techWaiting_=function(){var r=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,e)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=ma(s,e);if(o.length>0){var l=o.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+l+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*l,e),!0}return!1},i.afterSeekableWindow_=function(r,e,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var s=r.end(r.length-1)+Mn;return!n.endList&&a&&(s=r.end(r.length-1)+3*n.targetDuration),e>s},i.beforeSeekableWindow_=function(r,e){return!!(r.length&&r.start(0)>0&&e<r.start(0)-this.liveRangeSafeTimeDelta)},i.videoUnderflow_=function(r){var e=r.videoBuffered,n=r.audioBuffered,a=r.currentTime;if(e){var s;if(e.length&&n.length){var o=Kr(e,a-3),l=Kr(e,a),h=Kr(n,a);h.length&&!l.length&&o.length&&(s={start:o.end(0),end:h.end(0)})}else ma(e,a).length||(s=this.gapFromVideoUnderflow_(e,a));return!!s&&(this.logger_("Encountered a gap in video from "+s.start+" to "+s.end+". Seeking to current time "+a),!0)}},i.skipTheGap_=function(r){var e=this.tech_.buffered(),n=this.tech_.currentTime(),a=ma(e,n);this.cancelTimer_(),a.length!==0&&n===r&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",r,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+ur),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},i.gapFromVideoUnderflow_=function(r,e){for(var n=Wp(r),a=0;a<n.length;a++){var s=n.start(a),o=n.end(a);if(e-s<4&&e-s>2)return{start:s,end:o}}return null},t}(),tg={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ng=function t(i,r){var e=0,n=0,a=he.mergeOptions(tg,r);i.ready(function(){i.trigger({type:"usage",name:"vhs-error-reload-initialized"}),i.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){n&&i.currentTime(n)},o=function(b){b!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(b),i.trigger({type:"usage",name:"vhs-error-reload"}),i.trigger({type:"usage",name:"hls-error-reload"}),i.play())},l=function(){return Date.now()-e<1e3*a.errorInterval?(i.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void i.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&typeof a.getSource=="function"?(e=Date.now(),a.getSource.call(i,o)):void he.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},h=function b(){i.off("loadedmetadata",s),i.off("error",l),i.off("dispose",b)},g=function(b){h(),t(i,b)};i.on("error",l),i.on("dispose",h),i.reloadSourceOnError=g},rg=function(t){ng(this,t)},Mc="2.16.0",ig="6.0.1",ag="0.22.1",sg="4.8.0",og="3.1.3",Vt={PlaylistLoader:Qr,Playlist:sn,utils:yf,STANDARD_PLAYLIST_SELECTOR:_c,INITIAL_PLAYLIST_SELECTOR:am,lastBandwidthSelector:_c,movingAverageBandwidthSelector:rm,comparePlaylistBandwidth:vo,comparePlaylistResolution:nm,xhr:Xl()};Object.keys(qt).forEach(function(t){Object.defineProperty(Vt,t,{get:function(){return he.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),qt[t]},set:function(i){he.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0?he.log.warn("value of Vhs."+t+" must be greater than or equal to 0"):qt[t]=i}})});var Rc="videojs-vhs",Nc=function(t,i){for(var r=i.media(),e=-1,n=0;n<t.length;n++)if(t[n].id===r.id){e=n;break}t.selectedIndex_=e,t.trigger({selectedIndex:e,type:"change"})},ug=function(t,i){i.representations().forEach(function(r){t.addQualityLevel(r)}),Nc(t,i.playlists)};Vt.canPlaySource=function(){return he.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var lg=function(t,i,r){if(!t)return t;var e={};i&&i.attributes&&i.attributes.CODECS&&(e=ba(Z(i.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(e.audio=r.attributes.CODECS);var n=Fe(e.video),a=Fe(e.audio),s={};for(var o in t)s[o]={},a&&(s[o].audioContentType=a),n&&(s[o].videoContentType=n),i.contentProtection&&i.contentProtection[o]&&i.contentProtection[o].pssh&&(s[o].pssh=i.contentProtection[o].pssh),typeof t[o]=="string"&&(s[o].url=t[o]);return he.mergeOptions(t,s)},cg=function(t,i){return t.reduce(function(r,e){if(!e.contentProtection)return r;var n=i.reduce(function(a,s){var o=e.contentProtection[s];return o&&o.pssh&&(a[s]={pssh:o.pssh}),a},{});return Object.keys(n).length&&r.push(n),r},[])},dg=function(t){var i=t.player,r=t.sourceKeySystems,e=t.audioMedia,n=t.mainPlaylists;if(!i.eme.initializeMediaKeys)return Promise.resolve();var a=e?n.concat([e]):n,s=cg(a,Object.keys(r)),o=[],l=[];return s.forEach(function(h){l.push(new Promise(function(g,b){i.tech_.one("keysessioncreated",g)})),o.push(new Promise(function(g,b){i.eme.initializeMediaKeys({keySystems:h},function(_){_?b(_):g()})}))}),Promise.race([Promise.all(o),Promise.race(l)])},hg=function(t){var i=t.player,r=t.sourceKeySystems,e=t.media,n=t.audioMedia,a=lg(r,e,n);return!(!a||(i.currentSource().keySystems=a,a&&!i.eme&&(he.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))},Uc=function(){if(!O().localStorage)return null;var t=O().localStorage.getItem(Rc);if(!t)return null;try{return JSON.parse(t)}catch{return null}},pg=function(t){if(!O().localStorage)return!1;var i=Uc();i=i?he.mergeOptions(i,t):t;try{O().localStorage.setItem(Rc,JSON.stringify(i))}catch{return!1}return i},fg=function(t){return t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t};Vt.supportsNativeHls=function(){if(!ie()||!ie().createElement)return!1;var t=ie().createElement("video");return!!he.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(t.canPlayType(i))})}(),Vt.supportsNativeDash=!!(ie()&&ie().createElement&&he.getTech("Html5").isSupported())&&/maybe|probably/i.test(ie().createElement("video").canPlayType("application/dash+xml")),Vt.supportsTypeNatively=function(t){return t==="hls"?Vt.supportsNativeHls:t==="dash"&&Vt.supportsNativeDash},Vt.isSupported=function(){return he.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var So=function(t){function i(e,n,a){var s;if(s=t.call(this,n,he.mergeOptions(a.hls,a.vhs))||this,a.hls&&Object.keys(a.hls).length&&he.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof a.initialBandwidth=="number"&&(s.options_.bandwidth=a.initialBandwidth),s.logger_=kn("VhsHandler"),n.options_&&n.options_.playerId){var o=he(n.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return he.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),w(s)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return he.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),w(s)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return he.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),w(s)},configurable:!0}),s.player_=o}if(s.tech_=n,s.source_=e,s.stats={},s.ignoreNextSeekingEvent_=!1,s.setOptions_(),s.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(s.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return s.on(ie(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(l){var h=ie().fullscreenElement||ie().webkitFullscreenElement||ie().mozFullScreenElement||ie().msFullscreenElement;h&&h.contains(s.tech_.el())?s.masterPlaylistController_.fastQualityChange_():s.masterPlaylistController_.checkABR_()}),s.on(s.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),s.on(s.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),s.on(s.tech_,"play",s.play),s}y(i,t);var r=i.prototype;return r.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,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,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=Uc();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=qt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===qt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){e.source_[a]!==void 0&&(e.options_[a]=e.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},r.src=function(e,n){var a=this;if(e){this.setOptions_(),this.options_.src=fg(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Vt,this.options_.sourceType=Lt(n),this.options_.seekTo=function(l){a.tech_.setCurrentTime(l)},this.options_.smoothQualityChange&&he.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Ym(this.options_);var s=he.mergeOptions({liveRangeSafeTimeDelta:Mn},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new eg(s),this.masterPlaylistController_.on("error",function(){var l=he.players[a.tech_.options_.playerId],h=a.masterPlaylistController_.error;typeof h!="object"||h.code?typeof h=="string"&&(h={message:h,code:3}):h.code=3,l.error(h)});var o=this.options_.experimentalBufferBasedABR?Vt.movingAverageBandwidthSelector(.55):Vt.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):o.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Vt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(l){this.masterPlaylistController_.selectPlaylist=l.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(l){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=l,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var l=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,h=O().navigator.connection||O().navigator.mozConnection||O().navigator.webkitConnection,g=1e7;if(this.options_.useNetworkInformationApi&&h){var b=1e3*h.downlink*1e3;l=b>=g&&l>=g?Math.max(l,b):b}return l},set:function(l){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=l,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var l,h=1/(this.bandwidth||1);return l=this.throughput>0?1/this.throughput:0,Math.floor(1/(h+l))},set:function(){he.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return br(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return br(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&pg({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){Zm(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var e=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),dg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var e=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=hg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});this.player_.tech_.on("keystatuschange",function(s){if(s.status==="output-restricted"){var o=e.masterPlaylistController_.master();if(o&&o.playlists){var l,h=[];o.playlists.forEach(function(g){g&&g.attributes&&g.attributes.RESOLUTION&&g.attributes.RESOLUTION.height>=720&&(!g.excludeUntil||g.excludeUntil<1/0)&&(g.excludeUntil=1/0,h.push(g))}),h.length&&((l=he.log).warn.apply(l,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(h)),e.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),he.browser.IE_VERSION!==11&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},r.setupQualityLevels_=function(){var e=this,n=he.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){ug(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){Nc(e.qualityLevels_,e.playlists)}))},i.version=function(){return{"@videojs/http-streaming":Mc,"mux.js":ig,"mpd-parser":ag,"m3u8-parser":sg,"aes-decrypter":og}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return Ic.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&O().URL.revokeObjectURL&&(O().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),t.prototype.dispose.call(this)},r.convertToProgramTime=function(e,n){return kf({playlist:this.masterPlaylistController_.media(),time:e,callback:n})},r.seekToProgramTime=function(e,n,a,s){return a===void 0&&(a=!0),s===void 0&&(s=2),Cf({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:s,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},i}(he.getComponent("Component")),ki={name:"videojs-http-streaming",VERSION:Mc,canHandleSource:function(t,i){i===void 0&&(i={});var r=he.mergeOptions(he.options,i);return ki.canPlayType(t.type,r)},handleSource:function(t,i,r){r===void 0&&(r={});var e=he.mergeOptions(he.options,r);return i.vhs=new So(t,i,e),he.hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return he.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),i.vhs},configurable:!0}),i.vhs.xhr=Xl(),i.vhs.src(t.src,t.type),i.vhs},canPlayType:function(t,i){var r=Lt(t);if(!r)return"";var e=ki.getOverrideNative(i);return!Vt.supportsTypeNatively(r)||e?"maybe":""},getOverrideNative:function(t){t===void 0&&(t={});var i=t,r=i.vhs,e=r===void 0?{}:r,n=i.hls,a=n===void 0?{}:n,s=!(he.browser.IS_ANY_SAFARI||he.browser.IS_IOS),o=e.overrideNative,l=o===void 0?s:o,h=a.overrideNative;return h!==void 0&&h||l}};He("avc1.4d400d,mp4a.40.2")&&he.getTech("Html5").registerSourceHandler(ki,0),he.VhsHandler=So,Object.defineProperty(he,"HlsHandler",{get:function(){return he.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),So},configurable:!0}),he.VhsSourceHandler=ki,Object.defineProperty(he,"HlsSourceHandler",{get:function(){return he.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),ki},configurable:!0}),he.Vhs=Vt,Object.defineProperty(he,"Hls",{get:function(){return he.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Vt},configurable:!0}),he.use||(he.registerComponent("Hls",Vt),he.registerComponent("Vhs",Vt)),he.options.vhs=he.options.vhs||{},he.options.hls=he.options.hls||{},he.getPlugin&&he.getPlugin("reloadSourceOnError")||(he.registerPlugin||he.plugin)("reloadSourceOnError",rg);const mg=he},288:(We,je,Ae)=>{/** * videojs-mux * @version 4.6.6 * @copyright 2022 Mux, Inc. * @license */var Ie;typeof self<"u",Ie=function(O){return function(ke){function ie(Te){if(we[Te])return we[Te].exports;var U=we[Te]={i:Te,l:!1,exports:{}};return ke[Te].call(U.exports,U,U.exports,ie),U.l=!0,U.exports}var we={};return ie.m=ke,ie.c=we,ie.d=function(Te,U,w){ie.o(Te,U)||Object.defineProperty(Te,U,{configurable:!1,enumerable:!0,get:w})},ie.n=function(Te){var U=Te&&Te.__esModule?function(){return Te.default}:function(){return Te};return ie.d(U,"a",U),U},ie.o=function(Te,U){return Object.prototype.hasOwnProperty.call(Te,U)},ie.p="",ie(ie.s=2)}([function(ke,ie,we){var Te;typeof self<"u",Te=function(){return function(U){function w(y){if(L[y])return L[y].exports;var A=L[y]={i:y,l:!1,exports:{}};return U[y].call(A.exports,A,A.exports,w),A.l=!0,A.exports}var L={};return w.m=U,w.c=L,w.d=function(y,A,I){w.o(y,A)||Object.defineProperty(y,A,{configurable:!1,enumerable:!0,get:I})},w.n=function(y){var A=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(A,"a",A),A},w.o=function(y,A){return Object.prototype.hasOwnProperty.call(y,A)},w.p="",w(w.s=18)}([function(U,w,L){(function(y){var A;A=typeof window<"u"?window:y!==void 0?y:typeof self<"u"?self:{},U.exports=A}).call(w,L(20))},function(U,w){function L($,Z,fe){switch(fe.length){case 0:return $.call(Z);case 1:return $.call(Z,fe[0]);case 2:return $.call(Z,fe[0],fe[1]);case 3:return $.call(Z,fe[0],fe[1],fe[2])}return $.apply(Z,fe)}function y($,Z){for(var fe=-1,Pe=Array($);++fe<$;)Pe[fe]=Z(fe);return Pe}function A($,Z){var fe=Y($)||N($)?y($.length,String):[],Pe=fe.length,Re=!!Pe;for(var Fe in $)!le.call($,Fe)||Re&&(Fe=="length"||te(Fe,Pe))||fe.push(Fe);return fe}function I($,Z,fe){var Pe=$[Z];le.call($,Z)&&C(Pe,fe)&&(fe!==void 0||Z in $)||($[Z]=fe)}function E($){if(!J($))return oe($);var Z=[];for(var fe in Object($))le.call($,fe)&&fe!="constructor"&&Z.push(fe);return Z}function M($,Z){return Z=xe(Z===void 0?$.length-1:Z,0),function(){for(var fe=arguments,Pe=-1,Re=xe(fe.length-Z,0),Fe=Array(Re);++Pe<Re;)Fe[Pe]=fe[Z+Pe];Pe=-1;for(var He=Array(Z+1);++Pe<Z;)He[Pe]=fe[Pe];return He[Z]=Fe,L($,this,He)}}function H($,Z,fe,Pe){fe||(fe={});for(var Re=-1,Fe=Z.length;++Re<Fe;){var He=Z[Re],Ze=void 0;I(fe,He,Ze===void 0?$[He]:Ze)}return fe}function te($,Z){return!!(Z=Z??B)&&(typeof $=="number"||ge.test($))&&$>-1&&$%1==0&&$<Z}function V($,Z,fe){if(!X(fe))return!1;var Pe=typeof Z;return!!(Pe=="number"?R(fe)&&te(Z,fe.length):Pe=="string"&&Z in fe)&&C(fe[Z],$)}function J($){var Z=$&&$.constructor;return $===(typeof Z=="function"&&Z.prototype||ue)}function C($,Z){return $===Z||$!=$&&Z!=Z}function N($){return F($)&&le.call($,"callee")&&(!se.call($,"callee")||pe.call($)==z)}function R($){return $!=null&&D($.length)&&!ee($)}function F($){return p($)&&R($)}function ee($){var Z=X($)?pe.call($):"";return Z==ce||Z==ae}function D($){return typeof $=="number"&&$>-1&&$%1==0&&$<=B}function X($){var Z=typeof $;return!!$&&(Z=="object"||Z=="function")}function p($){return!!$&&typeof $=="object"}function v($){return R($)?A($):E($)}var P,B=9007199254740991,z="[object Arguments]",ce="[object Function]",ae="[object GeneratorFunction]",ge=/^(?:0|[1-9]\d*)$/,ue=Object.prototype,le=ue.hasOwnProperty,pe=ue.toString,se=ue.propertyIsEnumerable,oe=function($,Z){return function(fe){return $(Z(fe))}}(Object.keys,Object),xe=Math.max,Q=!se.call({valueOf:1},"valueOf"),Y=Array.isArray,de=(P=function($,Z){if(Q||J(Z)||R(Z))H(Z,v(Z),$);else for(var fe in Z)le.call(Z,fe)&&I($,fe,Z[fe])},M(function($,Z){var fe=-1,Pe=Z.length,Re=Pe>1?Z[Pe-1]:void 0,Fe=Pe>2?Z[2]:void 0;for(Re=P.length>3&&typeof Re=="function"?(Pe--,Re):void 0,Fe&&V(Z[0],Z[1],Fe)&&(Re=Pe<3?void 0:Re,Pe=1),$=Object($);++fe<Pe;){var He=Z[fe];He&&P($,He)}return $}));U.exports=de},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(0),I=(y=A)&&y.__esModule?y:{default:y},E={now:function(){var M=I.default.performance,H=M&&M.timing;return H&&typeof H.navigationStart=="number"&&typeof M.now=="function"?H.navigationStart+M.now():Date.now()}};w.default=E},function(U,w,L){function y(A,I,E){E=E===void 0?1:E,A[I]=A[I]||0,A[I]+=E}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(21),I=(y=A)&&y.__esModule?y:{default:y},E=I.default.methodFactory;I.default.methodFactory=function(M,H,te){var V=E(M,H,te);return function(){for(var J=["[mux]"],C=0;C<arguments.length;C++)J.push(arguments[C]);V.apply(void 0,J)}},I.default.setLevel(I.default.getLevel()),w.default=I.default},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y=function(E){return I(E)[0]},A=function(E){return I(E)[1]},I=function(E){if(typeof E!="string"||E==="")return["localhost"];var M=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,H=(E.match(M)||[])[4],te=void 0;return H&&(te=(H.match(/[^\.]+\.[^\.]+$/)||[])[0]),[H,te]};w.extractHostnameAndDomain=I,w.extractHostname=y,w.extractDomain=A},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(I){var E=16*Math.random()|0;return(I==="x"?E:3&E|8).toString(16)})},A=function(){return("000000"+(Math.random()*Math.pow(36,6)|0).toString(36)).slice(-6)};w.generateUUID=y,w.generateShortID=A},function(U,w,L){function y(I){var E={};return(I=I||"").trim().split(/[\r\n]+/).forEach(function(M){if(M){var H=M.split(": "),te=H.shift();te&&(A.indexOf(te.toLowerCase())>=0||te.toLowerCase().indexOf("x-litix-")===0)&&(E[te]=H.join(": "))}}),E}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A=["x-cdn","content-type"]},function(U,w,L){var y=SyntaxError,A=Function,I=TypeError,E=function(ue){try{return A('"use strict"; return ('+ue+").constructor;")()}catch{}},M=Object.getOwnPropertyDescriptor;if(M)try{M({},"")}catch{M=null}var H=function(){throw new I},te=M?function(){try{return H}catch{try{return M(arguments,"callee").get}catch{return H}}}():H,V=L(43)(),J=Object.getPrototypeOf||function(ue){return ue.__proto__},C={},N=typeof Uint8Array>"u"?void 0:J(Uint8Array),R={"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":V?J([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V?J(J([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&V?J(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&V?J(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V?J(""[Symbol.iterator]()):void 0,"%Symbol%":V?Symbol:void 0,"%SyntaxError%":y,"%ThrowTypeError%":te,"%TypedArray%":N,"%TypeError%":I,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet},F=function ue(le){var pe;if(le==="%AsyncFunction%")pe=E("async function () {}");else if(le==="%GeneratorFunction%")pe=E("function* () {}");else if(le==="%AsyncGeneratorFunction%")pe=E("async function* () {}");else if(le==="%AsyncGenerator%"){var se=ue("%AsyncGeneratorFunction%");se&&(pe=se.prototype)}else if(le==="%AsyncIteratorPrototype%"){var oe=ue("%AsyncGenerator%");oe&&(pe=J(oe.prototype))}return R[le]=pe,pe},ee={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=L(9),X=L(46),p=D.call(Function.call,Array.prototype.concat),v=D.call(Function.apply,Array.prototype.splice),P=D.call(Function.call,String.prototype.replace),B=D.call(Function.call,String.prototype.slice),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ce=/\\(\\)?/g,ae=function(ue){var le=B(ue,0,1),pe=B(ue,-1);if(le==="%"&&pe!=="%")throw new y("invalid intrinsic syntax, expected closing `%`");if(pe==="%"&&le!=="%")throw new y("invalid intrinsic syntax, expected opening `%`");var se=[];return P(ue,z,function(oe,xe,Q,Y){se[se.length]=Q?P(Y,ce,"$1"):xe||oe}),se},ge=function(ue,le){var pe,se=ue;if(X(ee,se)&&(se="%"+(pe=ee[se])[0]+"%"),X(R,se)){var oe=R[se];if(oe===C&&(oe=F(se)),oe===void 0&&!le)throw new I("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:pe,name:se,value:oe}}throw new y("intrinsic "+ue+" does not exist!")};U.exports=function(ue,le){if(typeof ue!="string"||ue.length===0)throw new I("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof le!="boolean")throw new I('"allowMissing" argument must be a boolean');var pe=ae(ue),se=pe.length>0?pe[0]:"",oe=ge("%"+se+"%",le),xe=oe.name,Q=oe.value,Y=!1,de=oe.alias;de&&(se=de[0],v(pe,p([0,1],de)));for(var $=1,Z=!0;$<pe.length;$+=1){var fe=pe[$],Pe=B(fe,0,1),Re=B(fe,-1);if((Pe==='"'||Pe==="'"||Pe==="`"||Re==='"'||Re==="'"||Re==="`")&&Pe!==Re)throw new y("property names with quotes must have matching quotes");if(fe!=="constructor"&&Z||(Y=!0),X(R,xe="%"+(se+="."+fe)+"%"))Q=R[xe];else if(Q!=null){if(!(fe in Q)){if(!le)throw new I("base intrinsic for "+ue+" exists, but the property is not available.");return}if(M&&$+1>=pe.length){var Fe=M(Q,fe);Q=(Z=!!Fe)&&"get"in Fe&&!("originalValue"in Fe.get)?Fe.get:Q[fe]}else Z=X(Q,fe),Q=Q[fe];Z&&!Y&&(R[xe]=Q)}}return Q}},function(U,w,L){var y=L(45);U.exports=Function.prototype.bind||y},function(U,w,L){var y=String.prototype.replace,A=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"};U.exports={default:I.RFC3986,formatters:{RFC1738:function(E){return y.call(E,A,"+")},RFC3986:function(E){return String(E)}},RFC1738:I.RFC1738,RFC3986:I.RFC3986}},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0}),w.findMediaElement=w.getMuxPlayerId=void 0;var y=L(6),A=function(E){return E&&E.nodeName!==void 0?(E.muxId||(E.muxId=E.id||(0,y.generateShortID)()),E.muxId):E},I=function(E){var M=void 0;return E&&E.nodeName!==void 0?E=A(M=E):M=document.querySelector(E),[M,E,M&&M.nodeName?M.nodeName.toLowerCase():""]};w.getMuxPlayerId=A,w.findMediaElement=I},function(U,w,L){function y(){return(E.default.doNotTrack||E.default.navigator&&(E.default.navigator.doNotTrack||E.default.navigator.msDoNotTrack))==="1"}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=L(0),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(0),I=(y=A)&&y.__esModule?y:{default:y},E={exists:function(){var M=I.default.performance;return(M&&M.timing)!==void 0},domContentLoadedEventEnd:function(){var M=I.default.performance,H=M&&M.timing;return H&&H.domContentLoadedEventEnd},navigationStart:function(){var M=I.default.performance,H=M&&M.timing;return H&&H.navigationStart}};w.default=E},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y=function(A){var I={};for(var E in A){var M=A[E];M["DATA-ID"].search("io.litix.data.")!==-1&&(I[M["DATA-ID"].replace("io.litix.data.","")]=M.VALUE)}return I};w.default=y},function(U,w,L){var y=L(41),A=L(51),I=L(10);U.exports={formats:I,parse:A,stringify:y}},function(U,w,L){var y=L(10),A=Object.prototype.hasOwnProperty,I=Array.isArray,E=function(){for(var X=[],p=0;p<256;++p)X.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return X}(),M=function(X){for(;X.length>1;){var p=X.pop(),v=p.obj[p.prop];if(I(v)){for(var P=[],B=0;B<v.length;++B)v[B]!==void 0&&P.push(v[B]);p.obj[p.prop]=P}}},H=function(X,p){for(var v=p&&p.plainObjects?Object.create(null):{},P=0;P<X.length;++P)X[P]!==void 0&&(v[P]=X[P]);return v},te=function X(p,v,P){if(!v)return p;if(typeof v!="object"){if(I(p))p.push(v);else{if(!p||typeof p!="object")return[p,v];(P&&(P.plainObjects||P.allowPrototypes)||!A.call(Object.prototype,v))&&(p[v]=!0)}return p}if(!p||typeof p!="object")return[p].concat(v);var B=p;return I(p)&&!I(v)&&(B=H(p,P)),I(p)&&I(v)?(v.forEach(function(z,ce){if(A.call(p,ce)){var ae=p[ce];ae&&typeof ae=="object"&&z&&typeof z=="object"?p[ce]=X(ae,z,P):p.push(z)}else p[ce]=z}),p):Object.keys(v).reduce(function(z,ce){var ae=v[ce];return A.call(z,ce)?z[ce]=X(z[ce],ae,P):z[ce]=ae,z},B)},V=function(X,p){return Object.keys(p).reduce(function(v,P){return v[P]=p[P],v},X)},J=function(X,p,v){var P=X.replace(/\+/g," ");if(v==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},C=function(X,p,v,P,B){if(X.length===0)return X;var z=X;if(typeof X=="symbol"?z=Symbol.prototype.toString.call(X):typeof X!="string"&&(z=String(X)),v==="iso-8859-1")return escape(z).replace(/%u[0-9a-f]{4}/gi,function(ue){return"%26%23"+parseInt(ue.slice(2),16)+"%3B"});for(var ce="",ae=0;ae<z.length;++ae){var ge=z.charCodeAt(ae);ge===45||ge===46||ge===95||ge===126||ge>=48&&ge<=57||ge>=65&&ge<=90||ge>=97&&ge<=122||B===y.RFC1738&&(ge===40||ge===41)?ce+=z.charAt(ae):ge<128?ce+=E[ge]:ge<2048?ce+=E[192|ge>>6]+E[128|63&ge]:ge<55296||ge>=57344?ce+=E[224|ge>>12]+E[128|ge>>6&63]+E[128|63&ge]:(ae+=1,ge=65536+((1023&ge)<<10|1023&z.charCodeAt(ae)),ce+=E[240|ge>>18]+E[128|ge>>12&63]+E[128|ge>>6&63]+E[128|63&ge])}return ce},N=function(X){for(var p=[{obj:{o:X},prop:"o"}],v=[],P=0;P<p.length;++P)for(var B=p[P],z=B.obj[B.prop],ce=Object.keys(z),ae=0;ae<ce.length;++ae){var ge=ce[ae],ue=z[ge];typeof ue=="object"&&ue!==null&&v.indexOf(ue)===-1&&(p.push({obj:z,prop:ge}),v.push(ue))}return M(p),X},R=function(X){return Object.prototype.toString.call(X)==="[object RegExp]"},F=function(X){return!(!X||typeof X!="object"||!(X.constructor&&X.constructor.isBuffer&&X.constructor.isBuffer(X)))},ee=function(X,p){return[].concat(X,p)},D=function(X,p){if(I(X)){for(var v=[],P=0;P<X.length;P+=1)v.push(p(X[P]));return v}return p(X)};U.exports={arrayToObject:H,assign:V,combine:ee,compact:N,decode:J,encode:C,isBuffer:F,isRegExp:R,maybeMap:D,merge:te}},function(U,w,L){function y(V){return V&&V.__esModule?V:{default:V}}function A(V){var J={};for(var C in V)V.hasOwnProperty(C)&&(J[V[C]]=C);return J}function I(V){var J={},C={};return Object.keys(V).forEach(function(N){var R=!1;if(V.hasOwnProperty(N)&&V[N]!==void 0){var F=N.split("_"),ee=F[0],D=H[ee];D||(E.default.info("Data key word `"+F[0]+"` not expected in "+N),D=ee+"_"),F.splice(1).forEach(function(X){X==="url"&&(R=!0),te[X]?D+=te[X]:Number(X)&&Math.floor(Number(X))===Number(X)?D+=X:(E.default.info("Data key word `"+X+"` not expected in "+N),D+="_"+X+"_")}),R?C[D]=V[N]:J[D]=V[N]}}),(0,M.default)(J,C)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=I;var E=y(L(4)),M=y(L(1)),H=A({a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"}),te=A({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cd:"code",cg:"category",ch:"changed",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fi:"first",fm:"family",ft:"format",fq:"frequency",fr:"frame",fs:"fullscreen",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"})},function(U,w,L){U.exports=L(19).default},function(U,w,L){function y(ee){return ee&&ee.__esModule?ee:{default:ee}}Object.defineProperty(w,"__esModule",{value:!0});var A=function(){function ee(D,X){var p=[],v=!0,P=!1,B=void 0;try{for(var z,ce=D[Symbol.iterator]();!(v=(z=ce.next()).done)&&(p.push(z.value),!X||p.length!==X);v=!0);}catch(ae){P=!0,B=ae}finally{try{!v&&ce.return&&ce.return()}finally{if(P)throw B}}return p}return function(D,X){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return ee(D,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=y(L(0)),E=L(11),M=y(L(4)),H=y(L(12)),te=y(L(2)),V=y(L(22)),J=y(L(58)),C=y(L(59)),N=y(L(64)),R={},F=function ee(D){var X=arguments;typeof D=="string"?ee.hasOwnProperty(D)?I.default.setTimeout(function(){X=Array.prototype.splice.call(X,1),ee[D].apply(null,X)},0):M.default.warn("`"+D+"` is an unknown task"):typeof D=="function"?I.default.setTimeout(function(){D(ee)},0):M.default.warn("`"+D+"` is invalid.")};F.loaded=te.default.now(),F.NAME="mux-embed",F.VERSION="4.9.1",F.API_VERSION="2.1",F.PLAYER_TRACKED=!1,F.monitor=function(ee,D){return(0,J.default)(F,ee,D)},F.destroyMonitor=function(ee){var D=(0,E.findMediaElement)(ee),X=A(D,1)[0];X&&X.mux&&typeof X.mux.destroy=="function"?X.mux.destroy():M.default.error("A video element monitor for `"+ee+"` has not been initialized via `mux.monitor`.")},F.addHLSJS=function(ee,D){var X=(0,E.getMuxPlayerId)(ee);R[X]?R[X].addHLSJS(D):M.default.error("A monitor for `"+X+"` has not been initialized.")},F.addDashJS=function(ee,D){var X=(0,E.getMuxPlayerId)(ee);R[X]?R[X].addDashJS(D):M.default.error("A monitor for `"+X+"` has not been initialized.")},F.removeHLSJS=function(ee){var D=(0,E.getMuxPlayerId)(ee);R[D]?R[D].removeHLSJS():M.default.error("A monitor for `"+D+"` has not been initialized.")},F.removeDashJS=function(ee){var D=(0,E.getMuxPlayerId)(ee);R[D]?R[D].removeDashJS():M.default.error("A monitor for `"+D+"` has not been initialized.")},F.init=function(ee,D){(0,H.default)()&&D&&D.respectDoNotTrack&&M.default.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var X=(0,E.getMuxPlayerId)(ee);R[X]=new V.default(F,X,D)},F.emit=function(ee,D,X){var p=(0,E.getMuxPlayerId)(ee);R[p]?(R[p].emit(D,X),D==="destroy"&&delete R[p]):M.default.error("A monitor for `"+p+"` has not been initialized.")},I.default!==void 0&&typeof I.default.addEventListener=="function"&&I.default.addEventListener("pagehide",function(ee){ee.persisted||(F.WINDOW_UNLOADING=!0)},!1),F.checkDoNotTrack=H.default,F.log=M.default,F.utils=C.default,F.events=N.default,w.default=F},function(U,w){var L;L=function(){return this}();try{L=L||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(L=window)}U.exports=L},function(U,w,L){var y,A,I;I=function(){function E(v,P){var B=v[P];if(typeof B.bind=="function")return B.bind(v);try{return Function.prototype.bind.call(B,v)}catch{return function(){return Function.prototype.apply.apply(B,[v,arguments])}}}function M(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function H(v){return v==="debug"&&(v="log"),typeof console!==R&&(v==="trace"&&F?M:console[v]!==void 0?E(console,v):console.log!==void 0?E(console,"log"):N)}function te(v,P){for(var B=0;B<ee.length;B++){var z=ee[B];this[z]=B<v?N:this.methodFactory(z,v,P)}this.log=this.debug}function V(v,P,B){return function(){typeof console!==R&&(te.call(this,P,B),this[v].apply(this,arguments))}}function J(v,P,B){return H(v)||V.apply(this,arguments)}function C(v,P,B){function z(se){var oe=(ee[se]||"silent").toUpperCase();if(typeof window!==R&&le){try{return void(window.localStorage[le]=oe)}catch{}try{window.document.cookie=encodeURIComponent(le)+"="+oe+";"}catch{}}}function ce(){var se;if(typeof window!==R&&le){try{se=window.localStorage[le]}catch{}if(typeof se===R)try{var oe=window.document.cookie,xe=oe.indexOf(encodeURIComponent(le)+"=");xe!==-1&&(se=/^([^;]+)/.exec(oe.slice(xe))[1])}catch{}return ue.levels[se]===void 0&&(se=void 0),se}}function ae(){if(typeof window!==R&&le){try{return void window.localStorage.removeItem(le)}catch{}try{window.document.cookie=encodeURIComponent(le)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}var ge,ue=this;P=P??"WARN";var le="loglevel";typeof v=="string"?le+=":"+v:typeof v=="symbol"&&(le=void 0),ue.name=v,ue.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},ue.methodFactory=B||J,ue.getLevel=function(){return ge},ue.setLevel=function(se,oe){if(typeof se=="string"&&ue.levels[se.toUpperCase()]!==void 0&&(se=ue.levels[se.toUpperCase()]),!(typeof se=="number"&&se>=0&&se<=ue.levels.SILENT))throw"log.setLevel() called with invalid level: "+se;if(ge=se,oe!==!1&&z(se),te.call(ue,se,v),typeof console===R&&se<ue.levels.SILENT)return"No console available for logging"},ue.setDefaultLevel=function(se){P=se,ce()||ue.setLevel(se,!1)},ue.resetLevel=function(){ue.setLevel(P,!1),ae()},ue.enableAll=function(se){ue.setLevel(ue.levels.TRACE,se)},ue.disableAll=function(se){ue.setLevel(ue.levels.SILENT,se)};var pe=ce();pe==null&&(pe=P),ue.setLevel(pe,!1)}var N=function(){},R="undefined",F=typeof window!==R&&typeof window.navigator!==R&&/Trident\/|MSIE /.test(window.navigator.userAgent),ee=["trace","debug","info","warn","error"],D=new C,X={};D.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var P=X[v];return P||(P=X[v]=new C(v,D.getLevel(),D.methodFactory)),P};var p=typeof window!==R?window.log:void 0;return D.noConflict=function(){return typeof window!==R&&window.log===D&&(window.log=p),D},D.getLoggers=function(){return X},D.default=D,D},(A=typeof(y=I)=="function"?y.call(w,L,w,U):y)!==void 0&&(U.exports=A)},function(U,w,L){function y(xe){return xe&&xe.__esModule?xe:{default:xe}}Object.defineProperty(w,"__esModule",{value:!0});var A=function(){function xe(Q,Y){var de=[],$=!0,Z=!1,fe=void 0;try{for(var Pe,Re=Q[Symbol.iterator]();!($=(Pe=Re.next()).done)&&(de.push(Pe.value),!Y||de.length!==Y);$=!0);}catch(Fe){Z=!0,fe=Fe}finally{try{!$&&Re.return&&Re.return()}finally{if(Z)throw fe}}return de}return function(Q,Y){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return xe(Q,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=y(L(4)),E=y(L(1)),M=L(6),H=L(5),te=y(L(0)),V=y(L(13)),J=y(L(3)),C=L(23),N=L(24),R=y(L(25)),F=y(L(26)),ee=y(L(27)),D=y(L(28)),X=y(L(29)),p=y(L(30)),v=y(L(31)),P=y(L(32)),B=y(L(33)),z=y(L(34)),ce=y(L(35)),ae=y(L(36)),ge=y(L(37)),ue=y(L(38)),le=y(L(39)),pe=y(L(57)),se=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],oe=function(xe,Q,Y){var de=this;this.DOM_CONTENT_LOADED_EVENT_END=V.default.domContentLoadedEventEnd(),this.NAVIGATION_START=V.default.navigationStart();var $={debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(Fe){return Fe}};this.mux=xe,this.id=Q,(Y=(0,E.default)($,Y)).data=Y.data||{},Y.data.property_key&&(Y.data.env_key=Y.data.property_key,delete Y.data.property_key),I.default.setLevel(Y.debug?"debug":"warn"),this.getPlayheadTime=Y.getPlayheadTime,this.getStateData=Y.getStateData||function(){},this.getAdData=Y.getAdData||function(){},this.minimumRebufferDuration=Y.minimumRebufferDuration,this.sustainedRebufferThreshold=Y.sustainedRebufferThreshold,this.playbackHeartbeatTime=Y.playbackHeartbeatTime,this.disableRebufferTracking=Y.disableRebufferTracking,this.disableRebufferTracking&&this.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),this.errorTranslator=Y.errorTranslator,this.playbackEventDispatcher=new le.default(xe,Y.data.env_key,Y),this.data={player_instance_id:(0,M.generateUUID)(),mux_sample_rate:Y.sampleRate,beacon_domain:Y.beaconCollectionDomain?Y.beaconCollectionDomain:Y.beaconDomain},this.data.view_sequence_number=1,this.data.player_sequence_number=1,this.oldEmit=this.emit,this.emit=function(Fe,He){He=(0,E.default)({viewer_time:this.mux.utils.now()},He),this.oldEmit(Fe,He)};var Z=(function(){this.data.view_start===void 0&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}).bind(this);this.on("viewinit",function(Fe,He){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),(0,E.default)(this.data,He),this._initializeViewData(),this.one("play",Z),this.one("adbreakstart",Z)});var fe=(function(Fe){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",Fe)}).bind(this);if(this.on("videochange",function(Fe,He){fe(He)}),this.on("programchange",function(Fe,He){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),fe((0,E.default)(He,{view_program_changed:!0})),Z(),this.emit("play"),this.emit("playing")}),this.on("fragmentchange",function(Fe,He){this.currentFragmentPDT=He.currentFragmentPDT,this.currentFragmentStart=He.currentFragmentStart}),this.on("destroy",this.destroy),te.default!==void 0&&typeof te.default.addEventListener=="function"&&typeof te.default.removeEventListener=="function"){var Pe=function(Fe){Fe.persisted||de.destroy()};te.default.addEventListener("pagehide",Pe,!1),this.on("destroy",function(){te.default.removeEventListener("pagehide",Pe)})}this.on("playerready",function(Fe,He){(0,E.default)(this.data,He)}),se.forEach(function(Fe){de.on(Fe,function(He,Ze){Fe.indexOf("ad")!==0&&this._updateStateData(),(0,E.default)(this.data,Ze),this._sanitizeData()}),de.on("after"+Fe,function(){(Fe!=="error"||this.viewErrored)&&this.send(Fe)})}),this.on("viewend",function(Fe,He){(0,E.default)(de.data,He)});var Re=function(Fe){var He=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=He-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time};this.one("playerready",Re),ee.default.apply(this),ue.default.apply(this),ce.default.apply(this),p.default.apply(this),F.default.apply(this),z.default.apply(this),D.default.apply(this),X.default.apply(this),ae.default.apply(this),v.default.apply(this),P.default.apply(this),B.default.apply(this),ge.default.apply(this),pe.default.apply(this),Y.hlsjs&&this.addHLSJS(Y),Y.dashjs&&this.addDashJS(Y),this.emit("viewinit",Y.data)};(0,E.default)(oe.prototype,R.default.prototype),(0,E.default)(oe.prototype,p.default.prototype),(0,E.default)(oe.prototype,ce.default.prototype),(0,E.default)(oe.prototype,F.default.prototype),(0,E.default)(oe.prototype,D.default.prototype),(0,E.default)(oe.prototype,X.default.prototype),(0,E.default)(oe.prototype,ae.default.prototype),(0,E.default)(oe.prototype,P.default.prototype),(0,E.default)(oe.prototype,B.default.prototype),oe.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.data.view_start!==void 0&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),te.default.clearTimeout(this._heartBeatTimeout))},oe.prototype.send=function(xe){var Q=(0,E.default)({},this.data),Y=["player_program_time","player_manifest_newest_program_time","player_live_edge_program_time","player_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"];if(Q.video_source_is_live===void 0&&(Q.player_source_duration===1/0||Q.video_source_duration===1/0?Q.video_source_is_live=!0:(Q.player_source_duration>0||Q.video_source_duration>0)&&(Q.video_source_is_live=!1)),Q.video_source_is_live||Y.forEach(function(Pe){Q[Pe]=void 0}),Q.video_source_url=Q.video_source_url||Q.player_source_url,Q.video_source_url){var de=(0,H.extractHostnameAndDomain)(Q.video_source_url),$=A(de,2),Z=$[0],fe=$[1];Q.video_source_domain=fe,Q.video_source_hostname=Z}delete Q.ad_request_id,this.playbackEventDispatcher.send(xe,Q),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()},oe.prototype._updateStateData=function(){(0,E.default)(this.data,this.getStateData()),this._updatePlayheadTime(),this._sanitizeData()},oe.prototype._sanitizeData=function(){var xe=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(Q){var Y=parseInt(xe.data[Q],10);xe.data[Q]=isNaN(Y)?void 0:Y}),["player_source_url","video_source_url"].forEach(function(Q){if(xe.data[Q]){var Y=xe.data[Q].toLowerCase();Y.indexOf("data:")!==0&&Y.indexOf("blob:")!==0||(xe.data[Q]="MSE style URL")}})},oe.prototype._resetVideoData=function(xe,Q){var Y=this;Object.keys(this.data).forEach(function(de){de.indexOf("video_")===0&&delete Y.data[de]})},oe.prototype._resetViewData=function(){var xe=this;Object.keys(this.data).forEach(function(Q){Q.indexOf("view_")===0&&delete xe.data[Q]}),this.data.view_sequence_number=1},oe.prototype._resetErrorData=function(xe,Q){delete this.data.player_error_code,delete this.data.player_error_message},oe.prototype._initializeViewData=function(){var xe=this,Q=this.data.view_id=(0,M.generateUUID)(),Y=function(){Q===xe.data.view_id&&(0,J.default)(xe.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",Y):Y()},oe.prototype._restartHeartBeat=function(){var xe=this;te.default.clearTimeout(this._heartBeatTimeout),this.viewErrored||(this._heartBeatTimeout=te.default.setTimeout(function(){xe.data.player_is_paused||xe.emit("hb")},1e4))},oe.prototype.addHLSJS=function(xe){return xe.hlsjs?this.hlsjs?void this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=xe.hlsjs,void(0,C.monitorHlsJs)(this.mux,this.id,xe.hlsjs,{},xe.Hls||te.default.Hls)):void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")},oe.prototype.removeHLSJS=function(){this.hlsjs&&((0,C.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},oe.prototype.addDashJS=function(xe){return xe.dashjs?this.dashjs?void this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=xe.dashjs,void(0,N.monitorDashJS)(this.mux,this.id,xe.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},oe.prototype.removeDashJS=function(){this.dashjs&&((0,N.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},w.default=oe},function(U,w,L){function y(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(w,"__esModule",{value:!0}),w.stopMonitoringHlsJs=w.monitorHlsJs=void 0;var A=y(L(7)),I=y(L(13)),E=L(5),M=y(L(14)),H=function(C){if(!C)return{};var N=I.default.navigationStart(),R=C.loading,F=R?R.start:C.trequest,ee=R?R.first:C.tfirst,D=R?R.end:C.tload;return{bytesLoaded:C.total,requestStart:Math.round(N+F),responseStart:Math.round(N+ee),responseEnd:Math.round(N+D)}},te=function(C){if(C&&typeof C.getAllResponseHeaders=="function")return(0,A.default)(C.getAllResponseHeaders())},V=function(C,N,R){var F=arguments[4],ee=C.log,D=C.utils.secondsToMs,X=function(le){var pe=parseInt(F.version),se=void 0;return pe===1&&le.programDateTime!==null&&(se=le.programDateTime),pe===0&&le.pdt!==null&&(se=le.pdt),se};if(I.default.exists()){var p=function(le,pe){return C.emit(N,le,pe)},v=function(le,pe){var se=pe.levels,oe=pe.audioTracks,xe=pe.url,Q=pe.stats,Y=pe.networkDetails,de=pe.sessionData,$={},Z={},fe={};fe=(0,M.default)(de),se.forEach(function($e,Et){$[Et]={width:$e.width,height:$e.height,bitrate:$e.bitrate,attrs:$e.attrs}}),oe.forEach(function($e,Et){Z[Et]={name:$e.name,language:$e.lang,bitrate:$e.bitrate}});var Pe=H(Q),Re=Pe.bytesLoaded,Fe=Pe.requestStart,He=Pe.responseStart,Ze=Pe.responseEnd;fe.request_event_type=le,fe.request_bytes_loaded=Re,fe.request_start=Fe,fe.request_response_start=He,fe.request_response_end=Ze,fe.request_type="manifest",fe.request_hostname=(0,E.extractHostname)(xe),fe.request_response_headers=te(Y),fe.request_rendition_lists={media:$,audio:Z,video:{}},p("requestcompleted",fe)};R.on(F.Events.MANIFEST_LOADED,v);var P=function(le,pe){var se=pe.details,oe=pe.level,xe=pe.networkDetails,Q=pe.stats,Y=H(Q),de=Y.bytesLoaded,$=Y.requestStart,Z=Y.responseStart,fe=Y.responseEnd,Pe=se.fragments[se.fragments.length-1],Re=X(Pe)+D(Pe.duration);p("requestcompleted",{request_event_type:le,request_bytes_loaded:de,request_start:$,request_response_start:Z,request_response_end:fe,request_current_level:oe,request_type:"manifest",request_hostname:(0,E.extractHostname)(se.url),request_response_headers:te(xe),video_holdback:se.holdBack&&D(se.holdBack),video_part_holdback:se.partHoldBack&&D(se.partHoldBack),video_part_target_duration:se.partTarget&&D(se.partTarget),video_target_duration:se.targetduration&&D(se.targetduration),video_source_is_live:se.live,player_manifest_newest_program_time:isNaN(Re)?void 0:Re})};R.on(F.Events.LEVEL_LOADED,P);var B=function(le,pe){var se=pe.details,oe=pe.networkDetails,xe=pe.stats,Q=H(xe),Y=Q.bytesLoaded,de=Q.requestStart,$=Q.responseStart,Z=Q.responseEnd;p("requestcompleted",{request_event_type:le,request_bytes_loaded:Y,request_start:de,request_response_start:$,request_response_end:Z,request_type:"manifest",request_hostname:(0,E.extractHostname)(se.url),request_response_headers:te(oe)})};R.on(F.Events.AUDIO_TRACK_LOADED,B);var z=function(le,pe){var se=pe.stats,oe=pe.networkDetails,xe=pe.frag,Q=H(se),Y={request_event_type:le,request_bytes_loaded:Q.bytesLoaded,request_start:Q.requestStart,request_response_start:Q.responseStart,request_response_end:Q.responseEnd,request_hostname:oe?(0,E.extractHostname)(oe.responseURL):void 0,request_response_headers:te(oe),request_media_duration:xe.duration};xe.type==="main"?(Y.request_type="media",Y.request_current_level=xe.level,Y.request_video_width=(R.levels[xe.level]||{}).width,Y.request_video_height=(R.levels[xe.level]||{}).height):Y.request_type=xe.type,p("requestcompleted",Y)};R.on(F.Events.FRAG_LOADED,z);var ce=function(le,pe){var se=pe.frag,oe=se.start,xe={currentFragmentPDT:X(se),currentFragmentStart:D(oe)};p("fragmentchange",xe)};R.on(F.Events.FRAG_CHANGED,ce);var ae=function(le,pe){var se=pe.type,oe=pe.details,xe=pe.response,Q=pe.fatal,Y=pe.context,de=pe.frag;if(oe===F.ErrorDetails.MANIFEST_LOAD_ERROR||oe===F.ErrorDetails.MANIFEST_LOAD_TIMEOUT||oe===F.ErrorDetails.FRAG_LOAD_ERROR||oe===F.ErrorDetails.FRAG_LOAD_TIMEOUT||oe===F.ErrorDetails.LEVEL_LOAD_ERROR||oe===F.ErrorDetails.LEVEL_LOAD_TIMEOUT){var $=de&&de.url||Y&&Y.url||"";p("requestfailed",{request_error:oe,request_url:$,request_hostname:(0,E.extractHostname)($),request_type:oe===F.ErrorDetails.FRAG_LOAD_ERROR||oe===F.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:xe&&xe.code,request_error_text:xe&&xe.text})}Q&&p("error",{player_error_code:se,player_error_message:oe})};R.on(F.Events.ERROR,ae);var ge=function(le,pe){var se=pe.frag,oe=se&&se._url||"";p("requestcanceled",{request_cancel:le,request_url:oe,request_type:"media",request_hostname:(0,E.extractHostname)(oe)})};R.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,ge);var ue=function(le,pe){var se=pe.level,oe=R.levels[se];if(oe&&oe.attrs&&oe.attrs.BANDWIDTH){var xe=oe.attrs.BANDWIDTH;xe?p("renditionchange",{video_source_bitrate:xe,video_source_width:oe.width,video_source_height:oe.height}):ee.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};R.on(F.Events.LEVEL_SWITCHED,ue),R._stopMuxMonitor=function(){R.off(F.Events.MANIFEST_LOADED,v),R.off(F.Events.LEVEL_LOADED,P),R.off(F.Events.AUDIO_TRACK_LOADED,B),R.off(F.Events.FRAG_LOADED,z),R.off(F.Events.FRAG_CHANGED,ce),R.off(F.Events.ERROR,ae),R.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,ge),R.off(F.Events.LEVEL_SWITCHED,ue),R.off(F.Events.DESTROYING,R._stopMuxMonitor),delete R._stopMuxMonitor},R.on(F.Events.DESTROYING,R._stopMuxMonitor)}else ee.warn("performance timing not supported. Not tracking HLS.js.")},J=function(C){C&&typeof C._stopMuxMonitor=="function"&&C._stopMuxMonitor()};w.monitorHlsJs=V,w.stopMonitoringHlsJs=J},function(U,w,L){function y(J){return J&&J.__esModule?J:{default:J}}Object.defineProperty(w,"__esModule",{value:!0}),w.stopMonitoringDashJS=w.monitorDashJS=void 0;var A=y(L(0)),I=y(L(7)),E=L(5),M=function(J,C){if(!J||typeof J.getRequests!="function")return{};var N=J.getRequests({state:"executed"});if(N.length===0)return{};var R=N[N.length-1],F=(0,E.extractHostname)(R.url),ee=R.bytesLoaded,D=new Date(R.requestStartDate).getTime(),X=new Date(R.firstByteDate).getTime(),p=new Date(R.requestEndDate).getTime(),v=isNaN(R.duration)?0:R.duration,P=typeof C.getMetricsFor=="function"?C.getMetricsFor(R.mediaType).HttpList:C.getDashMetrics().getHttpRequests(R.mediaType),B=void 0;return P.length>0&&(B=(0,I.default)(P[P.length-1]._responseHeaders||"")),{requestStart:D,requestResponseStart:X,requestResponseEnd:p,requestBytesLoaded:ee,requestResponseHeaders:B,requestMediaDuration:v,requestHostname:F}},H=function(J,C){var N=C.getQualityFor(J),R=C.getCurrentTrackFor(J).bitrateList;return R?{currentLevel:N,renditionWidth:R[N].width||null,renditionHeight:R[N].height||null,renditionBitrate:R[N].bandwidth}:{}},te=function(J,C,N){var R=J.log;if(N&&N.on){var F=function(ce,ae){return J.emit(C,ce,ae)},ee=function(ce){var ae=ce.type,ge=(ce.data||{}).url;F("requestcompleted",{request_event_type:ae,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:(0,E.extractHostname)(ge)})};N.on("manifestLoaded",ee);var D={},X=function(ce){var ae=ce.type,ge=ce.fragmentModel,ue=(ce.chunk||{}).mediaInfo||{},le=ue.type,pe=ue.bitrateList,se={};(pe=pe||[]).forEach(function(fe,Pe){se[Pe]={},se[Pe].width=fe.width,se[Pe].height=fe.height,se[Pe].bitrate=fe.bandwidth,se[Pe].attrs={}}),le==="video"?D.video=se:le==="audio"?D.audio=se:D.media=se;var oe=M(ge,N),xe=oe.requestStart,Q=oe.requestResponseStart,Y=oe.requestResponseEnd,de=oe.requestResponseHeaders,$=oe.requestMediaDuration,Z=oe.requestHostname;F("requestcompleted",{request_event_type:ae,request_start:xe,request_response_start:Q,request_response_end:Y,request_bytes_loaded:-1,request_type:le+"_init",request_response_headers:de,request_hostname:Z,request_media_duration:$,request_rendition_lists:D})};N.on("initFragmentLoaded",X);var p=function(ce){var ae=ce.type,ge=ce.fragmentModel,ue=ce.chunk||{},le=ue.mediaInfo,pe=ue.start,se=(le||{}).type,oe=M(ge,N),xe=oe.requestStart,Q=oe.requestResponseStart,Y=oe.requestResponseEnd,de=oe.requestBytesLoaded,$=oe.requestResponseHeaders,Z=oe.requestMediaDuration,fe=oe.requestHostname,Pe=H(se,N),Re=Pe.currentLevel,Fe=Pe.renditionWidth,He=Pe.renditionHeight,Ze=Pe.renditionBitrate;F("requestcompleted",{request_event_type:ae,request_start:xe,request_response_start:Q,request_response_end:Y,request_bytes_loaded:de,request_type:se,request_response_headers:$,request_hostname:fe,request_media_start_time:pe,request_media_duration:Z,request_current_level:Re,request_labeled_bitrate:Ze,request_video_width:Fe,request_video_height:He})};N.on("mediaFragmentLoaded",p);var v={video:void 0,audio:void 0,totalBitrate:void 0},P=function(){if(v.video&&typeof v.video.bitrate=="number"){if(!v.video.width||!v.video.height)return void R.warn("have bitrate info for video but missing width/height");var ce=v.video.bitrate;return v.audio&&typeof v.audio.bitrate=="number"&&(ce+=v.audio.bitrate),ce!==v.totalBitrate?(v.totalBitrate=ce,{video_source_bitrate:ce,video_source_height:v.video.height,video_source_width:v.video.width}):void 0}},B=function(ce,ae,ge){if(typeof ce.newQuality=="number"){var ue=ce.mediaType;if(ue==="audio"||ue==="video"){var le=N.getBitrateInfoListFor(ue).find(function(se){return se.qualityIndex===ce.newQuality});if(!le||typeof le.bitrate!="number")return void R.warn("missing bitrate info for "+ue);v[ue]=le;var pe=P();pe&&F("renditionchange",pe)}}else R.warn("missing evt.newQuality in qualityChangeRendered event",ce)};N.on("qualityChangeRendered",B);var z=function(ce){var ae=ce.error,ge=ce.event,ue=(ge=ge||{}).request||{},le=A.default.event&&A.default.event.currentTarget||{};F("requestfailed",{request_error:ae+"_"+ge.id+"_"+ue.type,request_url:ge.url,request_hostname:(0,E.extractHostname)(ge.url),request_type:ue.mediaType,request_error_code:le.status,request_error_type:le.statusText})};N.on("error",z),N._stopMuxMonitor=function(){N.off("manifestLoaded",ee),N.off("initFragmentLoaded",X),N.off("mediaFragmentLoaded",p),N.off("qualityChangeRendered",B),N.off("error",z),delete N._stopMuxMonitor}}else R.warn("Invalid dash.js player reference. Monitoring blocked.")},V=function(J){J&&typeof J._stopMuxMonitor=="function"&&J._stopMuxMonitor()};w.monitorDashJS=te,w.stopMonitoringDashJS=V},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y=function(){},A=0;y.prototype.on=function(I,E,M){return E._eventEmitterGuid=E._eventEmitterGuid||++A,this._listeners=this._listeners||{},this._listeners[I]=this._listeners[I]||[],M&&(E=E.bind(M)),this._listeners[I].push(E),E},y.prototype.off=function(I,E){var M=this._listeners&&this._listeners[I];M&&M.forEach(function(H,te){H._eventEmitterGuid===E._eventEmitterGuid&&M.splice(te,1)})},y.prototype.one=function(I,E,M){var H=this;E._eventEmitterGuid=E._eventEmitterGuid||++A;var te=function V(){H.off(I,V),E.apply(M||this,arguments)};te._eventEmitterGuid=E._eventEmitterGuid,this.on(I,te)},y.prototype.emit=function(I,E){var M=this;if(this._listeners){E=E||{};var H=this._listeners["before*"]||[],te=this._listeners[I]||[],V=this._listeners["after"+I]||[],J=function(C,N){(C=C.slice()).forEach(function(R){R.call(M,{type:I},N)})};J(H,E),J(te,E),J(V,E)}},w.default=y},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(0),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,this.on("playing",function(){this._playheadShouldBeProgressing=!0}),this.on("play",this._startPlaybackHeartbeatInterval),this.on("playing",this._startPlaybackHeartbeatInterval),this.on("adbreakstart",this._startPlaybackHeartbeatInterval),this.on("adplay",this._startPlaybackHeartbeatInterval),this.on("adplaying",this._startPlaybackHeartbeatInterval),this.on("seeking",this._startPlaybackHeartbeatInterval),this.on("devicewake",this._startPlaybackHeartbeatInterval),this.on("viewstart",this._startPlaybackHeartbeatInterval),this.on("rebufferstart",this._startPlaybackHeartbeatInterval),this.on("pause",this._stopPlaybackHeartbeatInterval),this.on("ended",this._stopPlaybackHeartbeatInterval),this.on("viewend",this._stopPlaybackHeartbeatInterval),this.on("error",this._stopPlaybackHeartbeatInterval),this.on("aderror",this._stopPlaybackHeartbeatInterval),this.on("adpause",this._stopPlaybackHeartbeatInterval),this.on("adended",this._stopPlaybackHeartbeatInterval),this.on("adbreakend",this._stopPlaybackHeartbeatInterval),this.on("seeked",function(){this.data.player_is_paused?this._stopPlaybackHeartbeatInterval():this._startPlaybackHeartbeatInterval()}),this.on("timeupdate",function(){this._playbackHeartbeatInterval!==null&&this.emit("playbackheartbeat")}),this.on("devicesleep",function(M,H){this._playbackHeartbeatInterval!==null&&(I.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend",{viewer_time:H.viewer_time}),this._playbackHeartbeatInterval=null)})};E.prototype._startPlaybackHeartbeatInterval=function(){var M=this;this._playbackHeartbeatInterval===null&&(this.emit("playbackheartbeat"),this._playbackHeartbeatInterval=I.default.setInterval(function(){M.emit("playbackheartbeat")},this.playbackHeartbeatTime))},E.prototype._stopPlaybackHeartbeatInterval=function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(I.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)},w.default=E},function(U,w,L){function y(){var A=this;this.on("viewinit",function(){A.viewErrored=!1}),this.on("error",function(){try{var I=A.errorTranslator({player_error_code:A.data.player_error_code,player_error_message:A.data.player_error_message});I?(A.data.player_error_code=I.player_error_code,A.data.player_error_message=I.player_error_message,A.viewErrored=!0):(delete A.data.player_error_code,delete A.data.player_error_message)}catch(E){A.mux.log.warn("Exception in error translator callback.",E),A.viewErrored=!0}})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(3),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._watchTimeTrackerLastCheckedTime=null,this.on("playbackheartbeat",this._updateWatchTime),this.on("playbackheartbeatend",this._clearWatchTimeState)};E.prototype._updateWatchTime=function(M,H){var te=H.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=te),(0,I.default)(this.data,"view_watch_time",te-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=te},E.prototype._clearWatchTimeState=function(M,H){this._updateWatchTime(M,H),this._watchTimeTrackerLastCheckedTime=null},w.default=E},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(3),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._playbackTimeTrackerLastPlayheadPosition=-1,this.on("playbackheartbeat",this._updatePlaybackTime),this.on("playbackheartbeatend",this._clearPlaybackTimeState),this.on("seeking",this._clearPlaybackTimeState)};E.prototype._updatePlaybackTime=function(){var M=this.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&M>this._playbackTimeTrackerLastPlayheadPosition){var H=M-this._playbackTimeTrackerLastPlayheadPosition;H<=1e3&&(0,I.default)(this.data,"view_content_playback_time",H)}this._playbackTimeTrackerLastPlayheadPosition=M},E.prototype._clearPlaybackTimeState=function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1},w.default=E},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y=function(){this.on("playbackheartbeat",this._updatePlayheadTime),this.on("playbackheartbeatend",this._updatePlayheadTime),this.on("timeupdate",this._updatePlayheadTime),this.on("destroy",function(){this.off("timeupdate",this._updatePlayheadTime)})};y.prototype._updateMaxPlayheadPosition=function(){this.data.view_max_playhead_position=this.data.view_max_playhead_position===void 0?this.data.player_playhead_time:Math.max(this.data.view_max_playhead_position,this.data.player_playhead_time)},y.prototype._updatePlayheadTime=function(A,I){var E=this,M=function(){E.currentFragmentPDT&&E.currentFragmentStart&&(E.data.player_program_time=E.currentFragmentPDT+E.data.player_playhead_time-E.currentFragmentStart)};if(I&&I.player_playhead_time)this.data.player_playhead_time=I.player_playhead_time,M(),this._updateMaxPlayheadPosition();else if(this.getPlayheadTime){var H=this.getPlayheadTime();H!==void 0&&(this.data.player_playhead_time=H,M(),this._updateMaxPlayheadPosition())}},w.default=y},function(U,w,L){function y(){var M=this;if(!this.disableRebufferTracking){var H=void 0,te=function(){if(H){var V=M.data.viewer_time-H;(0,E.default)(M.data,"view_rebuffer_duration",V),H=M.data.viewer_time}M.data.view_watch_time>=0&&M.data.view_rebuffer_count>0&&(M.data.view_rebuffer_frequency=M.data.view_rebuffer_count/M.data.view_watch_time,M.data.view_rebuffer_percentage=M.data.view_rebuffer_duration/M.data.view_watch_time)};this.on("playbackheartbeat",function(){return te()}),this.on("rebufferstart",function(){H||((0,E.default)(M.data,"view_rebuffer_count",1),H=M.data.viewer_time,M.one("rebufferend",function(){te(),H=void 0}))})}}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=L(3),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(2),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this.disableRebufferTracking||this.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,this.on("playbackheartbeat",this._checkIfRebuffering),this.on("playbackheartbeatend",this._cleanupRebufferTracker),this.on("seeking",function(){this._cleanupRebufferTracker(null,{viewer_time:I.default.now()})}))};E.prototype._checkIfRebuffering=function(M,H){return this.isSeeking||this.isAdBreak||!this._playheadShouldBeProgressing?void this._cleanupRebufferTracker(M,H):this._lastCheckedTime===null?void this._prepareRebufferTrackerState(H.viewer_time):this._lastPlayheadTime!==this.data.player_playhead_time?void this._cleanupRebufferTracker(M,H,!0):(H.viewer_time-this._lastPlayheadTimeUpdatedTime>=this.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),void(this._lastCheckedTime=H.viewer_time))},E.prototype._clearRebufferTrackerState=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null},E.prototype._prepareRebufferTrackerState=function(M){this._lastCheckedTime=M,this._lastPlayheadTime=this.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=M},E.prototype._cleanupRebufferTracker=function(M,H){var te=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.emit("rebufferend",{viewer_time:H.viewer_time});else{if(this._lastCheckedTime===null)return;var V=this.data.player_playhead_time-this._lastPlayheadTime,J=H.viewer_time-this._lastPlayheadTimeUpdatedTime;V>0&&J-V>this.minimumRebufferDuration&&(this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+J-V}))}te?this._prepareRebufferTrackerState(H.viewer_time):this._clearRebufferTrackerState()},w.default=E},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(2),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this.on("viewinit",function(){var M=this.data,H=M.view_id;if(!M.view_program_changed){var te=function(V,J){var C=J.viewer_time;V.type==="playing"&&this.data.view_time_to_first_frame===void 0?this.calculateTimeToFirstFrame(C||I.default.now(),H):V.type!=="adplaying"||this.data.view_time_to_first_frame!==void 0&&!this.inPrerollPosition()||this.calculateTimeToFirstFrame(C||I.default.now(),H)};this.one("playing",te),this.one("adplaying",te),this.one("viewend",function(){this.off("playing",te),this.off("adplaying",te)})}})};E.prototype.calculateTimeToFirstFrame=function(M,H){H===this.data.view_id&&(this._updateWatchTime(null,{viewer_time:M}),this.data.view_time_to_first_frame=this.data.view_watch_time,(this.data.player_autoplay_on||this.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.data.view_aggregate_startup_time=this.data.view_start+this.data.view_watch_time-this.NAVIGATION_START))},w.default=E},function(U,w,L){function y(){var M=this;this.on("viewinit",function(){this._lastPlayheadPosition=-1});var H=["playing","hb"];["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach(function(te){M.on(te,function(){if(this._lastPlayheadPosition>=0&&this.data.player_playhead_time>=0&&this._lastPlayerWidth>=0&&this._lastSourceWidth>0&&this._lastPlayerHeight>=0&&this._lastSourceHeight>0){var V=this.data.player_playhead_time-this._lastPlayheadPosition;if(V<0)return void(this._lastPlayheadPosition=-1);var J=Math.min(this._lastPlayerWidth/this._lastSourceWidth,this._lastPlayerHeight/this._lastSourceHeight),C=Math.max(0,J-1),N=Math.max(0,1-J);this.data.view_max_upscale_percentage=Math.max(this.data.view_max_upscale_percentage||0,C),this.data.view_max_downscale_percentage=Math.max(this.data.view_max_downscale_percentage||0,N),(0,E.default)(this.data,"view_total_content_playback_time",V),(0,E.default)(this.data,"view_total_upscaling",C*V),(0,E.default)(this.data,"view_total_downscaling",N*V)}this._lastPlayheadPosition=-1})}),H.forEach(function(te){M.on(te,function(){this._lastPlayheadPosition=this.data.player_playhead_time,this._lastPlayerWidth=this.data.player_width,this._lastPlayerHeight=this.data.player_height,this._lastSourceWidth=this.data.video_source_width,this._lastSourceHeight=this.data.video_source_height})})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=L(3),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,L){function y(H){return H&&H.__esModule?H:{default:H}}function A(){this.isSeeking=!1,this.on("seeking",function(H,te){(0,M.default)(this.data,te),this._lastSeekingTime=I.default.now(),this.isSeeking===!1&&(this.isSeeking=!0,this.send("seeking"))}),this.on("seeked",function(){this.isSeeking=!1;var H=this._lastSeekingTime||I.default.now(),te=I.default.now()-H;(0,E.default)(this.data,"view_seek_count",1),(0,E.default)(this.data,"view_seek_duration",te);var V=this.data.view_max_seek_time||0;this.data.view_max_seek_time=Math.max(V,te)}),this.on("viewend",function(){this.isSeeking=!1})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=A;var I=y(L(2)),E=y(L(3)),M=y(L(1))},function(U,w,L){function y(J){return J&&J.__esModule?J:{default:J}}Object.defineProperty(w,"__esModule",{value:!0});var A=function(){function J(C,N){var R=[],F=!0,ee=!1,D=void 0;try{for(var X,p=C[Symbol.iterator]();!(F=(X=p.next()).done)&&(R.push(X.value),!N||R.length!==N);F=!0);}catch(v){ee=!0,D=v}finally{try{!F&&p.return&&p.return()}finally{if(ee)throw D}}return R}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return J(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=y(L(3)),E=L(5),M=y(L(1)),H=function(J,C){J.push(C),J.sort(function(N,R){return N.viewer_time-R.viewer_time})},te=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],V=function(){var J=this;this.on("viewinit",function(){this.isAdBreak=!1,this._currentAdRequestNumber=0,this._currentAdResponseNumber=0,this._adRequests=[],this._adResponses=[],this._adHasPlayed=!1,this._wouldBeNewAdPlay=!0,this._prerollPlayTime=void 0}),te.forEach(function(N){return J.on(N,J._updateAdData)});var C=function(){J.isAdBreak=!1};this.on("adbreakstart",function(){this.isAdBreak=!0}),this.on("play",C),this.on("playing",C),this.on("viewend",C),this.on("adrequest",function(N,R){R=(0,M.default)({ad_request_id:"generatedAdRequestId"+this._currentAdRequestNumber++},R),H(this._adRequests,R),(0,I.default)(this.data,"view_ad_request_count"),this.inPrerollPosition()&&(this.data.view_preroll_requested=!0,this._adHasPlayed||(0,I.default)(this.data,"view_preroll_request_count"))}),this.on("adresponse",function(N,R){R=(0,M.default)({ad_request_id:"generatedAdRequestId"+this._currentAdResponseNumber++},R),H(this._adResponses,R);var F=this.findAdRequest(R.ad_request_id);F&&(0,I.default)(this.data,"view_ad_request_time",Math.max(0,R.viewer_time-F.viewer_time))}),this.on("adplay",function(N,R){this._adHasPlayed=!0,this._wouldBeNewAdPlay&&(this._wouldBeNewAdPlay=!1,(0,I.default)(this.data,"view_ad_played_count")),this.inPrerollPosition()&&!this.data.view_preroll_played&&(this.data.view_preroll_played=!0,this._adRequests.length>0&&(this.data.view_preroll_request_time=Math.max(0,R.viewer_time-this._adRequests[0].viewer_time)),this.data.view_start&&(this.data.view_startup_preroll_request_time=Math.max(0,R.viewer_time-this.data.view_start)),this._prerollPlayTime=R.viewer_time)}),this.on("adplaying",function(N,R){this.inPrerollPosition()&&this.data.view_preroll_load_time===void 0&&this._prerollPlayTime!==void 0&&(this.data.view_preroll_load_time=R.viewer_time-this._prerollPlayTime,this.data.view_startup_preroll_load_time=R.viewer_time-this._prerollPlayTime)}),this.on("adended",function(){this._wouldBeNewAdPlay=!0}),this.on("aderror",function(){this._wouldBeNewAdPlay=!0})};V.prototype.inPrerollPosition=function(){return this.data.view_content_playback_time===void 0||this.data.view_content_playback_time<=1e3},V.prototype.findAdRequest=function(J){for(var C=0;C<this._adRequests.length;C++)if(this._adRequests[C].ad_request_id===J)return this._adRequests[C]},V.prototype._updateAdData=function(J,C){if(this.inPrerollPosition()){if(!this.data.view_preroll_ad_tag_hostname&&C.ad_tag_url){var N=(0,E.extractHostnameAndDomain)(C.ad_tag_url),R=A(N,2),F=R[0],ee=R[1];this.data.view_preroll_ad_tag_domain=ee,this.data.view_preroll_ad_tag_hostname=F}if(!this.data.view_preroll_ad_asset_hostname&&C.ad_asset_url){var D=(0,E.extractHostnameAndDomain)(C.ad_asset_url),X=A(D,2),p=X[0],v=X[1];this.data.view_preroll_ad_asset_domain=v,this.data.view_preroll_ad_asset_hostname=p}}},w.default=V},function(U,w,L){function y(M){return M&&M.__esModule?M:{default:M}}function A(){var M=this,H=void 0,te=void 0,V=function(){M.disableRebufferTracking||((0,E.default)(M.data,"view_waiting_rebuffer_count",1),H=I.default.now(),te=window.setInterval(function(){if(H){var F=I.default.now();(0,E.default)(M.data,"view_waiting_rebuffer_duration",F-H),H=F}},250))},J=function(){M.disableRebufferTracking||H&&((0,E.default)(M.data,"view_waiting_rebuffer_duration",I.default.now()-H),H=!1,window.clearInterval(te))},C=!1,N=function(){C=!0},R=function(){C=!1,J()};this.on("waiting",function(){C&&V()}),this.on("playing",function(){J(),N()}),this.on("pause",R),this.on("seeking",R)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=A;var I=y(L(2)),E=y(L(3))},function(U,w,L){function y(te){return te&&te.__esModule?te:{default:te}}function A(){var te=this;this.one("playbackheartbeat",M),this.on("playbackheartbeatend",function(){te.off("before*",H),te.one("playbackheartbeat",M)})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=A;var I=y(L(1)),E=y(L(2)),M=function(){this.lastWallClockTime=E.default.now(),this.on("before*",H)},H=function(te){var V=E.default.now(),J=this.lastWallClockTime;this.lastWallClockTime=V,V-J>3e4&&(this.emit("devicesleep",{viewer_time:J}),(0,I.default)(this.data,{viewer_time:J}),this.send("devicesleep"),this.emit("devicewake",{viewer_time:V}),(0,I.default)(this.data,{viewer_time:V}),this.send("devicewake"))}},function(U,w,L){function y(p){return p&&p.__esModule?p:{default:p}}Object.defineProperty(w,"__esModule",{value:!0});var A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},I=y(L(0)),E=L(40),M=y(L(4)),H=y(L(53)),te=y(L(12)),V=y(L(54)),J=y(L(17)),C=y(L(55)),N=y(L(1)),R=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],F=["viewstart","error","ended","viewend"],ee=function(p,v){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=p,this.envKey=v,this.eventQueue=new C.default((0,H.default)(v,P)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=P.sampleRate,this.disableCookies=P.disableCookies,this.respectDoNotTrack=P.respectDoNotTrack;var B=P.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:B.name,viewer_application_version:B.version,viewer_application_engine:B.layout,viewer_device_name:B.product,viewer_device_category:"",viewer_device_manufacturer:B.manufacturer,viewer_os_family:B.os&&B.os.family,viewer_os_architecture:B.os&&B.os.architecture,viewer_os_version:B.os&&B.os.version};var z=(0,V.default)();z&&(this.pageLevelData=(0,N.default)(this.pageLevelData,{viewer_connection_type:z})),I.default!==void 0&&I.default.location&&I.default.location.href&&(this.pageLevelData.page_url=I.default.location.href),this.viewerData=this.disableCookies?{}:(0,E.getAndUpdateViewerData)()};ee.prototype.send=function(p,v){if(p){if(this.respectDoNotTrack&&(0,te.default)())return M.default.info("Not sending `"+p+"` because Do Not Track is enabled");if(!v||(v===void 0?"undefined":A(v))!=="object")return M.default.error("A data object was expected in send() but was not provided");var P=this.disableCookies?{}:(0,E.getAndUpdateSessionData)(),B={};(0,N.default)(B,this.pageLevelData),(0,N.default)(B,v),(0,N.default)(B,P),(0,N.default)(B,this.viewerData),B.event=p,B.env_key=this.envKey,B.user_id&&(B.viewer_user_id=B.user_id,delete B.user_id);var z=B.mux_sample_number>=this.sampleRate,ce=this._deduplicateBeaconData(p,B),ae=(0,J.default)(ce);if(this.lastEventTime=this.mux.utils.now(),z)return M.default.info("Not sending event due to sample rate restriction",p,B,ae);if(this.envKey||M.default.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",p,B,ae),!this.rateLimited){if(M.default.info("Sending event",p,B,ae),this.rateLimited=!this.eventQueue.queueEvent(p,ae),this.mux.WINDOW_UNLOADING&&p==="viewend")this.eventQueue.destroy(!0);else if((F.indexOf(p)>=0||this.mux.WINDOW_VISIBLE===!1&&p==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return B.event="eventrateexceeded",ae=(0,J.default)(B),this.eventQueue.queueEvent(B.event,ae),M.default.error("Beaconing disabled due to rate limit.")}}},ee.prototype.destroy=function(){this.eventQueue.destroy(!1)};var D=function(p,v,P,B){return!(!p||v.indexOf("request_")!==0||v!=="request_response_headers"&&(P===void 0?"undefined":A(P))==="object"&&(B===void 0?"undefined":A(B))==="object"&&Object.keys(P||{}).length===Object.keys(B||{}).length)},X=function(p,v){return p==="renditionchange"&&v.indexOf("video_source_")===0};ee.prototype._deduplicateBeaconData=function(p,v){var P=this,B={},z=v.view_id;if(!z||p==="viewstart"||p==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)B=(0,N.default)({},v),z&&(this.previousBeaconData=B),z&&p==="viewend"&&(this.previousBeaconData=null);else{var ce=p.indexOf("request")===0;Object.keys(v).forEach(function(ae){var ge=v[ae];(ge!==P.previousBeaconData[ae]||R.indexOf(ae)>-1||D(ce,ae,ge,P.previousBeaconData[ae])||X(p,ae))&&(B[ae]=ge,P.previousBeaconData[ae]=ge)})}return B},w.default=ee},function(U,w,L){function y(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(w,"__esModule",{value:!0}),w.getAndUpdateSessionData=w.getAndUpdateViewerData=void 0;var A=y(L(15)),I=y(L(52)),E=L(6),M=y(L(2)),H=function(){var C=void 0;try{C=A.default.parse(I.default.get("muxData")||"")}catch{C={}}return C},te=function(C){try{I.default.set("muxData",A.default.stringify(C),{expires:7300})}catch{}},V=function(){var C=H();return C.mux_viewer_id=C.mux_viewer_id||(0,E.generateUUID)(),C.msn=C.msn||Math.random(),te(C),{mux_viewer_id:C.mux_viewer_id,mux_sample_number:C.msn}},J=function(){var C=H(),N=M.default.now();return C.session_start&&(C.sst=C.session_start,delete C.session_start),C.session_id&&(C.sid=C.session_id,delete C.session_id),C.session_expires&&(C.sex=C.session_expires,delete C.session_expires),(!C.sex||C.sex<N)&&(C.sid=(0,E.generateUUID)(),C.sst=N),C.sex=N+15e5,te(C),{session_id:C.sid,session_start:C.sst,session_expires:C.sex}};w.getAndUpdateViewerData=V,w.getAndUpdateSessionData=J},function(U,w,L){var y=L(42),A=L(16),I=L(10),E=Object.prototype.hasOwnProperty,M={brackets:function(p){return p+"[]"},comma:"comma",indices:function(p,v){return p+"["+v+"]"},repeat:function(p){return p}},H=Array.isArray,te=String.prototype.split,V=Array.prototype.push,J=function(p,v){V.apply(p,H(v)?v:[v])},C=Date.prototype.toISOString,N=I.default,R={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:A.encode,encodeValuesOnly:!1,format:N,formatter:I.formatters[N],indices:!1,serializeDate:function(p){return C.call(p)},skipNulls:!1,strictNullHandling:!1},F=function(p){return typeof p=="string"||typeof p=="number"||typeof p=="boolean"||typeof p=="symbol"||typeof p=="bigint"},ee={},D=function p(v,P,B,z,ce,ae,ge,ue,le,pe,se,oe,xe,Q,Y){for(var de=v,$=Y,Z=0,fe=!1;($=$.get(ee))!==void 0&&!fe;){var Pe=$.get(v);if(Z+=1,Pe!==void 0){if(Pe===Z)throw new RangeError("Cyclic object value");fe=!0}$.get(ee)===void 0&&(Z=0)}if(typeof ge=="function"?de=ge(P,de):de instanceof Date?de=pe(de):B==="comma"&&H(de)&&(de=A.maybeMap(de,function(Qt){return Qt instanceof Date?pe(Qt):Qt})),de===null){if(z)return ae&&!xe?ae(P,R.encoder,Q,"key",se):P;de=""}if(F(de)||A.isBuffer(de)){if(ae){var Re=xe?P:ae(P,R.encoder,Q,"key",se);if(B==="comma"&&xe){for(var Fe=te.call(String(de),","),He="",Ze=0;Ze<Fe.length;++Ze)He+=(Ze===0?"":",")+oe(ae(Fe[Ze],R.encoder,Q,"value",se));return[oe(Re)+"="+He]}return[oe(Re)+"="+oe(ae(de,R.encoder,Q,"value",se))]}return[oe(P)+"="+oe(String(de))]}var $e,Et=[];if(de===void 0)return Et;if(B==="comma"&&H(de))$e=[{value:de.length>0?de.join(",")||null:void 0}];else if(H(ge))$e=ge;else{var bn=Object.keys(de);$e=ue?bn.sort(ue):bn}for(var Tn=0;Tn<$e.length;++Tn){var Lt=$e[Tn],Gt=typeof Lt=="object"&&Lt.value!==void 0?Lt.value:de[Lt];if(!ce||Gt!==null){var it=H(de)?typeof B=="function"?B(P,Lt):P:P+(le?"."+Lt:"["+Lt+"]");Y.set(v,Z);var pt=y();pt.set(ee,Y),J(Et,p(Gt,it,B,z,ce,ae,ge,ue,le,pe,se,oe,xe,Q,pt))}}return Et},X=function(p){if(!p)return R;if(p.encoder!==null&&p.encoder!==void 0&&typeof p.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=p.charset||R.charset;if(p.charset!==void 0&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=I.default;if(p.format!==void 0){if(!E.call(I.formatters,p.format))throw new TypeError("Unknown format option provided.");P=p.format}var B=I.formatters[P],z=R.filter;return(typeof p.filter=="function"||H(p.filter))&&(z=p.filter),{addQueryPrefix:typeof p.addQueryPrefix=="boolean"?p.addQueryPrefix:R.addQueryPrefix,allowDots:p.allowDots===void 0?R.allowDots:!!p.allowDots,charset:v,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:R.charsetSentinel,delimiter:p.delimiter===void 0?R.delimiter:p.delimiter,encode:typeof p.encode=="boolean"?p.encode:R.encode,encoder:typeof p.encoder=="function"?p.encoder:R.encoder,encodeValuesOnly:typeof p.encodeValuesOnly=="boolean"?p.encodeValuesOnly:R.encodeValuesOnly,filter:z,format:P,formatter:B,serializeDate:typeof p.serializeDate=="function"?p.serializeDate:R.serializeDate,skipNulls:typeof p.skipNulls=="boolean"?p.skipNulls:R.skipNulls,sort:typeof p.sort=="function"?p.sort:null,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:R.strictNullHandling}};U.exports=function(p,v){var P,B=p,z=X(v);typeof z.filter=="function"?B=(0,z.filter)("",B):H(z.filter)&&(P=z.filter);var ce,ae=[];if(typeof B!="object"||B===null)return"";ce=v&&v.arrayFormat in M?v.arrayFormat:v&&"indices"in v?v.indices?"indices":"repeat":"indices";var ge=M[ce];P||(P=Object.keys(B)),z.sort&&P.sort(z.sort);for(var ue=y(),le=0;le<P.length;++le){var pe=P[le];z.skipNulls&&B[pe]===null||J(ae,D(B[pe],pe,ge,z.strictNullHandling,z.skipNulls,z.encode?z.encoder:null,z.filter,z.sort,z.allowDots,z.serializeDate,z.format,z.formatter,z.encodeValuesOnly,z.charset,ue))}var se=ae.join(z.delimiter),oe=z.addQueryPrefix===!0?"?":"";return z.charsetSentinel&&(z.charset==="iso-8859-1"?oe+="utf8=%26%2310003%3B&":oe+="utf8=%E2%9C%93&"),se.length>0?oe+se:""}},function(U,w,L){var y=L(8),A=L(47),I=L(49),E=y("%TypeError%"),M=y("%WeakMap%",!0),H=y("%Map%",!0),te=A("WeakMap.prototype.get",!0),V=A("WeakMap.prototype.set",!0),J=A("WeakMap.prototype.has",!0),C=A("Map.prototype.get",!0),N=A("Map.prototype.set",!0),R=A("Map.prototype.has",!0),F=function(p,v){for(var P,B=p;(P=B.next)!==null;B=P)if(P.key===v)return B.next=P.next,P.next=p.next,p.next=P,P},ee=function(p,v){var P=F(p,v);return P&&P.value},D=function(p,v,P){var B=F(p,v);B?B.value=P:p.next={key:v,next:p.next,value:P}},X=function(p,v){return!!F(p,v)};U.exports=function(){var p,v,P,B={assert:function(z){if(!B.has(z))throw new E("Side channel does not contain "+I(z))},get:function(z){if(M&&z&&(typeof z=="object"||typeof z=="function")){if(p)return te(p,z)}else if(H){if(v)return C(v,z)}else if(P)return ee(P,z)},has:function(z){if(M&&z&&(typeof z=="object"||typeof z=="function")){if(p)return J(p,z)}else if(H){if(v)return R(v,z)}else if(P)return X(P,z);return!1},set:function(z,ce){M&&z&&(typeof z=="object"||typeof z=="function")?(p||(p=new M),V(p,z,ce)):H?(v||(v=new H),N(v,z,ce)):(P||(P={key:{},next:null}),D(P,z,ce))}};return B}},function(U,w,L){var y=typeof Symbol<"u"&&Symbol,A=L(44);U.exports=function(){return typeof y=="function"&&typeof Symbol=="function"&&typeof y("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&A()}},function(U,w,L){U.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var y={},A=Symbol("test"),I=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(I)!=="[object Symbol]")return!1;for(A in y[A]=42,y)return!1;if(typeof Object.keys=="function"&&Object.keys(y).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(y).length!==0)return!1;var E=Object.getOwnPropertySymbols(y);if(E.length!==1||E[0]!==A||!Object.prototype.propertyIsEnumerable.call(y,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var M=Object.getOwnPropertyDescriptor(y,A);if(M.value!==42||M.enumerable!==!0)return!1}return!0}},function(U,w,L){var y=Array.prototype.slice,A=Object.prototype.toString;U.exports=function(I){var E=this;if(typeof E!="function"||A.call(E)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+E);for(var M,H=y.call(arguments,1),te=function(){if(this instanceof M){var R=E.apply(this,H.concat(y.call(arguments)));return Object(R)===R?R:this}return E.apply(I,H.concat(y.call(arguments)))},V=Math.max(0,E.length-H.length),J=[],C=0;C<V;C++)J.push("$"+C);if(M=Function("binder","return function ("+J.join(",")+"){ return binder.apply(this,arguments); }")(te),E.prototype){var N=function(){};N.prototype=E.prototype,M.prototype=new N,N.prototype=null}return M}},function(U,w,L){var y=L(9);U.exports=y.call(Function.call,Object.prototype.hasOwnProperty)},function(U,w,L){var y=L(8),A=L(48),I=A(y("String.prototype.indexOf"));U.exports=function(E,M){var H=y(E,!!M);return typeof H=="function"&&I(E,".prototype.")>-1?A(H):H}},function(U,w,L){var y=L(9),A=L(8),I=A("%Function.prototype.apply%"),E=A("%Function.prototype.call%"),M=A("%Reflect.apply%",!0)||y.call(E,I),H=A("%Object.getOwnPropertyDescriptor%",!0),te=A("%Object.defineProperty%",!0),V=A("%Math.max%");if(te)try{te({},"a",{value:1})}catch{te=null}U.exports=function(C){var N=M(y,E,arguments);return H&&te&&H(N,"length").configurable&&te(N,"length",{value:1+V(0,C.length-(arguments.length-1))}),N};var J=function(){return M(y,I,arguments)};te?te(U.exports,"apply",{value:J}):U.exports.apply=J},function(U,w,L){function y(ve,Ee){if(ve===1/0||ve===-1/0||ve!=ve||ve&&ve>-1e3&&ve<1e3||Xe.call(/e/,Ee))return Ee;var et=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ve=="number"){var S=ve<0?-Bn(-ve):Bn(ve);if(S!==ve){var k=String(S),K=Gt.call(Ee,k.length+1);return it.call(k,et,"$&_")+"."+it.call(it.call(K,/([0-9]{3})/g,"$&_"),/_$/,"")}}return it.call(Ee,et,"$&_")}function A(ve,Ee,et){var S=(et.quoteStyle||Ee)==="double"?'"':"'";return S+ve+S}function I(ve){return it.call(String(ve),/"/g,""")}function E(ve){return!(ee(ve)!=="[object Array]"||Tt&&typeof ve=="object"&&Tt in ve)}function M(ve){return!(ee(ve)!=="[object Date]"||Tt&&typeof ve=="object"&&Tt in ve)}function H(ve){return!(ee(ve)!=="[object RegExp]"||Tt&&typeof ve=="object"&&Tt in ve)}function te(ve){return!(ee(ve)!=="[object Error]"||Tt&&typeof ve=="object"&&Tt in ve)}function V(ve){return!(ee(ve)!=="[object String]"||Tt&&typeof ve=="object"&&Tt in ve)}function J(ve){return!(ee(ve)!=="[object Number]"||Tt&&typeof ve=="object"&&Tt in ve)}function C(ve){return!(ee(ve)!=="[object Boolean]"||Tt&&typeof ve=="object"&&Tt in ve)}function N(ve){if(gn)return ve&&typeof ve=="object"&&ve instanceof Symbol;if(typeof ve=="symbol")return!0;if(!ve||typeof ve!="object"||!ut)return!1;try{return ut.call(ve),!0}catch{}return!1}function R(ve){if(!ve||typeof ve!="object"||!jn)return!1;try{return jn.call(ve),!0}catch{}return!1}function F(ve,Ee){return on.call(ve,Ee)}function ee(ve){return bn.call(ve)}function D(ve){if(ve.name)return ve.name;var Ee=Lt.call(Tn.call(ve),/^function\s*([\w$]+)/);return Ee?Ee[1]:null}function X(ve,Ee){if(ve.indexOf)return ve.indexOf(Ee);for(var et=0,S=ve.length;et<S;et++)if(ve[et]===Ee)return et;return-1}function p(ve){if(!$||!ve||typeof ve!="object")return!1;try{$.call(ve);try{Re.call(ve)}catch{return!0}return ve instanceof Map}catch{}return!1}function v(ve){if(!He||!ve||typeof ve!="object")return!1;try{He.call(ve,He);try{Ze.call(ve,Ze)}catch{return!0}return ve instanceof WeakMap}catch{}return!1}function P(ve){if(!$e||!ve||typeof ve!="object")return!1;try{return $e.call(ve),!0}catch{}return!1}function B(ve){if(!Re||!ve||typeof ve!="object")return!1;try{Re.call(ve);try{$.call(ve)}catch{return!0}return ve instanceof Set}catch{}return!1}function z(ve){if(!Ze||!ve||typeof ve!="object")return!1;try{Ze.call(ve,Ze);try{He.call(ve,He)}catch{return!0}return ve instanceof WeakSet}catch{}return!1}function ce(ve){return!(!ve||typeof ve!="object")&&(typeof HTMLElement<"u"&&ve instanceof HTMLElement||typeof ve.nodeName=="string"&&typeof ve.getAttribute=="function")}function ae(ve,Ee){if(ve.length>Ee.maxStringLength){var et=ve.length-Ee.maxStringLength,S="... "+et+" more character"+(et>1?"s":"");return ae(Gt.call(ve,0,Ee.maxStringLength),Ee)+S}return A(it.call(it.call(ve,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ge),"single",Ee)}function ge(ve){var Ee=ve.charCodeAt(0),et={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ee];return et?"\\"+et:"\\x"+(Ee<16?"0":"")+pt.call(Ee.toString(16))}function ue(ve){return"Object("+ve+")"}function le(ve){return ve+" { ? }"}function pe(ve,Ee,et,S){return ve+" ("+Ee+") {"+(S?xe(et,S):Bt.call(et,", "))+"}"}function se(ve){for(var Ee=0;Ee<ve.length;Ee++)if(X(ve[Ee],` `)>=0)return!1;return!0}function oe(ve,Ee){var et;if(ve.indent===" ")et=" ";else{if(!(typeof ve.indent=="number"&&ve.indent>0))return null;et=Bt.call(Array(ve.indent+1)," ")}return{base:et,prev:Bt.call(Array(Ee+1),et)}}function xe(ve,Ee){if(ve.length===0)return"";var et=` `+Ee.prev+Ee.base;return et+Bt.call(ve,","+et)+` `+Ee.prev}function Q(ve,Ee){var et=E(ve),S=[];if(et){S.length=ve.length;for(var k=0;k<ve.length;k++)S[k]=F(ve,k)?Ee(ve[k],ve):""}var K,me=typeof rr=="function"?rr(ve):[];if(gn){K={};for(var Be=0;Be<me.length;Be++)K["$"+me[Be]]=me[Be]}for(var Ke in ve)F(ve,Ke)&&(et&&String(Number(Ke))===Ke&&Ke<ve.length||gn&&K["$"+Ke]instanceof Symbol||(Xe.call(/[^\w$]/,Ke)?S.push(Ee(Ke,ve)+": "+Ee(ve[Ke],ve)):S.push(Ke+": "+Ee(ve[Ke],ve))));if(typeof rr=="function")for(var nt=0;nt<me.length;nt++)ir.call(ve,me[nt])&&S.push("["+Ee(me[nt])+"]: "+Ee(ve[me[nt]],ve));return S}var Y=typeof Map=="function"&&Map.prototype,de=Object.getOwnPropertyDescriptor&&Y?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$=Y&&de&&typeof de.get=="function"?de.get:null,Z=Y&&Map.prototype.forEach,fe=typeof Set=="function"&&Set.prototype,Pe=Object.getOwnPropertyDescriptor&&fe?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Re=fe&&Pe&&typeof Pe.get=="function"?Pe.get:null,Fe=fe&&Set.prototype.forEach,He=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap.prototype.has:null,Ze=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet.prototype.has:null,$e=typeof WeakRef=="function"&&WeakRef.prototype?WeakRef.prototype.deref:null,Et=Boolean.prototype.valueOf,bn=Object.prototype.toString,Tn=Function.prototype.toString,Lt=String.prototype.match,Gt=String.prototype.slice,it=String.prototype.replace,pt=String.prototype.toUpperCase,Qt=String.prototype.toLowerCase,Xe=RegExp.prototype.test,_t=Array.prototype.concat,Bt=Array.prototype.join,hr=Array.prototype.slice,Bn=Math.floor,jn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,rr=Object.getOwnPropertySymbols,ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Tt=typeof Symbol=="function"&&Symbol.toStringTag?Symbol.toStringTag:null,ir=Object.prototype.propertyIsEnumerable,wt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ve){return ve.__proto__}:null),Fn=L(50).custom,qn=Fn&&N(Fn)?Fn:null;U.exports=function ve(Ee,et,S,k){function K(ar,Ir,Ya){if(Ir&&(k=hr.call(k)).push(Ir),Ya){var Ri={depth:me.depth};return F(me,"quoteStyle")&&(Ri.quoteStyle=me.quoteStyle),ve(ar,Ri,S+1,k)}return ve(ar,me,S+1,k)}var me=et||{};if(F(me,"quoteStyle")&&me.quoteStyle!=="single"&&me.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(F(me,"maxStringLength")&&(typeof me.maxStringLength=="number"?me.maxStringLength<0&&me.maxStringLength!==1/0:me.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Be=!F(me,"customInspect")||me.customInspect;if(typeof Be!="boolean"&&Be!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(F(me,"indent")&&me.indent!==null&&me.indent!==" "&&!(parseInt(me.indent,10)===me.indent&&me.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(F(me,"numericSeparator")&&typeof me.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ke=me.numericSeparator;if(Ee===void 0)return"undefined";if(Ee===null)return"null";if(typeof Ee=="boolean")return Ee?"true":"false";if(typeof Ee=="string")return ae(Ee,me);if(typeof Ee=="number"){if(Ee===0)return 1/0/Ee>0?"0":"-0";var nt=String(Ee);return Ke?y(Ee,nt):nt}if(typeof Ee=="bigint"){var at=String(Ee)+"n";return Ke?y(Ee,at):at}var un=me.depth===void 0?5:me.depth;if(S===void 0&&(S=0),S>=un&&un>0&&typeof Ee=="object")return E(Ee)?"[Array]":"[Object]";var Mt=oe(me,S);if(k===void 0)k=[];else if(X(k,Ee)>=0)return"[Circular]";if(typeof Ee=="function"){var nn=D(Ee),Hn=Q(Ee,K);return"[Function"+(nn?": "+nn:" (anonymous)")+"]"+(Hn.length>0?" { "+Bt.call(Hn,", ")+" }":"")}if(N(Ee)){var ln=gn?it.call(String(Ee),/^(Symbol\(.*\))_[^)]*$/,"$1"):ut.call(Ee);return typeof Ee!="object"||gn?ln:ue(ln)}if(ce(Ee)){for(var cn="<"+Qt.call(String(Ee.nodeName)),rn=Ee.attributes||[],Ht=0;Ht<rn.length;Ht++)cn+=" "+rn[Ht].name+"="+A(I(rn[Ht].value),"double",me);return cn+=">",Ee.childNodes&&Ee.childNodes.length&&(cn+="..."),cn+"</"+Qt.call(String(Ee.nodeName))+">"}if(E(Ee)){if(Ee.length===0)return"[]";var vn=Q(Ee,K);return Mt&&!se(vn)?"["+xe(vn,Mt)+"]":"[ "+Bt.call(vn,", ")+" ]"}if(te(Ee)){var An=Q(Ee,K);return"cause"in Ee&&!ir.call(Ee,"cause")?"{ ["+String(Ee)+"] "+Bt.call(_t.call("[cause]: "+K(Ee.cause),An),", ")+" }":An.length===0?"["+String(Ee)+"]":"{ ["+String(Ee)+"] "+Bt.call(An,", ")+" }"}if(typeof Ee=="object"&&Be){if(qn&&typeof Ee[qn]=="function")return Ee[qn]();if(Be!=="symbol"&&typeof Ee.inspect=="function")return Ee.inspect()}if(p(Ee)){var Pn=[];return Z.call(Ee,function(ar,Ir){Pn.push(K(Ir,Ee,!0)+" => "+K(ar,Ee))}),pe("Map",$.call(Ee),Pn,Mt)}if(B(Ee)){var dn=[];return Fe.call(Ee,function(ar){dn.push(K(ar,Ee))}),pe("Set",Re.call(Ee),dn,Mt)}if(v(Ee))return le("WeakMap");if(z(Ee))return le("WeakSet");if(P(Ee))return le("WeakRef");if(J(Ee))return ue(K(Number(Ee)));if(R(Ee))return ue(K(jn.call(Ee)));if(C(Ee))return ue(Et.call(Ee));if(V(Ee))return ue(K(String(Ee)));if(!M(Ee)&&!H(Ee)){var On=Q(Ee,K),Li=wt?wt(Ee)===Object.prototype:Ee instanceof Object||Ee.constructor===Object,ni=Ee instanceof Object?"":"null prototype",Mi=!Li&&Tt&&Object(Ee)===Ee&&Tt in Ee?Gt.call(ee(Ee),8,-1):ni?"Object":"",ri=(Li||typeof Ee.constructor!="function"?"":Ee.constructor.name?Ee.constructor.name+" ":"")+(Mi||ni?"["+Bt.call(_t.call([],Mi||[],ni||[]),": ")+"] ":"");return On.length===0?ri+"{}":Mt?ri+"{"+xe(On,Mt)+"}":ri+"{ "+Bt.call(On,", ")+" }"}return String(Ee)};var on=Object.prototype.hasOwnProperty||function(ve){return ve in this}},function(U,w){},function(U,w,L){var y=L(16),A=Object.prototype.hasOwnProperty,I=Array.isArray,E={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:y.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},M=function(N){return N.replace(/&#(\d+);/g,function(R,F){return String.fromCharCode(parseInt(F,10))})},H=function(N,R){return N&&typeof N=="string"&&R.comma&&N.indexOf(",")>-1?N.split(","):N},te=function(N,R){var F,ee={},D=R.ignoreQueryPrefix?N.replace(/^\?/,""):N,X=R.parameterLimit===1/0?void 0:R.parameterLimit,p=D.split(R.delimiter,X),v=-1,P=R.charset;if(R.charsetSentinel)for(F=0;F<p.length;++F)p[F].indexOf("utf8=")===0&&(p[F]==="utf8=%E2%9C%93"?P="utf-8":p[F]==="utf8=%26%2310003%3B"&&(P="iso-8859-1"),v=F,F=p.length);for(F=0;F<p.length;++F)if(F!==v){var B,z,ce=p[F],ae=ce.indexOf("]="),ge=ae===-1?ce.indexOf("="):ae+1;ge===-1?(B=R.decoder(ce,E.decoder,P,"key"),z=R.strictNullHandling?null:""):(B=R.decoder(ce.slice(0,ge),E.decoder,P,"key"),z=y.maybeMap(H(ce.slice(ge+1),R),function(ue){return R.decoder(ue,E.decoder,P,"value")})),z&&R.interpretNumericEntities&&P==="iso-8859-1"&&(z=M(z)),ce.indexOf("[]=")>-1&&(z=I(z)?[z]:z),A.call(ee,B)?ee[B]=y.combine(ee[B],z):ee[B]=z}return ee},V=function(N,R,F,ee){for(var D=ee?R:H(R,F),X=N.length-1;X>=0;--X){var p,v=N[X];if(v==="[]"&&F.parseArrays)p=[].concat(D);else{p=F.plainObjects?Object.create(null):{};var P=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,B=parseInt(P,10);F.parseArrays||P!==""?!isNaN(B)&&v!==P&&String(B)===P&&B>=0&&F.parseArrays&&B<=F.arrayLimit?(p=[])[B]=D:P!=="__proto__"&&(p[P]=D):p={0:D}}D=p}return D},J=function(N,R,F,ee){if(N){var D=F.allowDots?N.replace(/\.([^.[]+)/g,"[$1]"):N,X=/(\[[^[\]]*])/,p=/(\[[^[\]]*])/g,v=F.depth>0&&X.exec(D),P=v?D.slice(0,v.index):D,B=[];if(P){if(!F.plainObjects&&A.call(Object.prototype,P)&&!F.allowPrototypes)return;B.push(P)}for(var z=0;F.depth>0&&(v=p.exec(D))!==null&&z<F.depth;){if(z+=1,!F.plainObjects&&A.call(Object.prototype,v[1].slice(1,-1))&&!F.allowPrototypes)return;B.push(v[1])}return v&&B.push("["+D.slice(v.index)+"]"),V(B,R,F,ee)}},C=function(N){if(!N)return E;if(N.decoder!==null&&N.decoder!==void 0&&typeof N.decoder!="function")throw new TypeError("Decoder has to be a function.");if(N.charset!==void 0&&N.charset!=="utf-8"&&N.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var R=N.charset===void 0?E.charset:N.charset;return{allowDots:N.allowDots===void 0?E.allowDots:!!N.allowDots,allowPrototypes:typeof N.allowPrototypes=="boolean"?N.allowPrototypes:E.allowPrototypes,allowSparse:typeof N.allowSparse=="boolean"?N.allowSparse:E.allowSparse,arrayLimit:typeof N.arrayLimit=="number"?N.arrayLimit:E.arrayLimit,charset:R,charsetSentinel:typeof N.charsetSentinel=="boolean"?N.charsetSentinel:E.charsetSentinel,comma:typeof N.comma=="boolean"?N.comma:E.comma,decoder:typeof N.decoder=="function"?N.decoder:E.decoder,delimiter:typeof N.delimiter=="string"||y.isRegExp(N.delimiter)?N.delimiter:E.delimiter,depth:typeof N.depth=="number"||N.depth===!1?+N.depth:E.depth,ignoreQueryPrefix:N.ignoreQueryPrefix===!0,interpretNumericEntities:typeof N.interpretNumericEntities=="boolean"?N.interpretNumericEntities:E.interpretNumericEntities,parameterLimit:typeof N.parameterLimit=="number"?N.parameterLimit:E.parameterLimit,parseArrays:N.parseArrays!==!1,plainObjects:typeof N.plainObjects=="boolean"?N.plainObjects:E.plainObjects,strictNullHandling:typeof N.strictNullHandling=="boolean"?N.strictNullHandling:E.strictNullHandling}};U.exports=function(N,R){var F=C(R);if(N===""||N==null)return F.plainObjects?Object.create(null):{};for(var ee=typeof N=="string"?te(N,F):N,D=F.plainObjects?Object.create(null):{},X=Object.keys(ee),p=0;p<X.length;++p){var v=X[p],P=J(v,ee[v],F,typeof N=="string");D=y.merge(D,P,F)}return F.allowSparse===!0?D:y.compact(D)}},function(U,w,L){var y,A,I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};(function(E){var M=!1;if((A=typeof(y=E)=="function"?y.call(w,L,w,U):y)!==void 0&&(U.exports=A),M=!0,I(w)==="object"&&(U.exports=E(),M=!0),!M){var H=window.Cookies,te=window.Cookies=E();te.noConflict=function(){return window.Cookies=H,te}}})(function(){function E(H){function te(V,J,C){var N;if(typeof document<"u"){if(arguments.length>1){if(typeof(C=M({path:"/"},te.defaults,C)).expires=="number"){var R=new Date;R.setMilliseconds(R.getMilliseconds()+864e5*C.expires),C.expires=R}try{N=JSON.stringify(J),/^[\{\[]/.test(N)&&(J=N)}catch{}return J=H.write?H.write(J,V):encodeURIComponent(String(J)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),V=(V=(V=encodeURIComponent(String(V))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[V,"=",J,C.expires?"; expires="+C.expires.toUTCString():"",C.path?"; path="+C.path:"",C.domain?"; domain="+C.domain:"",C.secure?"; secure":""].join("")}V||(N={});for(var F=document.cookie?document.cookie.split("; "):[],ee=/(%[0-9A-Z]{2})+/g,D=0;D<F.length;D++){var X=F[D].split("="),p=X.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{var v=X[0].replace(ee,decodeURIComponent);if(p=H.read?H.read(p,v):H(p,v)||p.replace(ee,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch{}if(V===v){N=p;break}V||(N[v]=p)}catch{}}return N}}return te.set=te,te.get=function(V){return te.call(te,V)},te.getJSON=function(){return te.apply({json:!0},[].slice.call(arguments))},te.defaults={},te.remove=function(V,J){te(V,"",M(J,{expires:-1}))},te.withConverter=E,te}var M=function(){for(var H=0,te={};H<arguments.length;H++){var V=arguments[H];for(var J in V)te[J]=V[J]}return te};return E(function(){})})},function(U,w,L){function y(A,I){var E=I.beaconCollectionDomain,M=I.beaconDomain;if(E)return"https://"+E;var H=M||"litix.io";return(A=A||"inferred").match(/^[a-z0-9]+$/)?"https://"+A+"."+H:"https://img.litix.io/a.gif"}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y,A=L(0),I=(y=A)&&y.__esModule?y:{default:y},E=function(){var H=void 0;switch(M()){case"cellular":H="cellular";break;case"ethernet":H="wired";break;case"wifi":H="wifi";break;case void 0:break;default:H="other"}return H},M=function(){var H=I.default.navigator,te=H&&(H.connection||H.mozConnection||H.webkitConnection);return te&&te.type};w.default=E},function(U,w,L){function y(R){return R&&R.__esModule?R:{default:R}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(L(0)),I=y(L(4)),E=y(L(56)),M=y(L(1)),H=y(L(17)),te=y(L(2)),V=!!A.default.XMLHttpRequest&&"withCredentials"in new A.default.XMLHttpRequest,J={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},C=["hb","requestcompleted","requestfailed","requestcanceled"],N=function(R,F){this._beaconUrl=R||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=(0,M.default)({},J,F)};N.prototype.queueEvent=function(R,F){var ee=(0,M.default)({},F);return V?(this._eventQueue.length<=this._options.maxQueueLength||R==="eventrateexceeded")&&(this._eventQueue.push(ee),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength):(E.default.send(this._beaconUrl,ee),!0)},N.prototype.flushEvents=function(){V&&(this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending())},N.prototype.destroy=function(){var R=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,R?this._clearBeaconQueue():this.flushEvents(),A.default.clearTimeout(this._sendTimeout)},N.prototype._clearBeaconQueue=function(){var R=A.default.navigator,F=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,ee=this._eventQueue.slice(F);F>0&&(0,M.default)(ee[ee.length-1],(0,H.default)({mux_view_message:"event queue truncated"}));var D=this._createPayload(ee);if(R.sendBeacon)R.sendBeacon(this._beaconUrl,D);else if(A.default.XMLHttpRequest){var X=new A.default.XMLHttpRequest;X.open("POST",this._beaconUrl),X.setRequestHeader("Content-Type","application/json"),X.send(D)}else E.default.send(this._beaconUrl,ee[ee.length-1])},N.prototype._sendBeaconQueue=function(){var R=this;if(A.default.XMLHttpRequest&&!this._postInFlight){var F=new A.default.XMLHttpRequest,ee=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0,F.onreadystatechange=function(){F.readyState===4&&(F.status!==200?(R._eventQueue=ee.concat(R._eventQueue),R._failureCount+=1,I.default.info("Error sending beacon: "+F.status),I.default.info(F.responseText)):R._failureCount=0,R._roundTripTime=te.default.now()-X,R._postInFlight=!1)},F.open("POST",this._beaconUrl),F.setRequestHeader("Content-Type","application/json");var D=this._createPayload(ee),X=te.default.now();F.send(D)}},N.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var R=Math.pow(2,this._failureCount-1);return(1+(R*=Math.random()))*this._options.baseTimeBetweenBeacons},N.prototype._startBeaconSending=function(){var R=this;A.default.clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=A.default.setTimeout(function(){R._eventQueue.length&&R._sendBeaconQueue(),R._startBeaconSending()},this._getNextBeaconTime()))},N.prototype._createPayload=function(R){var F=this,ee={transmission_timestamp:Math.round(te.default.now())};this._roundTripTime&&(ee.rtt_ms=Math.round(this._roundTripTime));var D=void 0,X=void 0,p=void 0,v=function(){D=JSON.stringify({metadata:ee,events:X||R}),p=D.length/1024},P=function(){return p<=F._options.maxPayloadKBSize};return v(),P()||(I.default.info("Payload size is too big ("+p+" kb). Removing unnecessary events."),X=R.filter(function(B){return C.indexOf(B.e)===-1}),v()),P()||(I.default.info("Payload size still too big ("+p+" kb). Cropping fields.."),X.forEach(function(B){for(var z in B){var ce=B[z];typeof ce=="string"&&ce.length>51200&&(B[z]=ce.substring(0,51200))}}),v()),D},w.default=N},function(U,w,L){function y(M){return M&&M.__esModule?M:{default:M}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(L(15)),I=y(L(0)),E={send:function(M,H){function te(){V.src=C+(J?"&rc="+J:"")}var V=new Image,J=0,C=M+"?"+A.default.stringify(H);return V.addEventListener("error",function(){J>3||I.default.setTimeout(function(){J++,te()},5e3*J)}),te(),V}};w.default=E},function(U,w,L){function y(){function A(R,F){var ee=F.request_start,D=F.request_response_start,X=F.request_response_end,p=F.request_bytes_loaded;V++;var v=void 0,P=void 0;if(D?(v=D-ee,P=X-D):P=X-ee,P>0&&p>0){var B=p/P*8e3;J++,H+=p,te+=P,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,B),this.data.view_average_request_throughput=H/te*8e3,this.data.view_request_count=V,v>0&&(M+=v,this.data.view_max_request_latency=Math.max(this.data.view_max_request_latency||0,v),this.data.view_average_request_latency=M/J)}}function I(R,F){V++,C++,this.data.view_request_count=V,this.data.view_request_failed_count=C}function E(R,F){V++,N++,this.data.view_request_count=V,this.data.view_request_canceled_count=N}var M=0,H=0,te=0,V=0,J=0,C=0,N=0;this.on("requestcompleted",A),this.on("requestfailed",I),this.on("requestcanceled",E)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,L){function y(C,N,R){var F=(0,te.findMediaElement)(N),ee=I(F,3),D=ee[0],X=ee[1],p=ee[2],v=C.log,P=C.utils.getComputedStyle,B=C.utils.secondsToMs,z={automaticErrorTracking:!0};if(!D)return v.error("No element was found with the `"+X+"` query selector.");if(p!=="video"&&p!=="audio")return v.error("The element of `"+X+"` was not a media element.");(R=(0,H.default)(z,R)).data=(0,H.default)({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:"4.9.1"},R.data),R.getPlayheadTime=function(){return B(D.currentTime)},R.getStateData=function(){var ae=this.hlsjs&&this.hlsjs.url,ge=this.dashjs&&A(this.dashjs.getSource==="function")&&this.dashjs.getSource(),ue={player_is_paused:D.paused,player_playhead_time:B(D.currentTime),player_width:parseInt(P(D,"width")),player_height:parseInt(P(D,"height")),player_autoplay_on:D.autoplay,player_preload_on:D.preload,video_poster_url:D.poster,video_source_url:ae||ge||D.currentSrc,video_source_duration:B(D.duration),video_source_height:D.videoHeight,video_source_width:D.videoWidth},le=R.getPlayheadTime();if(D.getStartDate&&le>0){var pe=D.getStartDate();if(pe&&typeof pe.getTime=="function"&&pe.getTime()){var se=pe.getTime();if(ue.player_program_time=se+le,D.seekable.length>0){var oe=se+D.seekable.end(D.seekable.length-1);ue.player_live_edge_program_time=oe}}}return ue},D.mux=D.mux||{},D.mux.deleted=!1,D.mux.emit=function(ae,ge){C.emit(X,ae,ge)};var ce=function(){v.error("The monitor for this video element has already been destroyed.")};D.mux.destroy=function(){Object.keys(D.mux.listeners).forEach(function(ae){D.removeEventListener(ae,D.mux.listeners[ae],!1)}),delete D.mux.listeners,D.mux.destroy=ce,D.mux.swapElement=ce,D.mux.emit=ce,D.mux.addHLSJS=ce,D.mux.addDashJS=ce,D.mux.removeHLSJS=ce,D.mux.removeDashJS=ce,D.mux.deleted=!0,C.emit(X,"destroy")},D.mux.swapElement=function(ae){var ge=(0,te.findMediaElement)(ae),ue=I(ge,3),le=ue[0],pe=ue[1],se=ue[2];return le?se!=="video"&&se!=="audio"?C.log.error("The element of `"+pe+"` was not a media element."):(le.muxId=D.muxId,delete D.muxId,le.mux=le.mux||{},le.mux.listeners=(0,H.default)({},D.mux.listeners),delete D.mux.listeners,Object.keys(le.mux.listeners).forEach(function(oe){D.removeEventListener(oe,le.mux.listeners[oe],!1),le.addEventListener(oe,le.mux.listeners[oe],!1)}),le.mux.swapElement=D.mux.swapElement,le.mux.destroy=D.mux.destroy,delete D.mux,void(D=le)):C.log.error("No element was found with the `"+pe+"` query selector.")},D.mux.addHLSJS=function(ae){C.addHLSJS(X,ae)},D.mux.addDashJS=function(ae){C.addDashJS(X,ae)},D.mux.removeHLSJS=function(){C.removeHLSJS(X)},D.mux.removeDashJS=function(){C.removeDashJS(X)},C.init(X,R),C.emit(X,"playerready"),D.paused||(C.emit(X,"play"),D.readyState>2&&C.emit(X,"playing")),D.mux.listeners={},V.forEach(function(ae){(ae!=="error"||R.automaticErrorTracking)&&(D.mux.listeners[ae]=function(){var ge={};if(ae==="error"){if(!D.error||D.error.code===1)return;ge.player_error_code=D.error.code,ge.player_error_message=J[D.error.code]||D.error.message}C.emit(X,ae,ge)},D.addEventListener(ae,D.mux.listeners[ae],!1))})}Object.defineProperty(w,"__esModule",{value:!0});var A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},I=function(){function C(N,R){var F=[],ee=!0,D=!1,X=void 0;try{for(var p,v=N[Symbol.iterator]();!(ee=(p=v.next()).done)&&(F.push(p.value),!R||F.length!==R);ee=!0);}catch(P){D=!0,X=P}finally{try{!ee&&v.return&&v.return()}finally{if(D)throw X}}return F}return function(N,R){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return C(N,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();w.default=y;var E,M=L(1),H=(E=M)&&E.__esModule?E:{default:E},te=L(11),V=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],J={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"}},function(U,w,L){function y(R){return R&&R.__esModule?R:{default:R}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(L(60)),I=y(L(3)),E=y(L(61)),M=y(L(62)),H=y(L(1)),te=y(L(7)),V=L(5),J=y(L(2)),C=y(L(63)),N={};N.safeCall=A.default,N.safeIncrement=I.default,N.getComputedStyle=E.default,N.secondsToMs=M.default,N.assign=H.default,N.headersStringToObject=te.default,N.extractHostnameAndDomain=V.extractHostnameAndDomain,N.extractHostname=V.extractHostname,N.now=J.default.now,N.manifestParser=C.default,w.default=N},function(U,w,L){function y(M,H,te,V){var J=V;if(M&&typeof M[H]=="function")try{J=M[H].apply(M,te)}catch(C){E.default.info("safeCall error",C)}return J}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=L(4),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,L){function y(H,te){if(H&&te&&E.default&&typeof E.default.getComputedStyle=="function"){var V=void 0;return M&&M.has(H)&&(V=M.get(H)),V||(V=E.default.getComputedStyle(H,null),M&&M.set(H,V)),V.getPropertyValue(te)}}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=L(0),E=(A=I)&&A.__esModule?A:{default:A},M=void 0;E.default&&E.default.WeakMap&&(M=new WeakMap)},function(U,w,L){function y(A){return Math.floor(1e3*A)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,L){function y(ee){return ee&&ee.__esModule?ee:{default:ee}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(L(1)),I=y(L(14)),E={TARGET_DURATION:"#EXT-X-TARGETDURATION",PART_INF:"#EXT-X-PART-INF",SERVER_CONTROL:"#EXT-X-SERVER-CONTROL",INF:"#EXTINF",PROGRAM_DATE_TIME:"#EXT-X-PROGRAM-DATE-TIME",VERSION:"#EXT-X-VERSION",SESSION_DATA:"#EXT-X-SESSION-DATA"},M=function(ee){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(ee),this.manifest};M.prototype.process=function(ee){var D=void 0;for(this.buffer+=ee,D=this.buffer.indexOf(` `);D>-1;D=this.buffer.indexOf(` `))this.processLine(this.buffer.substring(0,D)),this.buffer=this.buffer.substring(D+1)},M.prototype.processLine=function(ee){var D=ee.indexOf(":"),X=R(ee,D),p=X[0],v=X.length===2?V(X[1]):void 0;if(p[0]!=="#")this.currentUri.uri=p,this.manifest.segments.push(this.currentUri),!this.manifest.targetDuration||"duration"in this.currentUri||(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(p){case E.TARGET_DURATION:if(!isFinite(v)||v<0)return;this.manifest.targetDuration=v,this.setHoldBack();break;case E.PART_INF:H(this.manifest,X),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case E.SERVER_CONTROL:H(this.manifest,X),this.setHoldBack();break;case E.INF:v===0?this.currentUri.duration=.01:v>0&&(this.currentUri.duration=v);break;case E.PROGRAM_DATE_TIME:var P=v,B=new Date(P);this.manifest.dateTimeString||(this.manifest.dateTimeString=P,this.manifest.dateTimeObject=B),this.currentUri.dateTimeString=P,this.currentUri.dateTimeObject=B;break;case E.VERSION:H(this.manifest,X);break;case E.SESSION_DATA:var z=F(X[1]),ce=(0,I.default)(z);(0,A.default)(this.manifest.sessionData,ce)}},M.prototype.setHoldBack=function(){var ee=this.manifest,D=ee.serverControl,X=ee.targetDuration,p=ee.partTargetDuration;if(D){var v="holdBack",P="partHoldBack",B=X&&3*X,z=p&&2*p;X&&!D.hasOwnProperty(v)&&(D[v]=B),B&&D[v]<B&&(D[v]=B),p&&!D.hasOwnProperty(P)&&(D[P]=3*p),p&&D[P]<z&&(D[P]=z)}};var H=function(ee,D){var X=te(D[0].replace("#EXT-X-","")),p=void 0;N(D[1])?(p={},p=(0,A.default)(C(D[1]),p)):p=V(D[1]),ee[X]=p},te=function(ee){return ee.toLowerCase().replace(/-(\w)/g,function(D){return D[1].toUpperCase()})},V=function(ee){if(ee.toLowerCase()==="yes"||ee.toLowerCase()==="no")return ee.toLowerCase()==="yes";var D=ee.indexOf(":")!==-1?ee:parseFloat(ee);return isNaN(D)?ee:D},J=function(ee){var D={},X=ee.split("=");return X.length>1&&(D[te(X[0])]=V(X[1])),D},C=function(ee){for(var D=ee.split(","),X={},p=0;D.length>p;p++){var v=D[p],P=J(v);X=(0,A.default)(P,X)}return X},N=function(ee){return ee.indexOf("=")>-1},R=function(ee,D){return D===-1?[ee]:[ee.substring(0,D),ee.substring(D+1)]},F=function(ee){var D={};if(ee){var X=ee.search(",");return[ee.slice(0,X),ee.slice(X+1)].forEach(function(p,v){for(var P=p.replace(/['"]+/g,"").split("="),B=0;B<P.length;B++)P[B]==="DATA-ID"&&(D["DATA-ID"]=P[1-B]),P[B]==="VALUE"&&(D.VALUE=P[1-B])}),{data:D}}};w.default=M},function(U,w,L){Object.defineProperty(w,"__esModule",{value:!0});var y={PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"};w.default=y}])},ke.exports=Te()},function(ke,ie,we){function Te(A,I){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return{}},te=!1;A.on("adstart",function(){te=!0}),A.on("adend",function(){te=!1}),A.on("adserror",function(){te=!1});var V=function(){var J=y(I.currentTime()),C=function R(){var F=L.default.utils.now(),ee=y(I.currentTime());if(te){if(ee>J){var D=H();D.viewer_time=F-Math.max(0,ee-J),I.off("timeupdate",R),A.mux.emit("adplaying",D)}}else I.off("timeupdate",R)};I.on("timeupdate",C);var N=function R(){I.off("timeupdate",C),E.forEach(function(F){I.off(F,R)})};E.forEach(function(R){I.on(R,N)})};M.forEach(function(J){I.on(J,V)})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=Te;var U,w=we(0),L=(U=w)&&U.__esModule?U:{default:U},y=L.default.utils.secondsToMs},function(ke,ie,we){function Te(ee){return ee&&ee.__esModule?ee:{default:ee}}function U(ee){var D=ee;return function(X){if(D.IS_IE8)return!1;var p=this,v=p.id();(X=J({automaticErrorTracking:!0},X)).data=J({player_software_name:"Video.js",player_software_version:D.VERSION||"< 4.11",player_mux_plugin_name:"videojs-mux",player_mux_plugin_version:"4.6.6"},X.data),X.getPlayheadTime=function(){return R(p.currentTime())},X.getStateData=function(){var ae=C(p,"videoHeight"),ge=C(p,"videoWidth");if(ge===void 0||ae===void 0){var ue=p.el().firstChild;ue&&ue.nodeName.toUpperCase()==="VIDEO"&&(ae=ue.videoHeight,ge=ue.videoWidth)}return{player_is_paused:C(p,"paused"),player_is_fullscreen:C(p,"isFullscreen"),player_autoplay_on:!!C(p,"autoplay"),player_preload_on:C(p,"preload"),player_width:N(p.el(),"width"),player_height:N(p.el(),"height"),player_language_code:C(p,"language"),video_poster_url:C(p,"poster"),video_source_url:C(p,"currentSrc"),video_source_mime_type:C(p,"currentType")&&C(p,"currentType").toLowerCase(),video_source_duration:R(C(p,"duration")||0),video_source_is_live:p.duration()===1/0,video_source_height:ae,video_source_width:ge}},p.mux=function(){V.error("[videojs-mux] The plugin was initialized more than once.")},p.mux.emit=function(ae,ge){y.default.emit(v,ae,ge)},p.mux.addHLSJS=function(ae){y.default.addHLSJS(v,ae)},p.mux.log=V,p.mux.utils=y.default.utils,y.default.init(v,X);var P=!1,B=function(){P||p.mux.emit("playerready"),P=!0};p.ready(function(){p.addClass("vjs-mux"),A.default.setTimeout(B,0)});var z=!1;p.one("play",B),F.forEach(function(ae){(ae!=="error"||X.automaticErrorTracking)&&p.on(ae,function(){if(!z){var ge={};if(ae==="error"){var ue=C(p,"error");if(ue&&ue.code===1)return;ge.player_error_code=ue&&ue.code,ge.player_error_message=ue&&ue.message}p.mux.emit(ae,ge)}})});var ce=!1;p.on("play",function(){ce=!0}),p.on("pause",function(){ce=!1}),p.on("adstart",function(){z=!0,ce&&p.mux.emit("pause"),p.mux.emit("adbreakstart")}),p.on("adend",function(){p.mux.emit("adbreakend"),z=!1,C(p,"paused")||(p.mux.emit("play"),ce=!0,p.onceux&&p.mux.emit("playing"))}),p.ima&&(0,I.default)(p),p.onceux&&(0,H.default)(p),p.ima3&&typeof p.ima3.ready=="function"&&(0,E.default)(p),p.FreeWheelPlugin&&p.FreeWheelPlugin.VERSION&&(0,M.default)(p),p.on("dispose",function(){p.mux.emit("destroy")})}}function w(ee){(ee.registerPlugin||ee.plugin||function(){y.default.log.error("No valid method to register videojs plugin available.")})("mux",U(ee)),(0,te.default)(ee)}Object.defineProperty(ie,"__esModule",{value:!0}),ie.register=w;var L=Te(we(3)),y=Te(we(0)),A=Te(we(4)),I=Te(we(6)),E=Te(we(7)),M=Te(we(8)),H=Te(we(9)),te=Te(we(10)),V=y.default.log,J=y.default.utils.assign,C=y.default.utils.safeCall,N=y.default.utils.getComputedStyle,R=y.default.utils.secondsToMs,F=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"];w(L.default)},function(ke,ie){ke.exports=O},function(ke,ie,we){(function(Te){var U;U=typeof window<"u"?window:Te!==void 0?Te:typeof self<"u"?self:{},ke.exports=U}).call(ie,we(5))},function(ke,ie){var we;we=function(){return this}();try{we=we||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(we=window)}ke.exports=we},function(ke,ie,we){function Te(U){var w=function(V){var J=typeof(V=V||{}).getAdData=="function"?V.getAdData():{},C=typeof V.getAd=="function"?V.getAd():{},N=typeof C.getMediaUrl=="function"?C.getMediaUrl():J.mediaUrl,R=U.ima.settings||{},F={};return N&&(F.ad_asset_url=N),R.adTagUrl&&(F.ad_tag_url=R.adTagUrl),F},L=void 0,y=void 0,A=void 0,I=void 0,E=void 0,M=void 0;try{var H=window.google.ima.AdEvent.Type;L=H.LOADED,y=H.STARTED,A=H.COMPLETE,I=H.PAUSED,E=H.RESUMED,M=H.SKIPPED}catch{L="loaded",y="start",A="complete",I="pause",E="resume",M="skip"}var te=0;U.mux.triggerAdRequest=function(){te++,U.mux.emit("adrequest",w())},U.on("adsready",function(){var V=U.ima.addEventListener||function(){};V(L,function(J){var C=w(J);te>0&&(te--,U.mux.emit("adresponse",C)),U.mux.emit("adplay",C)}),V(y,function(J){var C=w(J);U.mux.emit("adplaying",C)}),V(E,function(J){var C=w(J);U.mux.emit("adplay",C),U.mux.emit("adplaying",C)}),V(I,function(J){var C=w(J);U.mux.emit("adpause",C)}),V(A,function(J){var C=w(J);U.mux.emit("adended",C)}),V(M,function(J){var C=w(J);U.mux.emit("adended",C)}),U.on("adserror",function(){te>0&&(te--,U.mux.emit("adresponse")),U.mux.emit("aderror")})})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=Te},function(ke,ie,we){function Te(A){if(typeof A!="string")return!1;var I=A.split(".").map(function(H){return parseInt(H)}),E=I[0],M=I[1];return E>2||E===2&&M>=3}function U(A){var I=function(){var H=A.ima3.currentAd,te=A.ima3.settings,V={};return H&&(V.ad_asset_url=H.mediaUrl),te&&(V.ad_tag_url=te.serverUrl),V};if(Te(A.ima3.version)){var E=0,M=function(){E>0&&(E--,A.mux.emit("adresponse",I()))};A.on("ads-request",function(){E++,A.mux.emit("adrequest",I())}),A.on("ads-load",function(){M(),A.mux.emit("adplay",I())}),A.on("adserror",function(){M(),A.mux.emit("aderror")}),A.on("ads-play",function(){A.mux.emit("adplay",I())}),A.on("ads-pause",function(){A.mux.emit("adpause",I())}),A.on("ads-ad-ended",function(){A.mux.emit("adended",I())})}A.ima3.ready(function(){if(A.ima3.adPlayer){Te(A.ima3.version)||(A.ima3.adPlayer.on("play",function(){A.mux.emit("adplay")}),A.ima3.adPlayer.on("pause",function(){A.mux.emit("adpause")}),A.ima3.adPlayer.on("ended",function(){A.mux.emit("adended")}));var H=["pause","ended","adserror"],te=["play"];(0,y.default)(A,A.ima3.adPlayer,H,te,I)}else A.mux.log("Legacy IMA3 plugin found, ad events may not track correctly."),A.on("ads-ad-started",function(){A.mux.emit("adplaying",I())}),A.on("ads-play",function(){A.mux.emit("adplaying",I())})})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.brightcoveImaAdsEventsSupported=Te,ie.default=U;var w,L=we(1),y=(w=L)&&w.__esModule?w:{default:w}},function(ke,ie,we){function Te(U){var w=function(L){var y=U.FreeWheelPlugin,A={};switch(L){case"adplay":case"adplaying":case"adpause":A.ad_asset_url=U.currentSrc()}return y&&(A.ad_tag_url=y.tech.toLowerCase()==="html5"?y.settings.Html5.serverUrl:y.settings.Flash.serverUrl),A};U.on("ads-request",function(){U.mux.emit("adrequest",w("adrequest"))}),U.on("ads-load",function(){U.mux.emit("adresponse",w("adresponse"))}),U.on("adserror",function(){U.mux.emit("aderror")}),U.on("ads-ad-started",function(){U.mux.emit("adplay",w("adplay")),U.mux.emit("adplaying",w("adplaying"))}),U.on("ads-play",function(){U.mux.emit("adplay",w("adplay")),U.mux.emit("adplaying",w("adplaying"))}),U.on("ads-pause",function(){U.mux.emit("adpause",w("adpause"))}),U.on("ads-ad-ended",function(){U.mux.emit("adended",w("adended"))}),U.on("adend",function(){U.mux.emit("play")})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=Te},function(ke,ie,we){function Te(y){var A=["onceux-linearad-pause","onceux-linearad-skipped","onceux-linearad-complete","adserror"],I=["adstart","onceux-linearad-resume"];(0,L.default)(y,y,A,I),y.on("adstart",function(){y.mux.emit("adplay")}),y.on("onceux-linearad-start",function(E){E.linearAd&&E.linearAd.index>0&&(y.mux.emit("adplay"),y.mux.emit("adplaying"))}),y.on("onceux-linearad-resume",function(){y.mux.emit("adplay")}),y.on("onceux-linearad-pause",function(){y.mux.emit("adpause")}),y.on("onceux-linearad-complete",function(){y.mux.emit("adended")}),y.on("onceux-linearad-skipped",function(){y.mux.emit("adended")})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=Te;var U,w=we(1),L=(U=w)&&U.__esModule?U:{default:U}},function(ke,ie,we){function Te(E){if(!I.get(E)&&(I.set(E,"video.js "+E.VERSION+" initialized"),typeof E.getTech=="function"))for(var M=(E.getTech("Html5")||{}).sourceHandlers,H=0;H<M.length;H++)(function(te){var V=M[te],J=V.handleSource;V.handleSource=function(C,N){var R=J(C,N,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});if(R&&typeof R.xhr=="function")try{var F=E.VERSION.split("."),ee=U(F,2),D=ee[0],X=ee[1];D=parseInt(D),X=parseInt(X);var p=D>=7&&X>=4?R.player().id():R.player_.el_.parentNode.id;(0,y.default)(E(p),R.xhr),(0,A.trackRenditionChanges)(E(p))}catch{}return R}})(H)}Object.defineProperty(ie,"__esModule",{value:!0});var U=function(){function E(M,H){var te=[],V=!0,J=!1,C=void 0;try{for(var N,R=M[Symbol.iterator]();!(V=(N=R.next()).done)&&(te.push(N.value),!H||te.length!==H);V=!0);}catch(F){J=!0,C=F}finally{try{!V&&R.return&&R.return()}finally{if(J)throw C}}return te}return function(M,H){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return E(M,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();ie.default=Te;var w,L=we(11),y=(w=L)&&w.__esModule?w:{default:w},A=we(13),I=new Map},function(ke,ie,we){function Te(y){return y&&y.__esModule?y:{default:y}}function U(y,A){var I=function(M,H,te){var V=(0,w.default)(y,M,H);return function(){try{V()}catch{}try{te()}catch{}}},E=function(M){return function(H){var te=L.default.utils.now();try{M(H)}catch{}try{H.onreadystatechange=I(H,te,H.onreadystatechange||function(){})}catch{}}};A.beforeRequest=function(M){return function(H){var te=M(H);return te.beforeSend=E(te.beforeSend||function(){}),te}}(A.beforeRequest||function(M){return M})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=U;var w=Te(we(12)),L=Te(we(0))},function(ke,ie,we){function Te(A,I,E){var M=A.mux.utils.extractHostnameAndDomain,H=A.mux.utils.headersStringToObject,te=function(J){var C=J["content-type"];return C?C.match(/^audio\/mpegurl/i)?"manifest":C.match(/^audio.*/i)?"audio":C.match(/^video.*/)?"video":C.match(/^application\/x-mpegurl/i)||C.match(/^application\/vnd.apple.mpegurl/i)||C.match(/^application\/dash+xml/i)?"manifest":"unknown":"unknown"},V=0;return function(){var J=I.readyState;if(J>=2){if(V=V||y.default.utils.now(),J!==4)return;if(I.status>=200&&I.status<300){var C=y.default.utils.now(),N=I.responseType==="arraybuffer"?I.response.byteLength:I.responseText.length,R=M(I.responseURL),F=U(R,1)[0],ee=H(I.getAllResponseHeaders?I.getAllResponseHeaders():""),D=te(ee),X={request_start:E,request_response_start:V,request_response_end:C,request_bytes_loaded:N,request_hostname:F,request_response_headers:ee,request_type:D};A.mux.emit("requestcompleted",X)}else A.mux.emit("requestfailed")}}}Object.defineProperty(ie,"__esModule",{value:!0});var U=function(){function A(I,E){var M=[],H=!0,te=!1,V=void 0;try{for(var J,C=I[Symbol.iterator]();!(H=(J=C.next()).done)&&(M.push(J.value),!E||M.length!==E);H=!0);}catch(N){te=!0,V=N}finally{try{!H&&C.return&&C.return()}finally{if(te)throw V}}return M}return function(I,E){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return A(I,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();ie.default=Te;var w,L=we(0),y=(w=L)&&w.__esModule?w:{default:w}},function(ke,ie,we){Object.defineProperty(ie,"__esModule",{value:!0});var Te=function(w){for(var L=w.textTracks(),y=void 0,A=0;A<L.length;A++)L[A].label==="segment-metadata"&&(y=L[A]);return y},U=function(w){var L=Te(w),y=void 0;L&&L.on&&L.on("cuechange",function(){try{var A=w.tech({IWillNotUseThisInPlugins:!0}),I=(A.vhs||A.hls).playlists.media().attributes.BANDWIDTH;y!==I&&w.mux.emit("renditionchange",{video_source_bitrate:I}),y=I}catch(E){w.mux&&w.mux.log&&w.mux.log.warn&&w.mux.log.warn("Cannot retrieve BANDWIDTH information from player: "+E)}})};ie.getSegmentMetadataTrack=Te,ie.trackRenditionChanges=U}])},We.exports=Ie(Ae(323))},497:(We,je,Ae)=>{var Ie=Ae(697),O=We.exports={WebVTT:Ae(13),VTTCue:Ae(190),VTTRegion:Ae(146)};Ie.vttjs=O,Ie.WebVTT=O.WebVTT;var ke=O.VTTCue,ie=O.VTTRegion,we=Ie.VTTCue,Te=Ie.VTTRegion;O.shim=function(){Ie.VTTCue=ke,Ie.VTTRegion=ie},O.restore=function(){Ie.VTTCue=we,Ie.VTTRegion=Te},Ie.VTTCue||O.shim()},13:(We,je,Ae)=>{var Ie=Ae(675),O=Object.create||function(){function p(){}return function(v){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return p.prototype=v,new p}}();function ke(p,v){this.name="ParsingError",this.code=p.code,this.message=v||p.message}function ie(p){function v(B,z,ce,ae){return 3600*(0|B)+60*(0|z)+(0|ce)+(0|ae)/1e3}var P=p.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return P?P[3]?v(P[1],P[2],P[3].replace(":",""),P[4]):P[1]>59?v(P[1],P[2],0,P[4]):v(0,P[1],P[2],P[4]):null}function we(){this.values=O(null)}function Te(p,v,P,B){var z=B?p.split(B):[p];for(var ce in z)if(typeof z[ce]=="string"){var ae=z[ce].split(P);ae.length===2&&v(ae[0].trim(),ae[1].trim())}}function U(p,v,P){var B=p;function z(){var ge=ie(p);if(ge===null)throw new ke(ke.Errors.BadTimeStamp,"Malformed timestamp: "+B);return p=p.replace(/^[^\sa-zA-Z-]+/,""),ge}function ce(ge,ue){var le=new we;Te(ge,function(pe,se){switch(pe){case"region":for(var oe=P.length-1;oe>=0;oe--)if(P[oe].id===se){le.set(pe,P[oe].region);break}break;case"vertical":le.alt(pe,se,["rl","lr"]);break;case"line":var xe=se.split(","),Q=xe[0];le.integer(pe,Q),le.percent(pe,Q)&&le.set("snapToLines",!1),le.alt(pe,Q,["auto"]),xe.length===2&&le.alt("lineAlign",xe[1],["start","center","end"]);break;case"position":xe=se.split(","),le.percent(pe,xe[0]),xe.length===2&&le.alt("positionAlign",xe[1],["start","center","end"]);break;case"size":le.percent(pe,se);break;case"align":le.alt(pe,se,["start","center","end","left","right"])}},/:/,/\s/),ue.region=le.get("region",null),ue.vertical=le.get("vertical","");try{ue.line=le.get("line","auto")}catch{}ue.lineAlign=le.get("lineAlign","start"),ue.snapToLines=le.get("snapToLines",!0),ue.size=le.get("size",100);try{ue.align=le.get("align","center")}catch{ue.align=le.get("align","middle")}try{ue.position=le.get("position","auto")}catch{ue.position=le.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},ue.align)}ue.positionAlign=le.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},ue.align)}function ae(){p=p.replace(/^\s+/,"")}if(ae(),v.startTime=z(),ae(),p.substr(0,3)!=="-->")throw new ke(ke.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+B);p=p.substr(3),ae(),v.endTime=z(),ae(),ce(p,v)}ke.prototype=O(Error.prototype),ke.prototype.constructor=ke,ke.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},we.prototype={set:function(p,v){!this.get(p)&&v!==""&&(this.values[p]=v)},get:function(p,v,P){return P?this.has(p)?this.values[p]:v[P]:this.has(p)?this.values[p]:v},has:function(p){return p in this.values},alt:function(p,v,P){for(var B=0;B<P.length;++B)if(v===P[B]){this.set(p,v);break}},integer:function(p,v){/^-?\d+$/.test(v)&&this.set(p,parseInt(v,10))},percent:function(p,v){return!!(v.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(v=parseFloat(v),v>=0&&v<=100))&&(this.set(p,v),!0)}};var w=Ie.createElement&&Ie.createElement("textarea"),L={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},y={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)"},A={v:"title",lang:"lang"},I={rt:"ruby"};function E(p,v){function P(){if(!v)return null;function Q(de){return v=v.substr(de.length),de}var Y=v.match(/^([^<]*)(<[^>]*>?)?/);return Q(Y[1]?Y[1]:Y[2])}function B(Q){return w.innerHTML=Q,Q=w.textContent,w.textContent="",Q}function z(Q,Y){return!I[Y.localName]||I[Y.localName]===Q.localName}function ce(Q,Y){var de=L[Q];if(!de)return null;var $=p.document.createElement(de),Z=A[Q];return Z&&Y&&($[Z]=Y.trim()),$}for(var ae,ge=p.document.createElement("div"),ue=ge,le=[];(ae=P())!==null;)if(ae[0]!=="<")ue.appendChild(p.document.createTextNode(B(ae)));else{if(ae[1]==="/"){le.length&&le[le.length-1]===ae.substr(2).replace(">","")&&(le.pop(),ue=ue.parentNode);continue}var pe,se=ie(ae.substr(1,ae.length-2));if(se){pe=p.document.createProcessingInstruction("timestamp",se),ue.appendChild(pe);continue}var oe=ae.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!oe||!(pe=ce(oe[1],oe[3]))||!z(ue,pe))continue;if(oe[2]){var xe=oe[2].split(".");xe.forEach(function(Q){var Y=/^bg_/.test(Q),de=Y?Q.slice(3):Q;if(y.hasOwnProperty(de)){var $=Y?"background-color":"color",Z=y[de];pe.style[$]=Z}}),pe.className=xe.join(" ")}le.push(oe[1]),ue.appendChild(pe),ue=pe}return ge}var M=[[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 H(p){for(var v=0;v<M.length;v++){var P=M[v];if(p>=P[0]&&p<=P[1])return!0}return!1}function te(p){var v=[],P="";if(!p||!p.childNodes)return"ltr";function B(ae,ge){for(var ue=ge.childNodes.length-1;ue>=0;ue--)ae.push(ge.childNodes[ue])}function z(ae){if(!ae||!ae.length)return null;var ge=ae.pop(),ue=ge.textContent||ge.innerText;if(ue){var le=ue.match(/^.*(\n|\r)/);return le?(ae.length=0,le[0]):ue}return ge.tagName==="ruby"?z(ae):ge.childNodes?(B(ae,ge),z(ae)):void 0}for(B(v,p);P=z(v);)for(var ce=0;ce<P.length;ce++)if(H(P.charCodeAt(ce)))return"rtl";return"ltr"}function V(p){if(typeof p.line=="number"&&(p.snapToLines||p.line>=0&&p.line<=100))return p.line;if(!p.track||!p.track.textTrackList||!p.track.textTrackList.mediaElement)return-1;for(var v=p.track,P=v.textTrackList,B=0,z=0;z<P.length&&P[z]!==v;z++)P[z].mode==="showing"&&B++;return-1*++B}function J(){}function C(p,v,P){J.call(this),this.cue=v,this.cueDiv=E(p,v.text);var B={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:v.vertical===""?"horizontal-tb":v.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(B,this.cueDiv),this.div=p.document.createElement("div"),B={direction:te(this.cueDiv),writingMode:v.vertical===""?"horizontal-tb":v.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:v.align==="middle"?"center":v.align,font:P.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(B),this.div.appendChild(this.cueDiv);var z=0;switch(v.positionAlign){case"start":z=v.position;break;case"center":z=v.position-v.size/2;break;case"end":z=v.position-v.size}v.vertical===""?this.applyStyles({left:this.formatStyle(z,"%"),width:this.formatStyle(v.size,"%")}):this.applyStyles({top:this.formatStyle(z,"%"),height:this.formatStyle(v.size,"%")}),this.move=function(ce){this.applyStyles({top:this.formatStyle(ce.top,"px"),bottom:this.formatStyle(ce.bottom,"px"),left:this.formatStyle(ce.left,"px"),right:this.formatStyle(ce.right,"px"),height:this.formatStyle(ce.height,"px"),width:this.formatStyle(ce.width,"px")})}}function N(p){var v,P,B,z;if(p.div){P=p.div.offsetHeight,B=p.div.offsetWidth,z=p.div.offsetTop;var ce=(ce=p.div.childNodes)&&(ce=ce[0])&&ce.getClientRects&&ce.getClientRects();p=p.div.getBoundingClientRect(),v=ce?Math.max(ce[0]&&ce[0].height||0,p.height/ce.length):0}this.left=p.left,this.right=p.right,this.top=p.top||z,this.height=p.height||P,this.bottom=p.bottom||z+(p.height||P),this.width=p.width||B,this.lineHeight=v!==void 0?v:p.lineHeight}function R(p,v,P,B){function z(de,$){for(var Z,fe=new N(de),Pe=1,Re=0;Re<$.length;Re++){for(;de.overlapsOppositeAxis(P,$[Re])||de.within(P)&&de.overlapsAny(B);)de.move($[Re]);if(de.within(P))return de;var Fe=de.intersectPercentage(P);Pe>Fe&&(Z=new N(de),Pe=Fe),de=new N(fe)}return Z||fe}var ce=new N(v),ae=v.cue,ge=V(ae),ue=[];if(ae.snapToLines){var le;switch(ae.vertical){case"":ue=["+y","-y"],le="height";break;case"rl":ue=["+x","-x"],le="width";break;case"lr":ue=["-x","+x"],le="width"}var pe=ce.lineHeight,se=pe*Math.round(ge),oe=P[le]+pe,xe=ue[0];Math.abs(se)>oe&&(se=se<0?-1:1,se*=Math.ceil(oe/pe)*pe),ge<0&&(se+=ae.vertical===""?P.height:P.width,ue=ue.reverse()),ce.move(xe,se)}else{var Q=ce.lineHeight/P.height*100;switch(ae.lineAlign){case"center":ge-=Q/2;break;case"end":ge-=Q}switch(ae.vertical){case"":v.applyStyles({top:v.formatStyle(ge,"%")});break;case"rl":v.applyStyles({left:v.formatStyle(ge,"%")});break;case"lr":v.applyStyles({right:v.formatStyle(ge,"%")})}ue=["+y","-x","+x","-y"],ce=new N(v)}var Y=z(ce,ue);v.move(Y.toCSSCompatValues(P))}function F(){}J.prototype.applyStyles=function(p,v){for(var P in v=v||this.div,p)p.hasOwnProperty(P)&&(v.style[P]=p[P])},J.prototype.formatStyle=function(p,v){return p===0?0:p+v},C.prototype=O(J.prototype),C.prototype.constructor=C,N.prototype.move=function(p,v){switch(v=v!==void 0?v:this.lineHeight,p){case"+x":this.left+=v,this.right+=v;break;case"-x":this.left-=v,this.right-=v;break;case"+y":this.top+=v,this.bottom+=v;break;case"-y":this.top-=v,this.bottom-=v}},N.prototype.overlaps=function(p){return this.left<p.right&&this.right>p.left&&this.top<p.bottom&&this.bottom>p.top},N.prototype.overlapsAny=function(p){for(var v=0;v<p.length;v++)if(this.overlaps(p[v]))return!0;return!1},N.prototype.within=function(p){return this.top>=p.top&&this.bottom<=p.bottom&&this.left>=p.left&&this.right<=p.right},N.prototype.overlapsOppositeAxis=function(p,v){switch(v){case"+x":return this.left<p.left;case"-x":return this.right>p.right;case"+y":return this.top<p.top;case"-y":return this.bottom>p.bottom}},N.prototype.intersectPercentage=function(p){return Math.max(0,Math.min(this.right,p.right)-Math.max(this.left,p.left))*Math.max(0,Math.min(this.bottom,p.bottom)-Math.max(this.top,p.top))/(this.height*this.width)},N.prototype.toCSSCompatValues=function(p){return{top:this.top-p.top,bottom:p.bottom-this.bottom,left:this.left-p.left,right:p.right-this.right,height:this.height,width:this.width}},N.getSimpleBoxPosition=function(p){var v=p.div?p.div.offsetHeight:p.tagName?p.offsetHeight:0,P=p.div?p.div.offsetWidth:p.tagName?p.offsetWidth:0,B=p.div?p.div.offsetTop:p.tagName?p.offsetTop:0;return{left:(p=p.div?p.div.getBoundingClientRect():p.tagName?p.getBoundingClientRect():p).left,right:p.right,top:p.top||B,height:p.height||v,bottom:p.bottom||B+(p.height||v),width:p.width||P}},F.StringDecoder=function(){return{decode:function(p){if(!p)return"";if(typeof p!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(p))}}},F.convertCueToDOMTree=function(p,v){return p&&v?E(p,v):null};var ee=.05,D="sans-serif",X="1.5%";F.processCues=function(p,v,P){if(!p||!v||!P)return null;for(;P.firstChild;)P.removeChild(P.firstChild);var B=p.document.createElement("div");function z(le){for(var pe=0;pe<le.length;pe++)if(le[pe].hasBeenReset||!le[pe].displayState)return!0;return!1}if(B.style.position="absolute",B.style.left="0",B.style.right="0",B.style.top="0",B.style.bottom="0",B.style.margin=X,P.appendChild(B),z(v)){var ce=[],ae=N.getSimpleBoxPosition(B),ge={font:Math.round(ae.height*ee*100)/100+"px "+D};(function(){for(var le,pe,se=0;se<v.length;se++)pe=v[se],le=new C(p,pe,ge),B.appendChild(le.div),R(p,le,ae,ce),pe.displayState=le.div,ce.push(N.getSimpleBoxPosition(le))})()}else for(var ue=0;ue<v.length;ue++)B.appendChild(v[ue].displayState)},F.Parser=function(p,v,P){P||(P=v,v={}),v||(v={}),this.window=p,this.vttjs=v,this.state="INITIAL",this.buffer="",this.decoder=P||new TextDecoder("utf8"),this.regionList=[]},F.Parser.prototype={reportOrThrowError:function(p){if(!(p instanceof ke))throw p;this.onparsingerror&&this.onparsingerror(p)},parse:function(p){var v=this;function P(){for(var pe=v.buffer,se=0;se<pe.length&&pe[se]!=="\r"&&pe[se]!==` `;)++se;var oe=pe.substr(0,se);return pe[se]==="\r"&&++se,pe[se]===` `&&++se,v.buffer=pe.substr(se),oe}function B(pe){var se=new we;if(Te(pe,function(xe,Q){switch(xe){case"id":se.set(xe,Q);break;case"width":se.percent(xe,Q);break;case"lines":se.integer(xe,Q);break;case"regionanchor":case"viewportanchor":var Y=Q.split(",");if(Y.length!==2)break;var de=new we;if(de.percent("x",Y[0]),de.percent("y",Y[1]),!de.has("x")||!de.has("y"))break;se.set(xe+"X",de.get("x")),se.set(xe+"Y",de.get("y"));break;case"scroll":se.alt(xe,Q,["up"])}},/=/,/\s/),se.has("id")){var oe=new(v.vttjs.VTTRegion||v.window.VTTRegion);oe.width=se.get("width",100),oe.lines=se.get("lines",3),oe.regionAnchorX=se.get("regionanchorX",0),oe.regionAnchorY=se.get("regionanchorY",100),oe.viewportAnchorX=se.get("viewportanchorX",0),oe.viewportAnchorY=se.get("viewportanchorY",100),oe.scroll=se.get("scroll",""),v.onregion&&v.onregion(oe),v.regionList.push({id:se.get("id"),region:oe})}}function z(pe){var se=new we;Te(pe,function(oe,xe){switch(oe){case"MPEGT":se.integer(oe+"S",xe);break;case"LOCA":se.set(oe+"L",ie(xe))}},/[^\d]:/,/,/),v.ontimestampmap&&v.ontimestampmap({MPEGTS:se.get("MPEGTS"),LOCAL:se.get("LOCAL")})}function ce(pe){pe.match(/X-TIMESTAMP-MAP/)?Te(pe,function(se,oe){se==="X-TIMESTAMP-MAP"&&z(oe)},/=/):Te(pe,function(se,oe){se==="Region"&&B(oe)},/:/)}p&&(v.buffer+=v.decoder.decode(p,{stream:!0}));try{var ae;if(v.state==="INITIAL"){if(!/\r\n|\n/.test(v.buffer))return this;var ge=(ae=P()).match(/^WEBVTT([ \t].*)?$/);if(!ge||!ge[0])throw new ke(ke.Errors.BadSignature);v.state="HEADER"}for(var ue=!1;v.buffer;){if(!/\r\n|\n/.test(v.buffer))return this;switch(ue?ue=!1:ae=P(),v.state){case"HEADER":/:/.test(ae)?ce(ae):ae||(v.state="ID");continue;case"NOTE":ae||(v.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(ae)){v.state="NOTE";break}if(!ae)continue;v.cue=new(v.vttjs.VTTCue||v.window.VTTCue)(0,0,"");try{v.cue.align="center"}catch{v.cue.align="middle"}if(v.state="CUE",ae.indexOf("-->")===-1){v.cue.id=ae;continue}case"CUE":try{U(ae,v.cue,v.regionList)}catch(pe){v.reportOrThrowError(pe),v.cue=null,v.state="BADCUE";continue}v.state="CUETEXT";continue;case"CUETEXT":var le=ae.indexOf("-->")!==-1;if(!ae||le&&(ue=!0)){v.oncue&&v.oncue(v.cue),v.cue=null,v.state="ID";continue}v.cue.text&&(v.cue.text+=` `),v.cue.text+=ae.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":ae||(v.state="ID");continue}}}catch(pe){v.reportOrThrowError(pe),v.state==="CUETEXT"&&v.cue&&v.oncue&&v.oncue(v.cue),v.cue=null,v.state=v.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var p=this;try{if(p.buffer+=p.decoder.decode(),(p.cue||p.state==="HEADER")&&(p.buffer+=` `,p.parse()),p.state==="INITIAL")throw new ke(ke.Errors.BadSignature)}catch(v){p.reportOrThrowError(v)}return p.onflush&&p.onflush(),this}},We.exports=F},190:We=>{var je="auto",Ae={"":1,lr:1,rl:1},Ie={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function O(we){return typeof we=="string"&&!!Ae[we.toLowerCase()]&&we.toLowerCase()}function ke(we){return typeof we=="string"&&!!Ie[we.toLowerCase()]&&we.toLowerCase()}function ie(we,Te,U){this.hasBeenReset=!1;var w="",L=!1,y=we,A=Te,I=U,E=null,M="",H=!0,te="auto",V="start",J="auto",C="auto",N=100,R="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return w},set:function(F){w=""+F}},pauseOnExit:{enumerable:!0,get:function(){return L},set:function(F){L=!!F}},startTime:{enumerable:!0,get:function(){return y},set:function(F){if(typeof F!="number")throw new TypeError("Start time must be set to a number.");y=F,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return A},set:function(F){if(typeof F!="number")throw new TypeError("End time must be set to a number.");A=F,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return I},set:function(F){I=""+F,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return E},set:function(F){E=F,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return M},set:function(F){var ee=O(F);if(ee===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");M=ee,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return H},set:function(F){H=!!F,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return te},set:function(F){if(typeof F!="number"&&F!==je)throw new SyntaxError("Line: an invalid number or illegal string was specified.");te=F,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return V},set:function(F){var ee=ke(F);ee?(V=ee,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return J},set:function(F){if(F<0||F>100)throw new Error("Position must be between 0 and 100.");J=F,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return C},set:function(F){var ee=ke(F);ee?(C=ee,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(F){if(F<0||F>100)throw new Error("Size must be between 0 and 100.");N=F,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return R},set:function(F){var ee=ke(F);if(!ee)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");R=ee,this.hasBeenReset=!0}}}),this.displayState=void 0}ie.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},We.exports=ie},146:We=>{var je={"":!0,up:!0};function Ae(ke){return typeof ke=="string"&&!!je[ke.toLowerCase()]&&ke.toLowerCase()}function Ie(ke){return typeof ke=="number"&&ke>=0&&ke<=100}function O(){var ke=100,ie=3,we=0,Te=100,U=0,w=100,L="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return ke},set:function(y){if(!Ie(y))throw new Error("Width must be between 0 and 100.");ke=y}},lines:{enumerable:!0,get:function(){return ie},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");ie=y}},regionAnchorY:{enumerable:!0,get:function(){return Te},set:function(y){if(!Ie(y))throw new Error("RegionAnchorX must be between 0 and 100.");Te=y}},regionAnchorX:{enumerable:!0,get:function(){return we},set:function(y){if(!Ie(y))throw new Error("RegionAnchorY must be between 0 and 100.");we=y}},viewportAnchorY:{enumerable:!0,get:function(){return w},set:function(y){if(!Ie(y))throw new Error("ViewportAnchorY must be between 0 and 100.");w=y}},viewportAnchorX:{enumerable:!0,get:function(){return U},set:function(y){if(!Ie(y))throw new Error("ViewportAnchorX must be between 0 and 100.");U=y}},scroll:{enumerable:!0,get:function(){return L},set:function(y){var A=Ae(y);A===!1?console.warn("Scroll: an invalid or illegal string was specified."):L=A}}})}We.exports=O},18:(We,je,Ae)=>{We.exports=Ae(61).default},61:(We,je,Ae)=>{Ae.d(je,{default:()=>xe});var Ie=Ae(323),O=Ae(675),ke=Ae.n(O);/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */function ie(Q,Y){Q.prototype=Object.create(Y.prototype),Q.prototype.constructor=Q,Q.__proto__=Y}function we(Q){if(Q===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q}var Te=function Q(Y){var de=this;if(Ie.default.browser.IS_IE8)for(var $ in de=ke().createElement("custom"),Q.prototype)$!=="constructor"&&(de[$]=Q.prototype[$]);return de.id=Y.id,de.label=de.id,de.width=Y.width,de.height=Y.height,de.bitrate=Y.bandwidth,de.enabled_=Y.enabled,Object.defineProperty(de,"enabled",{get:function(){return de.enabled_()},set:function(Z){de.enabled_(Z)}}),de},U=function(Q){function Y(){var $,Z=we(we($=Q.call(this)||this));if(Ie.default.browser.IS_IE8)for(var fe in Z=ke().createElement("custom"),Y.prototype)fe!=="constructor"&&(Z[fe]=Y.prototype[fe]);return Z.levels_=[],Z.selectedIndex_=-1,Object.defineProperty(Z,"selectedIndex",{get:function(){return Z.selectedIndex_}}),Object.defineProperty(Z,"length",{get:function(){return Z.levels_.length}}),Z||we($)}ie(Y,Q);var de=Y.prototype;return de.addQualityLevel=function($){var Z=this.getQualityLevelById($.id);if(Z)return Z;var fe=this.levels_.length;return Z=new Te($),""+fe in this||Object.defineProperty(this,fe,{get:function(){return this.levels_[fe]}}),this.levels_.push(Z),this.trigger({qualityLevel:Z,type:"addqualitylevel"}),Z},de.removeQualityLevel=function($){for(var Z=null,fe=0,Pe=this.length;fe<Pe;fe++)if(this[fe]===$){Z=this.levels_.splice(fe,1)[0],this.selectedIndex_===fe?this.selectedIndex_=-1:this.selectedIndex_>fe&&this.selectedIndex_--;break}return Z&&this.trigger({qualityLevel:$,type:"removequalitylevel"}),Z},de.getQualityLevelById=function($){for(var Z=0,fe=this.length;Z<fe;Z++){var Pe=this[Z];if(Pe.id===$)return Pe}return null},de.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},Y}(Ie.default.EventTarget);for(var w in U.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},U.prototype.allowedEvents_)U.prototype["on"+w]=null;var L="2.1.0",y=Ie.default.registerPlugin||Ie.default.plugin,A=function(Q,Y){var de=Q.qualityLevels,$=new U,Z=function fe(){$.dispose(),Q.qualityLevels=de,Q.off("dispose",fe)};return Q.on("dispose",Z),Q.qualityLevels=function(){return $},Q.qualityLevels.VERSION=L,$},I=function(Q){return A(this,Ie.default.mergeOptions({},Q))};y("qualityLevels",I),I.VERSION=L;var E="1.1.6";function M(Q,Y){Q.prototype=Object.create(Y.prototype),Q.prototype.constructor=Q,Q.__proto__=Y}function H(Q){if(Q===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q}var te=Ie.default.getComponent("MenuItem"),V=Ie.default.getComponent("Component"),J=function(Q){function Y($,Z){return Z.selectable=!0,Z.multiSelectable=!1,Q.call(this,$,Z)||this}M(Y,Q);var de=Y.prototype;return de.handleClick=function(){var $=this.options_;console.log("Changing quality to:",$.label),Q.prototype.handleClick.call(this);for(var Z=this.player().qualityLevels(),fe=0;fe<Z.length;fe++)$.index==Z.length||$.index==fe?Z[fe].enabled=!0:Z[fe].enabled=!1},de.update=function(){var $=this.player().qualityLevels().selectedIndex;this.selected(this.options_.index==$)},Y}(te);V.registerComponent("SourceMenuItem",J);var C=Ie.default.getComponent("MenuButton"),N=function(Q){function Y($,Z){var fe;fe=Q.call(this,$,Z)||this,C.apply(H(fe),arguments);var Pe=fe.player().qualityLevels();if(Z&&Z.default){if(Z.default=="low")for(var Re=0;Re<Pe.length;Re++)Pe[Re].enabled=Re==0;else if(Z.default="high")for(Re=0;Re<Pe.length;Re++)Pe[Re].enabled=Re==Pe.length-1}return fe.player().qualityLevels().on(["change","addqualitylevel"],Ie.default.bind(H(fe),fe.update)),fe}M(Y,Q);var de=Y.prototype;return de.createEl=function(){return Ie.default.dom.createEl("div",{className:"vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"})},de.buildCSSClass=function(){return C.prototype.buildCSSClass.call(this)+" vjs-icon-cog"},de.update=function(){return C.prototype.update.call(this)},de.createItems=function(){for(var $=[],Z=this.player().qualityLevels(),fe=[],Pe=0;Pe<Z.length;Pe++){var Re=Z.length-(Pe+1),Fe=Re===Z.selectedIndex,He=""+Re,Ze=Re;Z[Re].height?(He=Z[Re].height+"p",Ze=parseInt(Z[Re].height,10)):Z[Re].bitrate&&(He=Math.floor(Z[Re].bitrate/1e3)+" kbps",Ze=parseInt(Z[Re].bitrate,10)),!(fe.indexOf(He)>=0)&&(fe.push(He),$.push(new J(this.player_,{label:He,index:Re,selected:Fe,sortVal:Ze})))}return Z.length>1&&$.push(new J(this.player_,{label:"Auto",index:Z.length,selected:!1,sortVal:99999})),$.sort(function($e,Et){return $e.options_.sortVal<Et.options_.sortVal?1:$e.options_.sortVal>Et.options_.sortVal?-1:0}),$},Y}(C),R={},F=Ie.default.registerPlugin||Ie.default.plugin,ee=function(Q,Y){if(Q.addClass("vjs-http-source-selector"),console.log("videojs-http-source-selector initialized!"),console.log("player.techName_:"+Q.techName_),Q.techName_!="Html5")return!1;Q.on(["loadedmetadata"],function(de){if(Q.qualityLevels(),Ie.default.log("loadmetadata event"),Q.videojs_http_source_selector_initialized=="undefined"||Q.videojs_http_source_selector_initialized==1)console.log("player.videojs_http_source_selector_initialized == true");else{console.log("player.videojs_http_source_selector_initialized == false"),Q.videojs_http_source_selector_initialized=!0;var $=Q.controlBar,Z=$.getChild("fullscreenToggle").el();$.el().insertBefore($.addChild("SourceMenuButton").el(),Z)}})},D=function(Q){var Y=this;this.ready(function(){ee(Y,Ie.default.mergeOptions(R,Q))}),Ie.default.registerComponent("SourceMenuButton",N),Ie.default.registerComponent("SourceMenuItem",J)};F("httpSourceSelector",D),D.VERSION=E,Ae(810);const X={i8:"0.12.0"};Ae(288);var p=Ae(113),v=Ae.n(p);function P(Q){var Y,de;if((de=(Y=Q.tech_)==null?void 0:Y.sourceHandler_)!=null&&de.hls){const $=Q.tech_.sourceHandler_.hls;Q.mux.addHLSJS({hlsjs:$,Hls:v()})}}function B(Q,Y){var de,$,Z,fe,Pe;if((de=Q==null?void 0:Q.dataset)!=null&&de.setup){let Re=Q.dataset.setup;Re=JSON.parse(Re),Re&&((Z=($=Re==null?void 0:Re.plugins)==null?void 0:$.mux)!=null&&Z.data)&&(Re=z(Re),Re=JSON.stringify(Re),Q.dataset.setup=Re)}return(Pe=(fe=Y==null?void 0:Y.plugins)==null?void 0:fe.mux)!=null&&Pe.data&&(Y=z(Y)),Y}function z(Q){var Y;return Q.plugins.mux.data.player_software_name="vjs-mux-kit-"+((Y=Ie.default)==null?void 0:Y.VERSION.split(".")[0])+(typeof v()=="function"?"-hlsjs":"-vhs"),Q.plugins.mux.data.player_software_version=X.i8,Q}var ce=Ae(9);const ae={},ge={},ue=Ie.default.registerPlugin||Ie.default.plugin,le=(Q,Y)=>{Q.addClass("vjs-vtt-thumbnails"),Q.vttThumbnails=new se(Q,Y)},pe=function(Q){this.ready(()=>{le(this,Ie.default.mergeOptions(ae,Q))})};class se{constructor(Y,de){return this.player=Y,this.options=de,this.listenForDurationChange(),this.initializeThumbnails(),this.registeredEvents={},this}src(Y){this.resetPlugin(),this.options.src=Y,this.initializeThumbnails()}detach(){this.resetPlugin()}resetPlugin(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),this.progressBar&&(this.progressBar.removeEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.removeEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave),this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove)),delete this.registeredEvents.progressBarMouseEnter,delete this.registeredEvents.progressBarMouseLeave,delete this.registeredEvents.progressBarMouseMove,delete this.progressBar,delete this.vttData,delete this.thumbnailHolder,delete this.lastStyle}listenForDurationChange(){this.player.on("durationchange",()=>{})}initializeThumbnails(){if(!this.options.src)return;const Y=this.getBaseUrl(),de=this.getFullyQualifiedUrl(this.options.src,Y);this.getVttFile(de).then($=>{this.vttData=this.processVtt($),this.setupThumbnailElement()})}getBaseUrl(){return[window.location.protocol,"//",window.location.hostname,window.location.port?":"+window.location.port:"",window.location.pathname].join("").split(/([^\/]*)$/gi).shift()}getVttFile(Y){return new Promise((de,$)=>{const Z=new XMLHttpRequest;Z.data={resolve:de},Z.addEventListener("load",this.vttFileLoaded),Z.open("GET",Y),Z.overrideMimeType("text/plain; charset=utf-8"),Z.send()})}vttFileLoaded(){this.data.resolve(this.responseText)}setupThumbnailElement(Y){let de=null;this.options.showTimestamp||(de=this.player.$(".vjs-mouse-display"));const $=document.createElement("div");$.setAttribute("class","vjs-vtt-thumbnail-display"),this.progressBar=this.player.$(".vjs-progress-control"),this.progressBar.appendChild($),this.thumbnailHolder=$,de&&!this.options.showTimestamp&&de.classList.add("vjs-hidden"),this.registeredEvents.progressBarMouseEnter=()=>this.onBarMouseenter(),this.registeredEvents.progressBarMouseLeave=()=>this.onBarMouseleave(),this.progressBar.addEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.addEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave)}onBarMouseenter(){this.mouseMoveCallback=Y=>{this.onBarMousemove(Y)},this.registeredEvents.progressBarMouseMove=this.mouseMoveCallback,this.progressBar.addEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.showThumbnailHolder()}onBarMouseleave(){this.registeredEvents.progressBarMouseMove&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.hideThumbnailHolder()}getXCoord(Y,de){const $=Y.getBoundingClientRect(),Z=document.documentElement;return de-($.left+(window.pageXOffset||Z.scrollLeft||0))}onBarMousemove(Y){this.updateThumbnailStyle(Ie.default.dom.getPointerPosition(this.progressBar,Y).x,this.progressBar.offsetWidth)}getStyleForTime(Y){for(let de=0;de<this.vttData.length;++de){const $=this.vttData[de];if(Y>=$.start&&Y<$.end){if($.css.url&&!ge[$.css.url]){const Z=new Image;Z.src=$.css.url,ge[$.css.url]=Z}return $.css}}}showThumbnailHolder(){this.thumbnailHolder.style.opacity="1"}hideThumbnailHolder(){this.thumbnailHolder.style.opacity="0"}updateThumbnailStyle(Y,de){const $=Y*this.player.duration(),Z=this.getStyleForTime($);if(!Z)return this.hideThumbnailHolder();const fe=Y*de,Pe=parseInt(Z.width,10),Re=Pe>>1,Fe=de-(fe+Re),He=fe-Re;if(He>0&&Fe>0?this.thumbnailHolder.style.transform="translateX("+(fe-Re)+"px)":He<=0?this.thumbnailHolder.style.transform="translateX(0px)":Fe<=0&&(this.thumbnailHolder.style.transform="translateX("+(de-Pe)+"px)"),!this.lastStyle||this.lastStyle!==Z){this.lastStyle=Z;for(const Ze in Z)Z.hasOwnProperty(Ze)&&(this.thumbnailHolder.style[Ze]=Z[Ze])}}processVtt(Y){const de=[];return Y.split(/[\r\n][\r\n]/i).forEach($=>{if($.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)){const Z=$.split(/[\r\n]/i),fe=Z[0].split(/ ?--> ?/i),Pe=fe[0],Re=fe[1],Fe=Z[1],He=this.getVttCss(Fe);de.push({start:this.getSecondsFromTimestamp(Pe),end:this.getSecondsFromTimestamp(Re),css:He})}}),de}getFullyQualifiedUrl(Y,de){return Y.indexOf("//")>=0?Y:de.indexOf("//")===0?[de.replace(/\/$/gi,""),this.trim(Y,"/")].join("/"):de.indexOf("//")>0?[this.trim(de,"/"),this.trim(Y,"/")].join("/"):Y}getPropsFromDef(Y){const de=Y.split(/#xywh=/i),$=de[0],Z=de[1].match(/[0-9]+/gi);return{x:Z[0],y:Z[1],w:Z[2],h:Z[3],image:$}}getVttCss(Y){const de={};let $;if($=this.options.src.indexOf("//")>=0?this.options.src.split(/([^\/]*)$/gi).shift():this.getBaseUrl()+this.options.src.split(/([^\/]*)$/gi).shift(),!(Y=this.getFullyQualifiedUrl(Y,$)).match(/#xywh=/i))return de.background='url("'+Y+'")',de;const Z=this.getPropsFromDef(Y);return de.background='url("'+Z.image+'") no-repeat -'+Z.x+"px -"+Z.y+"px",de.width=Z.w+"px",de.height=Z.h+"px",de.url=Z.image,de}deconstructTimestamp(Y){const de=Y.split("."),$=de[0].split(":");return{milliseconds:parseInt(de[1],10)||0,seconds:parseInt($.pop(),10)||0,minutes:parseInt($.pop(),10)||0,hours:parseInt($.pop(),10)||0}}getSecondsFromTimestamp(Y){const de=this.deconstructTimestamp(Y);return parseInt(3600*de.hours+60*de.minutes+de.seconds+de.milliseconds/1e3,10)}trim(Y,de){let $=[" ",` `,"\r"," ","\f","\v"," "," ","â€"," "," "," "," "," "," "," "," "," ","​","\u2028","\u2029"," "].join(""),Z=0,fe=0;for(Y+="",de&&($=(de+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),Z=Y.length,fe=0;fe<Z;fe++)if($.indexOf(Y.charAt(fe))===-1){Y=Y.substring(fe);break}for(Z=Y.length,fe=Z-1;fe>=0;fe--)if($.indexOf(Y.charAt(fe))===-1){Y=Y.substring(0,fe+1);break}return $.indexOf(Y.charAt(0))===-1?Y:""}}function oe(Q){Q.timelineHoverPreviews=function(Y){let de=(Y==null?void 0:Y.enabled)||!1,$=(Y==null?void 0:Y.src)||null;return de||typeof Q.vttThumbnails.detach!="function"?typeof Q.vttThumbnails=="function"&&$!==null?(Q.vttThumbnails({src:$}),void(Q.options().timelineHoverPreviewsUrl=$)):typeof Q.vttThumbnails.src=="function"&&$!==null?(Q.vttThumbnails.src($),void(Q.options().timelineHoverPreviewsUrl=$)):void 0:(Q.vttThumbnails.detach(),void(Q.options().timelineHoverPreviewsUrl=null))}}ue("vttThumbnails",pe),Ie.default.hook("beforesetup",function(Q,Y){return Y=B(Q,Y)}),Ie.default.hook("setup",function(Q){oe(Q),Q.options().timelineHoverPreviewsUrl&&Q.timelineHoverPreviews({enabled:!0,src:Q.options().timelineHoverPreviewsUrl})}),Ie.default.use("video/mux",Q=>({setSource({src:Y},de){const{customDomain:$="mux.com",timelineHoverPreviews:Z}=Q.options();if(Z){let fe=`https://image.${$}/${Y.split("?",1)[0]}/storyboard.vtt`;Q.timelineHoverPreviews({enabled:!0,src:fe})}de(null,{src:`https://stream.${$}/${Y}`,type:"application/x-mpegurl"}),Q.mux&&Q.mux.addHLSJS&&P(Q),ce.setupSubtitlesForPlayer!==void 0&&(0,ce.setupSubtitlesForPlayer)(Q)}}));const xe=Ie.default},893:()=>{},113:()=>{},810:()=>{},9:()=>{},110:We=>{function je(){return We.exports=je=Object.assign?Object.assign.bind():function(Ae){for(var Ie=1;Ie<arguments.length;Ie++){var O=arguments[Ie];for(var ke in O)Object.prototype.hasOwnProperty.call(O,ke)&&(Ae[ke]=O[ke])}return Ae},We.exports.__esModule=!0,We.exports.default=We.exports,je.apply(this,arguments)}We.exports=je,We.exports.__esModule=!0,We.exports.default=We.exports}},Mo={};function In(We){var je=Mo[We];if(je!==void 0)return je.exports;var Ae=Mo[We]={exports:{}};return Cd[We].call(Ae.exports,Ae,Ae.exports,In),Ae.exports}return In.n=We=>{var je=We&&We.__esModule?()=>We.default:()=>We;return In.d(je,{a:je}),je},In.d=(We,je)=>{for(var Ae in je)In.o(je,Ae)&&!In.o(We,Ae)&&Object.defineProperty(We,Ae,{enumerable:!0,get:je[Ae]})},In.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),In.o=(We,je)=>Object.prototype.hasOwnProperty.call(We,je),In.r=We=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(We,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(We,"__esModule",{value:!0})},In(18)})());export{Zv as v};